Snake Game
CodeChefOpen on judge ↗
After tying endless rounds of mathematical problems, Alan and Christopher decide to play a basic snake game as a tiebreaker and relax for a moment. The snake doesn’t grow and there are no walls. Only one collectable is present at a time. The next collectable spawns after the snake has collected the current collectable. The snake can move either up, down, left or right in one step. The snake'
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start