When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
11 messages ยท Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
i declare the arrays at line 10 and then attempt to print it out at line 87
you're using gotos to implement loops.You should just use loops lol
my school has only introduced up to arrays atm,, i'm a 1st yr game dev student and we're a bit limited on what commands to use as well qwq
the gotos r for when a new player comes and also for when their guess is incorrect
the whole program is a guessing game basically,, the guessing game is done but the part where the name + guesses gets printed out is where I struggle
what does a vector do ?
I would recommend against ever using the goto keyword, especially if you're new to programming since it will make you think of code as non-linearly executed. It's also rather annoying to read code that uses it.
As @obtuse jetty said you're declaring (fancy word for creating) a 1-dimensional array and then trying to access an element/index (fancy word for location/spot) as if it was a 2-dimensional array. For 1-dimensional arrays you should only have one [x]. If you're new to programming you should also avoid using vectors since you SHOULD know how arrays work before going into that ๐๐ป .
I'm gonna eat now, but can look at how I would solve the issue after.
I tried running your code after removing the [i] when you access the guesses array. It works then as we said. But you have a bug where you dont print the last guess when winning the game ๐
also, would recommend to remove the goto's and trying to control the flow using while, continue, and break.