Weird BUG here.
On turn 8 my unit moved to 14 7 however I gave it the order to move to 12 7 as you can see in the game information. Coding Games and Programming Challenges to Code Better
The opponent build a recycler on 12 7 this turn so my unit should have stayed on 13 7.
What happened?
when thereās no path it goes to the ānearestā (closest) square it can
Thanks, in the technical details it is written:
If the target of a MOVE is unreachable, the robots will target the reachable tiles closest to the given destination, preferring the one closest to the center of the map.
So I guess it changed the target of my robot to 12 6. With this target the good move is indeed right.
āEfficiencyā is a huge topic. Yes, run-time speed would be faster using a persistent array that is updated each turn.
But thatās only useful if what you require is a static copy of the play board. You get more functionality by having a list of class objects. Example: sorting the list by distance to center of play board
Too many limitation and a single winning strategy make it boring
Limit time 50ms
Limit code size
Limit dimension
Limit number of submission
ā¦
So I decide to program in C++:
- The game engine
- Few AI players to start with
- An UI to see the the game (done in SFML)
- TODO next: a tcp/ip network interface to play against any one on the web
Posting the sources soon
Preview: C++ alanthier
Want to have your bot in the engine, just let me know in odysee comment section
I noticed the same issue : Fall Challenge 2022 - Bugs and questions - #41 by wala
In my opinion, itās a bug. It makes writing an exact simulation more complicated (for no reason) and almost impossible without looking at the referee. For example the centerās coordinates are double :
FallChallenge2022-KeepOffTheGrass/AStar.java at 76942694c0d80996e72711e904878bb0e972b6ea Ā· CodinGame/FallChallenge2022-KeepOffTheGrass Ā· GitHub
In the challenge IDE, next to the end of the challenge countdown, if you click on the name of the league the date of the next league opening will be displayed. Gold league should open this Friday.
you have the inRangeofRecycler property to help
Completly agree, IMO the move action should just be cancelled in that case to make the simulation easier and the moves more predictable.
Welp I had to implement priority queue in C++ from the java, because it handles ties differently
Say I move a bot to a square, it canāt go there so it tiebreaks by going to the closest square. If there are multiple closest it tiebreaks by choosing the square closest to the center. But how does it tiebreak in the case multiple squares are closest to the center and the goal?
Hereās an example. My robot 1
wants to go to R
but thereās a recyc there. The center is C
. Accordingly there are two squares closest to both C
and R
, how does it tiebreak?
...R
..C.
1...
Hereās an especially contrived example where C is both the target and center and N,S,E,W are the 4 tiebreak best options:
........
.#.####.
.#.#..N.
1#.#.WCE
.#....S.
.######.
........
It seems there is a bug.
If i tell my unit to move one tile away but the opponent places a recycler there I cannot move there.
This is normal.
But if I do the same, but give an additional MOVE command for the unit on that tile, it will try the first one, fail and then try to perform the second one.
I believe this to be a bug because the game calls it an error, but it doesnāt actually disqualify me.
Could I please get some clarification on this?
Any tips on how to debug a timeout? there are no debug logs on that turn which makes things hard
Hi, Iām having an issue with the time limit in Javascript. I end up systematically with a timeout, sometimes even during the first loops that checks every cell.
Any tips to gain time ?
Edit: it seems that it is the first readline()
that takes the major part of the 50ms after a few rounds.
I tried what you did: I had a command to move down into the grass and a second command to move up, and my bot moved left:
As stated above, when you send a bot to a square and it canāt get there, then it goes to the closest square (tiebreaks by choosing the square closest to the center). So thatās what I think happened, your first command was processed, it chose a closest square, and then your second command got a warning
I dont know if it got a warning for the 2nd command, because i was trying this out so i was sending 2 commands for each unit, but the thing is that if i send two commands for a unit, if the first command is reachable it processes that and gives me a warning for the second command, but if the first one isnt reachable, i would expect it to stand still and not process the second command, but it does and moves towards it which seems like a bug
Despite the fact that you can not reach each other the map is fair. Why do you feel it is not?
did you start your timer after reading the first input of a turn? time only starts for a turn after you get your first input
looks like you placed a recycler on turn 1 (and didnāt move that bot right), which then turned that patch into grass, so bam your opponent has basically already wonā¦
(kinda similar to how I was technically already lost in Coding Games and Programming Challenges to Code Better by move 1 though luckily my opponent played suboptimally too thereā¦)
but yeah everything is symmetrical at the start (āturn 0ā) so no advantage to either player
note that on turn 0 you are able to reach the opponent
iām rewriting and my code is consistently able to print out times over a secondā¦
EDIT: oops my fault I started the timer after firstInput instead of turnInput
firstInput
loop:
turnInput