when i type the correct code into the practice, the code to decrease the damage does not have any effect at all. this causes the success condition to be unmet as the damage value ends up being wrong when the conditions require the damage value to be correct. this is what happens in the GIF. it is only when i reveal the solution and click on the use solution button that the code actually works even though the code is the exact same as shown in the screenshot
To Reproduce
Steps to reproduce the bug:
- type the code i used manually. the code i used is as follows:
var level = 3
var health = 100
var max_health = 100
func take_damage(amount):
if health > 2:
amount *= 0.5
health -= amount
if health < 0:
health = 0
- click run
- observe how the health still decreases by the normal amount even when the amount value is multiplied by 0.5
- click on the solution button
- click on the use solution button
- click run
- observe how the code now runs properly even though its literally the exact same code that refused to work before

here is a GIF displaying how the code refuses to work.

here is a screenshot showing the code that i typed in alongside the solution code. notice that both are the exact same thing.
- Operating System: windows 10
- Browser: Firefox
when i type the correct code into the practice, the code to decrease the damage does not have any effect at all. this causes the success condition to be unmet as the damage value ends up being wrong when the conditions require the damage value to be correct. this is what happens in the GIF. it is only when i reveal the solution and click on the use solution button that the code actually works even though the code is the exact same as shown in the screenshot
To Reproduce
Steps to reproduce the bug: