Challenge (snail game)
Task
Congratulations, you've been hired as a developer for the indie game 'Snail Simulator.' Your goal is to design the snail's movement logic. Snails are not very fast, and each snail has its own stamina. You need to calculate the maximum distance the snail will travel if it spends 2%
of its stamina for every meter it covers. Use a while
loop to solve this problem and then display the result on the screen. Good luck!
___
) with the necessary
variables. 2. The snail must have
stamina
above zero for movement.
3. For every meter the snail passes, it loses
stamina_per_meter
stamina.4. When the snail has lost stamina, the distance covered should increase by 1 (increment).
5. Finally, output the
distance
the snail has traveled.
¿Todo estuvo claro?
Contenido del Curso
Introduction to TypeScript
Introduction to TypeScript
Challenge (snail game)
Task
Congratulations, you've been hired as a developer for the indie game 'Snail Simulator.' Your goal is to design the snail's movement logic. Snails are not very fast, and each snail has its own stamina. You need to calculate the maximum distance the snail will travel if it spends 2%
of its stamina for every meter it covers. Use a while
loop to solve this problem and then display the result on the screen. Good luck!
___
) with the necessary
variables. 2. The snail must have
stamina
above zero for movement.
3. For every meter the snail passes, it loses
stamina_per_meter
stamina.4. When the snail has lost stamina, the distance covered should increase by 1 (increment).
5. Finally, output the
distance
the snail has traveled.
¿Todo estuvo claro?