Could you explain to me about that while loop?
You first defined it to be false but while you were running that while loop why did you use !defeated and how was that loop running even you defined it as false in the first place?
Hi Bibek,
Sure. The while loop runs as long as defeated is set to false - pay attention to the ! in the condition that checks if defeated is set to false, which is the case in the beginning.
As soon as one character has been defeated, we set the variable to true, and the fight stops. Makes sense?
Could you explain to me about that while loop?
You first defined it to be false but while you were running that while loop why did you use !defeated and how was that loop running even you defined it as false in the first place?
Hi Bibek,
Sure. The while loop runs as long as
defeated
is set tofalse
- pay attention to the!
in the condition that checks ifdefeated
is set tofalse
, which is the case in the beginning.As soon as one character has been defeated, we set the variable to
true
, and the fight stops. Makes sense?Hope this helps.
Take care,
Patrick
I got it. I thought !defeated will be changed to true after doing this since it was declared false for the first time
Anyway, your whole course is great. Do you have other courses related to .net and react
Thank you very much! :)
I'm currently working on a .NET 5 and a Blazor course. Would that be of interest to you?
Take care,
Patrick
Yeah I am really interested!! Are you gonna post about it pretty soon?
I try. ;)