i am making a nim game and have got it to work to some point by then i want to make the who gets to go first to select the stones random, that is either the player goes first or the computer goes first. Can anyone help me with a script which can do that
Offline
I think I know what you mean, but I'm not too sure I can describe it with the scratch scripts, so I'll do it in text.
Create a variable, name it whatever you want.
When green flag clicked
Set [variable name] to (pick random (1) to (2))
If
[variable name] = (1)
broadcast (computer goes first)
else
broadcast (player goes first)
Does that help?
Offline
MrScoop wrote:
I think I know what you mean, but I'm not too sure I can describe it with the scratch scripts, so I'll do it in text.
Create a variable, name it whatever you want.When green flag clicked Set [variable name] to (pick random (1) to (2)) If <[variable name] = (1)> broadcast (computer goes first) else broadcast (player goes first)Does that help?
Fixed it.
Last edited by turkey3 (2012-03-18 20:22:44)
Offline