Computer Science Canada Help me on my card game plox <3 |
Author: | Otaku1211 [ Sat Jan 21, 2012 3:30 pm ] | ||
Post subject: | Help me on my card game plox <3 | ||
What is it you are trying to achieve? Trying to finish this card game by sunday night :/ i'm not very good at turing and only in grade 10, this game is called 66 and for those who dont know what it is basically you just need to get 66 points before the other player. You play with 20 cards (aces, kings, queens, jacks, 10s). Ace=11points, 10=10points, King=4,queen=3,jack=2. so you play a card and the player 2 plays one whoever has the higher card gets both cards and the points. Ace>10>King>Queen>Jack is the order of the card then the suit order is the same; spade>hearts>clubs>diamonds. What is the problem you are having? I dont know how to get the gameplay part Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1.1a |
Author: | Alex C. [ Sat Jan 21, 2012 3:37 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
oh hi, it's a double post ![]() um why didn't you post on your old one, it would pop in the same place... anyways, try randint for the opponents cards (randint: 1 ..total cards in hand) and once you get the players card... if opponent card > player card opponent points+= opponent card + player card vice versa for player if opponent card= player card if opponent suite> player suite... yeah you should get it now ![]() |
Author: | Otaku1211 [ Sat Jan 21, 2012 3:57 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
:c i didnt know i could repost on that one :/ lol im still very new to this so sorryy!! D: and thank you soo much!! it really helped me ![]() |
Author: | Alex C. [ Sat Jan 21, 2012 4:24 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
um don't put the procedure in aloop, it will glitch out... a programs format should be soemthing like this: 1) All your varaibles 2) Processes and stuff 3) your main program |
Author: | Otaku1211 [ Sat Jan 21, 2012 4:35 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
okay thanks man, really helping out ![]() so if i want to make player one hand do i use array? so like var hand1: array 1..6 of ... (and so) if i do use array, how do i put (these are the player on cards) put "Player One Cards" put PlayerOneCardOneCardNumber, " of ", PlayerOneCardOnePicture put PlayerOneCardTwoCardNumber, " of ", PlayerOneCardTwoPicture put PlayerOneCardThreeCardNumber, " of ", PlayerOneCardThreePicture put PlayerOneCardFourCardNumber, " of ", PlayerOneCardFourPicture put PlayerOneCardFiveCardNumber, " of ", PlayerOneCardFivePicture put PlayerOneCardSixCardNumber, " of ", PlayerOneCardSixPicture into it? or if i don't use arrays, what do i use? :c |
Author: | Alex C. [ Sat Jan 21, 2012 5:36 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
well 20 cards in total means that 10 cards per player right? well there would be an array of 20 for the deck (which you would declare card names and suites and such) and 10 per player. randint could decide the value for the players hands suppsedly (player1card:= jackhearts) hopefully this helps |
Author: | Otaku1211 [ Sat Jan 21, 2012 8:48 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
yeah i've got how to do it now thanks alex! ![]() so for the array when i do this: var cards : flexible array 1 .. 20 of string := init ("ace of hearts", "ace of spades", "ace of diamonds", "ace of clubs", "king of hearts", "king of spades", "king of diamonds", "king of clubs", "queen of hearts", "queen of spades", "queen of diamonds", "queen of clubs", "jack of hearts", "jack of spades", "jack of diamonds", "jack of clubs", "ten of hearts", "ten of spades", "ten of diamonds", "ten of clubs",) i get the array of cards and i then this: randint (random, 1, 20) to get a random number and i've coded it so it responds do the array, but after i get the number and which card it is, is there a way to take it out of the array? |
Author: | Alex C. [ Sat Jan 21, 2012 10:09 pm ] |
Post subject: | Re: Help me on my card game plox <3 |
...you could reset it to no value ( := 0 or another value ) and put something in your code that completely ignores that card if it has that card in a players hand i guesss... : ![]() ![]() |
Author: | Otaku1211 [ Sun Jan 22, 2012 5:55 pm ] |
Post subject: | Re: Help me on my card game plox <3 |
Ok so i did a little work but i'm kind of stuck again now when i play a card and then draw another card I need the draw card to replace the card used :/ please help me!! it's due tomorrow ): I attached my new code, please help me! |
Author: | Alex C. [ Sun Jan 22, 2012 6:45 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
nice so far ![]() first off, whats the locate (40,35) for? it sorta screws it up cause of the window size also oddly, when player 1 won around against 2p, he won no points (p1=13 and p2 card= 1) finally, idiot proof the program (if card= 7 put you don't have that card) |
Author: | Otaku1211 [ Sun Jan 22, 2012 7:11 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
well the (40,35) is where I put my name like by:_____ ______ and yeah i'm not done the point system yet I still need to find a way to replace the card the player uses with the card the player draws :/ and good idea for the idiot proof part ![]() |
Author: | Alex C. [ Sun Jan 22, 2012 7:48 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
... try a rand.int within a loop to check random cards until it chooses one that hasn't been played yet |
Author: | Otaku1211 [ Sun Jan 22, 2012 8:01 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
no i mean like i draw a card then when both players are done their turn, i cls then retype the new hand for both players with the card played last turn replaced with the new card which they drew but i can't get that into code :/ |
Author: | Alex C. [ Sun Jan 22, 2012 8:17 pm ] |
Post subject: | Re: Help me on my card game plox <3 |
![]() if cardused (blah)= true card (blah):= new card end for ...try something like that ![]() |
Author: | Otaku1211 [ Sun Jan 22, 2012 10:11 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
Woot I got it to work, but used a different way, but yours helped me think of the new way ![]() ![]() just got to fix up a few bugs and add a few more parts then i can go sleep! ![]() |
Author: | Alex C. [ Sun Jan 22, 2012 11:09 pm ] |
Post subject: | RE:Help me on my card game plox <3 |
no prob, just want to play it when it's done lol ![]() |