#seeking help for a solution to my problem

18 messages · Page 1 of 1 (latest)

dusky steppe
#

I’m making a Rock Paper Scissors game and don’t know how to get the computer to randomly choose between rock paper or scissors

slender solarBOT
#

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.

dusky steppe
#

So like what function or line of code would get the computer to randomly choose between the three

rain brook
#

search "c++ how to generate random number"

dusky steppe
violet plaza
#

you need to generate a random number to do that

dusky steppe
#

How does that work

dusky steppe
rain brook
#

you generate a random number between 1 and 3

#

if it's one then it's rock, if it's two it's paper of it's 3 it's scissors

dusky steppe
#

Oh

#

I see

#

Well thank you!

#

@rain brook thx mate!

rain brook
#

sure!

dusky steppe
#

Have a good night

rain brook
#

take care

dusky steppe
#

!close