A*Craft Puzzle discussion


#1

Feel free to send your feedback or ask for some help here!


#2

Nice to have it that fast after the contest, well done :slight_smile:
Also FYI looks like its leaderboard is missing in the optim category of the leaderboard dropdown.


#3

How to get my score given the referee and my player (to try models locally)? I cloned the repository but I don’t find how to simply get my score on each test cases without the graphical interface (on localhost:9999)? Got sample code (in java)?
Thanks. :wink:


#4

try replacing gameRunner.start() with gameRunner.simulate() in the Main. It won’t launch the interface and there will be a score in the return of the function in a map called “metadata”


#5

It worked!! Thank you _CG_jupoulton.
In the class com.codingame.gameengine.runner.dto.GameResult.Main I replaced the code
gameRunner.start(9999);
by
GameResult gameResult = gameRunner.simulate();
System.out.println( gameResult.metadata );

and I get {“Points”:“65”} in the console


#6

That’s what I did during the contest, allows you to run all tests at once: Github.
You can also run a test multiple times with an average score if you want.

I changed two other files as well, you may want to clone the whole repo.


#7

Yes eulerscheZahl it runs OK, but it needs to set the input in that json pattern. For example:
{
“title”: {
“1”: “Divisé”,
“2”: “Split”
},
“testIn”: “#R…l…D#\n#…r…#\n#…l…#\n#…r…#\n#dudududu#udududud#\n#…r…#\n#…l…#\n#…r…#\n#U…l…L#\n###################”,
“isTest”: “true”,
“isValidator”: “true”
}

Is there a way to run the simulation directly with what we get as game input? For example like
#########.#########
#########D#########
#########.#########
#########.#########
…R…R…
#########.#########
#########.#########
#########D#########
#########.#########
#########.#########
1
10 4 R

And get the result score…
Thanks.


#8

I don’t see the problem with the json format: the referee loads the json file and converts it to the format expected by your bot.
The only problem I can imagine is when you want to create your own testcases.


#9

@ eulerscheZahl It needs to convert from what I get as input to the JSON: arrows to lower case and robots to their position and orientation in upper case (no problems if I want to create my own test case knowing thoses rules)… This is just one more step! I’d like to use the referee as I play one CodinGame : I put the inputGame in my code given my player and I get the score… just simply, without to have to implement a kind of “middleware” between the CodinGame given code and what I have to submit.


#10

Is there an error with the Results - Details page, it says every Validator passes successfully (green), even if there is an error or timeout?


#11

That’s a feature added for the contest: imagine you fail one test in the rerun and suddenly rank below 1000 with a strong code. Passing everything ensures that you will only be sorted by score, not the the number of passed validators.


#12

Validators 17 (Cells) and 28 (The Best Way) are always invalid!!!

Tried my old solution from Oct. 18 and a dummy solution (code writes just newline)
and get only 93% instead of 100%.
All test cases work fine!
Any ideas?


#13

Thank you for reporting the issue. Should be working now.


#14

yep, thx!!!