The getGameStatus()
function attempts to return detailed game states like "Game time elapsed"
, but due to how the gameActive
flag is used, this message becomes unreachable.
The condition that returns "Game time elapsed"
depends on gameActive
still being true
. However, in the endGame()
function, gameActive
is set to false
, which causes getGameStatus()
to skip that branch entirely.
As a result, once the game is manually ended or time has expired and gameActive
is set to false
, the function always returns "Game is not active"
— even if the time actually ran out.
This makes the "Game time elapsed"
branch unreachable and misleading about the true reason the game ended
Users checking the game status may receive incorrect or incomplete feedback.
Manual review
Fixed code:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.