Would you like to show Life: 0 in the VisuAlg console result?
I tried to put Ate (life = 0) but it gives infinite loop.
If someone can help me, I appreciate it.
The version of my VisuAlg is 2.0
algoritmo "RPG"
var
damage, life: Inteiro
inicio
life <- 100
EscrevaL("Vida: ", life)
Repita
EscrevaL(" >>> Dano causado: ", damage)
EscrevaL("Vida: ", life)
damage <- randi(life)
life <- life - damage
Ate(life = 1)
Se (life = 1) entao
EscrevaL("Inimigo abatido!")
FimSe
fimalgoritmo