In the skating game, if two or more players get stunned on the same cell, the game still checks for clashes when they get back up, so they start moving again with a risk of 2, instead of 0.
Is this expected ? I don’t think getting back up should count as a movement.
Suggestion: set a variable is_stunned when skipping movement, then when checking clashes, use this variable instead of risk[i] < 0
I confirm this presumably unintended behavior. Here’s also some quick code to reproduce it (it’s meant to play against two copies of itself):
import sys
import math
player_idx = int(input())
nb_games = int(input())
fall = False
while True:
for i in range(3):
score_info = input()
for i in range(nb_games):
inputs = input().split()
gpu = inputs[0]
reg = list(map(int, inputs[1:]))
if i == 2:
if reg[3] < 0:
fall = True
print(f"Risk #{player_idx}: {reg[3]}", file=sys.stderr)
if gpu != "GAME_OVER":
action_idx = player_idx if fall else 0
action = {"U": "UP", "L": "LEFT", "R": "RIGHT", "D": "DOWN"}[gpu[action_idx]]
else:
fall = False
action = "UP"
print(action)
You’ll notice that after the first orchestrated fall, the three players spring up with their risk set to 2.