Fewmitz
03-15-2007, 09:28 PM
Here's the thing, I have a Quarter Final to do (custom game, basically), and this class is REALLY basic, as in we haven't even gotten to arrays yet. So here's my question:
I chose Simon, as in Simon Says. I've looked at some sample code, and i've fiddled with arrays before, and I think I got the basics, but it's nothing concrete, which kinda puts me out of luck.
'Cause, what I was thinking of defining a variable as an array, and setting its length to a variable (the one that keeps track of score/round/turn #) and then setting everything to a random number 1-4 to have it choose which picture it "clicks".
Woo, wall of text, anyway, here are the things I'm not sure how to do:
~Set an array to a length predetermined to a variable, and have every element of the array equal the same thing
~Once that's done, record that the selected square takes up part of an element
~Set each of the user's clicks to an array's element
~When I calculate the random number, how to record that a selected square has been "clicked" so that it flashes and records it's value in the array
I feel dumb asking for help...but anything offered is appreciated.
I chose Simon, as in Simon Says. I've looked at some sample code, and i've fiddled with arrays before, and I think I got the basics, but it's nothing concrete, which kinda puts me out of luck.
'Cause, what I was thinking of defining a variable as an array, and setting its length to a variable (the one that keeps track of score/round/turn #) and then setting everything to a random number 1-4 to have it choose which picture it "clicks".
Woo, wall of text, anyway, here are the things I'm not sure how to do:
~Set an array to a length predetermined to a variable, and have every element of the array equal the same thing
~Once that's done, record that the selected square takes up part of an element
~Set each of the user's clicks to an array's element
~When I calculate the random number, how to record that a selected square has been "clicked" so that it flashes and records it's value in the array
I feel dumb asking for help...but anything offered is appreciated.