Flames Extinguisher
Approved by qimingzhenfeijin TheCheezLord 20Ll37
1 CodinGamers have started the puzzle
A higher resolution is required to access the IDE
- 1
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
Your objective is to extinguish all flames while preserving as many hit points (HP) as possible.
Your final score is the number of HP remaining upon victory.
This game is a port of the tactical fight against Bolgrot from the "Fire Extinction" quest in Dofus, developed by Ankama Games.
Rules
Map
Resources
Turns and cycles
Glyphs spawning
Available actions
-
MOVE dir : Moves the character 1 cell in the given direction. The destination can't be a wall. Cost:1 AP and1 HP. Valid directions:N ,S ,E ,W . -
JUMP dir : Moves the character 2 cells in the given direction. The destination can't be a wall, but the intermediate cell can be. Cost:2 AP and1 HP. Maximum2 jumps per cycle. Valid directions:N ,S ,E ,W . -
IMMO dir : Stays in place and targets the non-wall diagonally adjacent cell in the given direction, toward which all flames are attracted. Cost:1 AP and5 HP. Valid directions:NE ,NW ,SE ,SW . -
PASS : Ends the cycle. Restores AP to10 and resets the jump counter to0 . The end of a cycle converts glyphs into flames, provided its cell is not occupied by the character or another flame. Whether or not a glyph is converted, the glyph disappears.
You may send any number of
Effects of a movement (
MOVE
or
JUMP
)
- The character moves to the destination cell and loses
1 HP. - If the destination cell contains a flame, it is extinguished and the
HP cost is refunded. Note: the HP loss is applied
first, so a character with only
1 HP will die before the refund occurs. - After a flame is extinguished, each flame adjacent to the destination (8-neighbours) is pushed one cell away from the character, keeping the same relative direction. A flame is blocked (and cannot be pushed) if its destination cell is a wall, or already occupied by another flame. For a diagonal push, the two orthogonal cells along the trajectory must also be free (not a wall and not occupied). If any flame is blocked, the character dies instantly.
- All flames on the arena are attracted one cell toward the destination cell, processed in order of increasing Manhattan distance to the destination (ties broken clockwise from North). Each flame moves in the direction that most closely aligns with the vector from the flame to the destination: if the flame is on the same row or column, it moves cardinally; if it is exactly diagonal, it moves diagonally; otherwise it moves cardinally along the dominant axis (the axis with the greatest Manhattan distance). If the target cell is a wall or already occupied by another flame, the flame stays in place. For a diagonal move, the two orthogonal cells along the trajectory must also be free (not a wall and not occupied), otherwise the flame stays in place. If a flame would be attracted onto the character's cell, the character dies instantly.
Cardinal push:
Diagonal push:
Cardinal attraction:
Diagonal attraction:
Effects of
IMMO
- The character loses
5 HP. - All flames are attracted one cell toward the targeted cell, using the same attraction rules as for movement (same ordering, same blocking conditions). Unlike movement, the character's cell behaves like a wall for flames, so no flame can move onto the character's position, and this does not cause instant death.
Additional info
- Click the gear icon in the viewer to access display options
Game protocol
Line 1: 2 space-separated integers height (always
Next height lines: a string of length
width representing the
map (
Line 1: 2 space-separated integers charX charY: current position of the character.
Line 2: 3 space-separated integers hp ap jumpsLeft: remaining HP, remaining AP, jumps left this cycle.
Line 3: 1 integer flameCount: number of flames.
Next flameCount lines: 2 space-separated integers x y: position of each flame.
Next line: 1 integer glyphCount: number of glyphs this turn.
Next glyphCount lines: 2 space-separated integers x y: position of each glyph.
Next line: 1 integer validActionCount: number of valid actions this turn.
Next validActionCount lines: a string
validAction: each valid action among
-
MOVE dir with dir ∈ {N ,S ,E ,W } -
JUMP dir with dir ∈ {N ,S ,E ,W } -
IMMO dir with dir ∈ {NE ,NW ,SE ,SW } -
PASS
0 ≤ charY, flameY, glyphY < height
1 ≤ hp ≤
0 ≤ ap ≤
0 ≤ jumpsLeft ≤
0 ≤ flameCount ≤
0 ≤ glyphCount ≤
Response time per turn <
A higher resolution is required to access the IDE