Computer Science Canada Slot Picture Help |
Author: | Scooter341 [ Tue Apr 19, 2005 9:03 pm ] | ||
Post subject: | Slot Picture Help | ||
The code I have right now for selecting the random numbers is:
I can't figure out how to incorporate pictures rather than numbers, say for instance that when finalNumber1 = 1 I want to display a picture of cherries. |
Author: | Bacchus [ Tue Apr 19, 2005 9:10 pm ] | ||
Post subject: | |||
try maing an array to store the picture you want in it
|
Author: | Scooter341 [ Thu Apr 21, 2005 8:45 am ] |
Post subject: | |
I'm sorry but I need you to give an example of how to incorporate that into what i have. |
Author: | TheEvilOne [ Thu Apr 21, 2005 9:19 am ] | ||||||||
Post subject: | |||||||||
What hes saying is this
This is an array, each number of the array holds a picture. Like so:
or ...
Then at the end of all your if statements, that check which number finalNumber will be you do this:
you can also use picMerge if youre using Pic.SetTransparentColor anything else? |
Author: | Scooter341 [ Thu Apr 21, 2005 10:25 am ] |
Post subject: | |
oh.....alright. thanks for clearing that up for me man. |
Author: | Martin [ Thu Apr 21, 2005 10:35 am ] | ||
Post subject: | |||
Read through this code block. First, you generate an integer from one to ten. Is it ever going to be less than 1? Of couse not, so why do you check? Now, the next comparison checks to see if it's greater than or equal to 4 or less than or equal to 5. Now, if it gets to that comparison, the number is obviously already greater than three, so therefor it HAS to be greater than or equal to 4. And so on. Get rid of the useless comparisons. |
Author: | Scooter341 [ Thu Apr 21, 2005 11:07 am ] | ||
Post subject: | |||
my code now looks like this:
but the Turing environment keeps crashing and coming up with an access violation error. |