0

why?

so I have been trying to been a simple game where you press a button until you get a "Game Over" (the game over is 1 in 6 chance of happening but the second button doesn't work and I can't find the reason. https://sololearn.com/compiler-playground/WWEZD9jSsAWZ/?ref=app

2nd Jan 2025, 4:06 PM
Pro Gamer 12 Nobody
Pro Gamer 12 Nobody - avatar
3 RĂ©ponses
0
compare line 8 and 10. in line 10, the () are missing.
2nd Jan 2025, 4:58 PM
Lisa
Lisa - avatar
0
It’s not a good idea to have your variables start with capital letters, although this isn’t why it isn’t working. Also in this code there is a one in seven chance of getting killed not six. You probably meant that the last index is indeed 6 but that is because you are starting from 0 so that means that there are seven possibilities. The reason why you probably meant to pick 6 is to replicate a six-shooter revolver.
2nd Jan 2025, 6:31 PM
Zvi
Zvi - avatar
0
Thanks
2nd Jan 2025, 9:12 PM
Pro Gamer 12 Nobody
Pro Gamer 12 Nobody - avatar