Computer Science Canada Going back to the beginning of a deck |
Author: | implosion [ Wed Jun 10, 2009 4:52 pm ] | ||
Post subject: | Going back to the beginning of a deck | ||
What is it you are trying to achieve? when reaching end of array (The deck) going back to the beginning What is the problem you are having? keep getting an array out of bound error Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Answer Here>
Please specify what version of Turing you are using 4.1 i'm also attaching the zip folder of it all |
Author: | Tony [ Wed Jun 10, 2009 5:42 pm ] |
Post subject: | RE:Going back to the beginning of a deck |
well you know where you are trying to access the array (index) and how large the array is (upper). |
Author: | implosion [ Wed Jun 10, 2009 7:17 pm ] |
Post subject: | RE:Going back to the beginning of a deck |
i understand how i would do this if i wasn't making this game object oriented... its weird because i am passing my counter variable into my object but i don't know how to send an integer back from SHUFFLE into MAIN telling it to go to the start. i have a set deck size, but the hands of each player are flexible... oh and ever since i tried to put this method in of checking to see if a player has no cards it won't show the pictures of a card on the main screen to see if your hand is higher or lower... not sure why.. i know the delay is (1) but that was just to quickly go through the game |
Author: | implosion [ Sun Jun 14, 2009 8:25 pm ] |
Post subject: | Re: Going back to the beginning of a deck |
I've worked on my game some more... i keep going over all my bases to see if everything is right... i've read over everything and i can't find the problem... what the game is trying to do is you try and get all the cards... if you guess right i add the opponents card to your hand and then give the value of what the computer had to -1 and vise vera if you guess wrong. Attached is the updated folder. On the cheat it shows you the value of your card / oppenents card... for some reason i see -1... and if i'm right i should... any help would be appreciated... this is due tomorrow. (n) edit : in the 2 functions ignore the boolean variable . i forgot to get rid of it. |