Computer Science Canada Card Game "war" |
Author: | zero-impact [ Wed Apr 16, 2008 9:59 am ] | ||
Post subject: | Card Game "war" | ||
Hi i am making the card game war as a side project at school. So far i have the game shuffle the deck give half the deck to the user and half the deck to the computer. When you click on the "draw" button it draws a card for both players and finds out who won the hand. I need help giving the cards to the player that won the hand. I have a sinking feeling that i have been going about coding this the wrong way. I have only been programming for about a month and a half. Sorry if my commenting is bad i need to work on that. So here is my code
|
Author: | Sean [ Wed Apr 16, 2008 12:09 pm ] |
Post subject: | Re: Card Game "war" |
Well, for us to test it, you need to upload the pictures for us to use. Can't do anything to help you really if we can't see what is going on ourselves. Once you do, I'll gladly assist you. |
Author: | zero-impact [ Wed Apr 16, 2008 3:22 pm ] |
Post subject: | Re: Card Game "war" |
Woops sorry about that! I completely forgot ![]() Here is a zip |
Author: | zero-impact [ Fri Apr 18, 2008 6:41 am ] |
Post subject: | Re: Card Game "war" |
did you take a look at it sean? |
Author: | Sean [ Fri Apr 18, 2008 6:59 am ] |
Post subject: | Re: Card Game "war" |
Have had a slight look in business class. Had to close, since I was caught. However, tonight I will be taking a longer look at it for you. |
Author: | zero-impact [ Sat Apr 19, 2008 7:54 am ] |
Post subject: | Re: Card Game "war" |
Any luck? I have read a bit and i think i will have to use a flexible array. Would I be correct in assuming that? And could anybody give me a bit of guidance on how to implement that if need be? Thanks |
Author: | zero-impact [ Sat Apr 19, 2008 3:17 pm ] |
Post subject: | Re: Card Game "war" |
How can i have 139 views and no meaningful replys? |
Author: | syntax_error [ Sat Apr 19, 2008 3:50 pm ] |
Post subject: | RE:Card Game "war" |
double posting doesn't make it more attractive for one to help out; more so heres a thought. after you deal out the hand make sure you remove those cards from the array and have to cards transfered to the users hand array that way, the same cards are not in use, and after wards if you wish to expand you can have each users card collection to go against the other users hand? I do not know if that will fit or work with your code, for I have not looked, nonetheless, that is how it should be done, imo. |
Author: | zero-impact [ Sat Apr 19, 2008 4:16 pm ] |
Post subject: | Re: Card Game "war" |
Thanks but i understand what i need to do i just don't know exactly how to do it in turing. I know when the player wins I have to take both cards remove them from one deck and then add them to the other. The user and computer decks are both set to 26 so i don't know how I'm going to go about adding and removing cards? :S And well sorry about the double posting just I posted a few days ago and it is frustrating seeing my post go straight to the bottom while others with less meaningful posts are getting helped out. |
Author: | Nick [ Sat Apr 19, 2008 4:19 pm ] |
Post subject: | RE:Card Game "war" |
flexible arrays, the Turing Walkthrough |
Author: | zero-impact [ Sat Apr 19, 2008 5:07 pm ] |
Post subject: | Re: Card Game "war" |
Thanks but i already read through that a couple times but still don't understand how i could use it in this particular instance. Could you maybe explain it in words or a little pseudo code? If so it would be greatly appreciated. Thanks |
Author: | Nick [ Sat Apr 19, 2008 5:40 pm ] | ||
Post subject: | RE:Card Game "war" | ||
|
Author: | zero-impact [ Sat Apr 19, 2008 7:45 pm ] |
Post subject: | Re: Card Game "war" |
Wow that actually helps a lot. Thanks ille post back if i get it working. ![]() |
Author: | zero-impact [ Mon Apr 21, 2008 5:34 am ] |
Post subject: | Re: Card Game "war" |
Got that part working! Thanks nick! Just a few more little basic things and I will be done. |