answerFalse::Int->IO()
answerFalse hp=do
hp--
if hp<=0 then
putStrLn"================Game Over================"
else
print(hp)
i already declare hp as int with value 3 now my problem is when i put "hp--", it shows error
Couldn't match expected type `IO a0' with actual type `Int'
but if i put "--hp", the result print is 3 not 2.
i also tried let hp=hp-1, the system stuck there.