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
3 odpowiedzi
0
compare line 8 and 10. in line 10, the () are missing.
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.
0
Thanks