Top 20

1 0x00h 705 pts
2 boris39 705 pts
3 neoxquick 686 pts
4 maf-ia 667 pts
5 thefinder 648 pts
6 benito255 612 pts
7 mego 594 pts
8 madbat2 585 pts
9 Mart 557 pts
10 tehron 507 pts
11 Kithyane 506 pts
12 plucth 483 pts
13 egosum 477 pts
14 CoYoTe99 420 pts
15 Undr 418 pts
16 Zeta 418 pts
17 loonies2 414 pts
18 Armavica 413 pts
19 vitalimarrenra 406 pts
20 b0n0n 398 pts

Classement complet

Shoutbox

20 Sep - 10:46 am

Bonjour à tous, j'ai créé un nouveau topic sur le forum concernant un problème que je rencontre sur plusieurs challenges, comme il n'est plus très actif, que j'aimerais pouvoir avancer sur ces challenges et que ce chat a une meilleure visibilité, je poste ce message ici en espérant qu'une âme charitable puisse m'aider en répondant à mon message sur le forum :)

3 Sep - 9:39 am

Ah ok je n'avais pas bien compris ton message original. Très bien, ce que tu peux faire c'est poster un message sur le forum avec le lien de téléchargement et les explications. Merci pour ta contribution !

1 Sep - 5:52 pm

Bonjour bonjour, je l'ai créé en Pharo, une implémentation récente du langage smalltalk.

31 Aug - 2:43 pm

Bonjour PharoGuy, re-bienvenue à toi ! Tu as créé cet objet en quel langage ?

30 Aug - 8:23 pm

Bonjour tout le monde ! je redécouvre ce site avec Pharo ! J'ai créé un objet qui gère la récupération et l'envoi des variables, ça pourrait intéresser ?

24 Jul - 5:30 pm

Ça devrait être à nouveau opérationnel, définitivement cette fois ci.

19 Jul - 8:42 pm

A nouveau ? On regarde ça !

16 Jul - 5:26 pm

Bonjour à tous :) Je viens d'essayer de valider le challenge "Wav ? (6)", et j'ai l'impression que la page "validation.php" est de nouveau en carafe.

15 Jul - 8:43 pm

Cool !! Merci beaucoup !!

9 Jul - 11:20 pm

Hello, je regarde ça dès que je peux, probablement demain

Connexion
Mot de passe oublié

Supportez nousx

Vous aimez µContest ?
Supportez nous en votant (fun et difficulté) pour µContest sur WeChall :)
Si vous ne l'avez pas encore fait, profitez-en pour lier votre compte
Wechall à µContest pour pouvoir voter !

Merci

Contents

µContest, what is it ? How to participate ? How to solve the challenges proposed ? What language ? You will find all the answers to theses questions in this page. Concerning more specific questions, you can ask them on the forum.

General

How to solve a challenge

The µContest libraries

Example of a challenge resolution I

Example of a challenge resolution II

Technical documentations

Library Java documentation

General information

Current version : 2.0

The library contains functions that enable you

  • to check if the lib is up to date
  • to get the variable values of a challenge
  • to send back the answer(s) you found to the website
  • print formatted results
You just have to import the lib by doing :
import com.microcontest.Libmicrocontest2;
import com.microcontest.Contest;

Available functions

Here is a list of the functions you can use :

Function Prototype Description
- Libmicrocontest2.checkVersion - boolean checkVersion() Checks if the lib is up to date
- Contest.commenceContest - Contest commenceContest(int id_contest, String username, String password)
- Contest commenceContest(int id_contest)
Gets the variables from the website
- Contest.getParam
- Contest.getBytes
- Contest.getInt
- Contest.getDouble
- String getParam(String variable_name)
- byte[] getBytes(String variable_name)
- int getInt(String variable_name)
- Double getDouble(String variable_name)
Give you the variables downloaded by Contest.commenceContest
- Contest.appendAnswer - void appendAnswer(String variable_name, int variable_value)
- void appendAnswer(String variable_name, double variable_value)
- void appendAnswer(String variable_name, String variable_value)
Add answers to the final solution
- Contest.submitAnswer - String submitAnswer() Sends the final solution to the website

Available variable

You can use this variable in your code :

Variable name Value
Libmicrocontest2.Version The version of the lib you are currently using.

Libmicrocontest2.checkVersion

Prototype / Description

boolean checkVersion()

Enables you to check if the lib version if up to date.

Parameters

N/A

Return value

true if the lib is up to date, false otherwise.

Example

if(Libmicrocontest2.checkVersion() == false)
{
	System.out.println("Warning: the version of the libmicrocontest2 is not the last one.");
	System.out.println("Current version :\t" + Libmicrocontest2.VERSION);
	System.out.println("This program may not work properly. Consider downloading the latest version on this page : http://www.microcontest.com/download.php\n");
}

Contest.commenceContest

Prototype / Description

  • Contest commenceContest(int id_contest, String username, String password)
  • Contest commenceContest(int id_contest)
Downloads new variable values from the website and store it. You need to use getxxxx to get them. The second form will use the information you put in credentials.properties in the same directory :
username = harry
password = potter

Parameters

  • [in] int id_contest : The ID of the contest you want to solve, written on every contest page.
  • [in] String username : (Optional if you use a file credentials.properties) Your username.
  • [in] String password : (Optional if you use a file credentials.properties) Your password.

Return value

A Contest object you have to use to retreive the variable values.

Example

Contest cont = Contest.commenceContest(1, "Your nickname", "Your password");
// Contest cont = Contest.commenceContest(1); if you use credentials
 
int a = cont.getInt("a");
int b = cont.getInt("b");
// you can also use getDouble (for floating point values) and getParam (for strings)

Contest.getParam

Prototype / Description

String getParam(String variable_name)

Once you called Contest.commenceContest, you can retrieve the string variables values with this function.

Parameters

[in] String variable_name : The identificator string of the variable you want to retrieve written on every contest page.

Return value

The string value of the variable.

Example

Contest cont = Contest.commenceContest(4, "Your nickname", "Your password");
// Contest cont = Contest.commenceContest(4); if you use credentials
 
int key = cont.getInt("key");
String txt_crypted = cont.getParam("txt_crypte");

Contest.getBytes

Prototype / Description

byte[] getBytes(String variable_name)

Once you called Contest.commenceContest, you can retrieve a byte array of the string with this function.

Parameters

[in] String variable_name : The identificator string of the variable you want to retrieve written on every contest page.

Return value

A new byte array storing the string bytes.

Example

Contest cont = Contest.commenceContest(6, "Your nickname", "Your password");
// Contest cont = Contest.commenceContest(4); if you use credentials
 
byte[] wav_Data = cont.getByte("wav");

Contest.getInt

Prototype / Description

int getInt(String variable_name)

Once you called commence_contest, you can retrieve the int variables values with this function.

Parameters

[in] String variable_name : The identificator string of the variable you want to retrieve written on every contest page.

Return value

The value of the variable.

Example

Contest cont = Contest.commenceContest(4, "Your nickname", "Your password");
// Contest cont = Contest.commenceContest(4); if you use credentials
 
int key = cont.getInt("key");
String txt_crypted = cont.getParam("txt_crypte");

Contest.getDouble

Prototype / Description

Double getDouble(String variable_name)

Once you called commence_contest, you can retrieve the double variables values with this function.

Parameters

[in] String variable_name : The identificator string of the variable you want to retrieve written on every contest page.

Return value

The value of the variable.

Example

Contest cont = Contest.commenceContest(4, "Your nickname", "Your password");
// Contest cont = Contest.commenceContest(2); if you use credentials
 
Double a = cont.getDouble("a");
Double b = cont.getDouble("b");
Double c = cont.getDouble("c");

Contest.appendAnswer

Prototype / Description

  • void appendAnswer(String variable_name, int variable_value)
  • void appendAnswer(String variable_name, double variable_value)
  • void appendAnswer(String variable_name, String variable_value)
Once you solved the challenge, you need to add the answer(s) to the final solution. Then, you will call Contest.submitAnswer that will send all your answers to the website. You should use this function to add variables to the solution. Use the version you need depending on the type of the variable you want to append.

Parameters

  • [in] String variable_name : The identificator string of the variable you want to retrieve written on every contest page.
  •    [in] int variable_value : The value of your int variable you want to append.
  • OR [in] double variable_value : The value of your double variable you want to append.
  • OR [in] String variable_value : The string you want to append.

Return value

N/A

Example

Contest cont = Contest.commenceContest(1, "Your nickname", "Your password");
// Contest cont = Contest.commenceContest(1); if you use credentials

int a = cont.getInt("a");
int b = cont.getInt("b");
// you can also use getDouble (for floating point values) and getParam (for strings)

// append the answer
cont.appendAnswer("s", a + b);

// then submit the answer and print result
System.out.println(cont.submitAnswer());

Contest.submitAnswer

Prototype / Description

String submitAnswer()

Once you solved the challenge and added all the answer variables to the solution, you need to call this function in order to send the solution to the website.

Parameters

N/A

Return value

A string informing you about the result.

Example

Contest cont = Contest.commenceContest(1, "Your nickname", "Your password");
// Contest cont = Contest.commenceContest(1); if you use credentials

int a = cont.getInt("a");
int b = cont.getInt("b");
// you can also use getDouble (for floating point values) and getParam (for strings)

// append the answer
cont.appendAnswer("s", a + b);

// then submit the answer and print result
System.out.println(cont.submitAnswer());