Hello, I found that bug (or feature?) yesterday that prevent me from recharging the mine after placing one:
«Double mine not allowed» occurs when you try to place 2 mines on the same location. Which is not allowed
Oh youâre right, so that was where the bug came from. Thanks!
I encounter what seems to be a bug in a game versus DEFAULT AI (bronze ligue).
A link to the replay: https://www.codingame.com/replay/442104418
At each loop, I do the following code for retrieving inputs:
print("getting sonar", file=sys.stderr)
sonar_result = input()
print("sonar :", sonar_result, file=sys.stderr)
print("getting opponent orders", file=sys.stderr)
opponent_raw_orders = input()
print("opponent raw orders :", opponent_raw_orders, file=sys.stderr)
I get something like this for all frames, this is what is expected:
getting sonar
sonar : NA
getting opponent orders
opponent raw orders : MOVE E
Until for frame 37, for which I get this:
getting sonar
sonar : NA
getting opponent orders
And nothing else⊠I guess itâs stuck at the input()
call (the one for opponent orders).
Could you investigate?
Good job for the game btw, itâs really challenging and amusing
I assume, that you do get the input and fail somewhere later in your code. The last input just isnât shown in your logs. Please try to add the following line after parsing all the inputs: sys.stderr.flush()
.
If this doesnât do the trick, please share your full code with me. Donât do it here in public as itâs a contest. Drop me a private message instead.
First, thank you a lot for all you guys excellent contribution of OoC. I would like to know if it is possible to add explanation of Timeout in the overall instruction or even give more in/output information. Iâve stuck by this prompt for a while and cannot figure out what happened, though I knew itâs must had something about endless loop. In other words, only by the actions information, it sometimes would be hard for learners to debug. You know, sometimes it was obverse if we could get a little bit more information.
And again, I love what you guysâ done, and appreciateïŒ
We canât know anything from your code, other than it used too much time.
I would recommend printing information for yourself or even error printing the whole game state and run it offline, while debugging.
Thank you, you were right!
The problem is always between the keyboard and the chair. The true question is which keyboard and which chair
Hello ! First, bravo for this contest !
I loose a game and I donât understand :
Iâm on (0,5) with 3 lives.
I move to E so I should move to (1,5)
I throw a torpedo on (0,3) where is my opponent. It should not damage me !
My message is âMOVE E | TORPEDO 0 3 | TRIGGER 4 6 | TRIGGER 3 6â and I loose with score -1
(There are mines on these places)
Thank you for your help !
Please always add a replay link for that kind of bug report.
Iâm not sure if that message is supposed to make you lose instantly, but itâs incorrect for sure.
âBut you can use each type of action only once per turnâ
âYou canât trigger multiple mines in the same turn.â
Ok, didnât read all the green lines, sorry !!
I trigged only one mine and I win the game !
âThe problem is always between the keyboard and the chairâ is true !
Hello! A minor inconsistency in the rules (at least for Wood league).
âIf you fail to output a valid action, you will SURFACE in that turnâ
Later, under Lose conditions:
âIntersect your own path, move into an island or out of the mapâ
Itâs a minor point because itâs bad coding to output illegal actions, anyway, but if I move to an invalid location (this would fall under âfailing to output a valid actionâ) will I surface or will I lose immediately? A quick test reveals itâs of course the later, but this should be clear in the rules.
Iâm getting a timeout issue using Swift. I put a timer around the first readLine() and it is taking 40+ ms (with a 50ms game timeout). It jumps around, and I get through 6-8 turns before getting timed out.
Hello! A minor incontinence in the rules (at least for Wood league).
What is incontinence?
Incontinence is a term that describes any accidental or involuntary loss of urine from the bladder (urinary incontinence) or bowel motion, faeces or wind from the bowel (faecal or bowel incontinence).
Maybe you meant inconsistence⊠Please, do not piss in the Ocean (of Code)
We did an update of the game. The input scheme for MSG got a little stricter.
Double MSG and an empty MSG is no longer allowed. Sorry for the inconvenience
Hope the new tooltips (as voted), extra frames, life lost on correct frame and path marked on correct frames feels better
Maybe you meant inconsistence⊠Please, do not piss in the Ocean (of Code)
TouchĂ© . I really donât see how I couldâve missed that! I donât even have the excuse of auto-correct. While we are at it, itâs actually inconsistency. (fixed my previous post to reflect that). My initial point stands, though.
This post got longer than I anticipated, so it now needs a big huge
âthis is a great idea and implementation! Thanks to the creators!â
header.
Now, who am I to miss an opportunity to mess with native English readersâ minds?
Now that Iâve got the full statement, hereâs a list of incontinencies (or ambiguousnesses that would need statement clarifying because they can result in at least a local incontinency):
-
âBy using surface you will reset your path of visited cells so that you can freely move to a cell that you have previously visited.â
This is massively ambiguous as to how the current cell is treated. It appears from the viewer the current cell is still not visitable, but thatâs at odds with the phrasing: that cell is previously visited from a previous turn, so it would be reset and visitable again, and for most common interpretations of âvisitingâ staying in place is not a part of it. All the less that the sentence literally says previously visited cells can now be âmoved toâ. -
The entire statement is quite incontinent with regard to invalid actions.
It always mentions âYou canâtâ such and such, but never really says what happens if you still do. The most obvious example is movement looping, which happens to be explicitly incontinent: on one side âIf you fail to output a valid action, you will SURFACE in that turnâ, and on the other âIntersect your own pathâ is listed as a losing condition. The same could be said about:- firing torpedoes out of range
- firing torpedoes at an island (common sense says itâs pÄ„ysically possible, resulting in an explosion either on first land or last sea cell)
- triggering a non-existent or non-own mine
- placing a duplicate mine
And a few non-fatal infelicities:
-
âYou cannot move or fire through islands.â Triggering mines can easily be thought of as some form of firing. Better be specific: âfire torpedoesâ.
-
The torpedo paragraph could use a more specificative style. Something in the lines of: âtorpedo explosions damage submarines (yours or enemyâs indiscriminately), and have no effect on mines, islands or empty water.â
-
âMOVE direction POWERâ makes it read like we have to output the string âPOWERâ. Moreover, the strings to use as a power name arenât explicitly listed anywhere.
-
âEach player has 300 turns including the initial placement.â This is CG-API mumbo-jumbo. For all intents and purposes, the player has 299 turns. Also, this has nothing to do with a Victory Condition.
Iâm normally not that strict about statement details; but this contest happens to be all about interpretation of the opponentsâ decisions, and an incorrect interpretation has very drastic yet hard-to-pinpoint consequences. Itâs poor form to have to peek at the referee that much.
Possibly-breaking suggestions if/when this makes it to undeadlined multi:
-
âcooldownâ is poorly chosen given the player starts with it full. âcharges[Still]Neededâ or âpowerLevelâ (counting up) could be better.
-
Adding an input line where the referee echoes what he will tell the opponent were our orders would be extremely helpful in clearing out most of the incontinencies and infelicities detailed above.
Itâs particularly beginner-unfriendly to deny a user a move for unclear reasons, force-surface him as a result without notifying him, and then let him desperately choke to death while heâs out of sync with the real open space. -
You may want to factor the explosion properties to their own paragraph (and add a picture.)
-
an unwarranted left-handed coordinate system
(Iâve got a few other totally trivial spelling/grammar/style corrections as well, if thereâs any interest for that. Are PRs still in order?)
Getting timeout on first readLine >2500 ms
Loop also timeouts reading input >50 ms
see Standard Error stream for timings
Pull request!
Contains 4 patches:
- Formatting, style and language.
- Give the visibility section a more âdiffâ feeling
- My rewording epiphany: separate charge/energy/power
- Split out a Powers paragraph
To be applied using standard git
tooling: download the patchset as something descriptive such as JBM-patchset.mbox
and then:
$ git checkout -b jbm-patches master
Switched to a new branch 'jbm-patches'
$ git am JBM-patchset.mbox
Applying: Formatting, style and language.
Applying: Give the visibility section a more âdiffâ feeling
Applying: My rewording epiphany: separate charge/energy/power
Applying: Split out a Powers paragraph