Tuesday, 15 November 2011

cards dont lie

has had trouble updating recently so brief updates
removed some buttons and replaced with subroutines (finish turn and claim cards) to make program more streamlined
added 52 buttons for all possible decks
made bubble sort mechanisms to make values look nicer, may add selection sort later for diversity
remade number to card translation subroutine called translate, gives a textual value to numbers in deck and also to last card in table pile
added ability for computer to shout cheat by randomly selecting a number, if 1 is chosen then cheat will be shouted by a random player or more and  depending on if a boolean value (cheattruefalse) is true or not the pile is moved into the p1 array or the accusers array deck
added subroutines to disable all 52 cmddeck buttons on command and also check if they are disabled, also added subroutine to make buttons enabled from 1 to number of cards player has left if there are no cards in pile or they decide to cheat
added subroutines to make players 2-4 play in order by searching to see if they can place a card of matching value, and if not select random cards from pile to cheat with
added code to ask the player if they want to cheat, cheattruefalse depends on this value. if player has no options and has to cheat because they're cards do not match then cheattruefalse is automatically true
added translation subroutines for each of the cpu players
made auto updating timer subroutine which updates on screen details every 5th of a second, may be removed later to reduce processor usage
added subroutine to let p1 play after turns of p2-p4 and detect whether any card can be played due to no cards in pile or if a matching value of card can be used or if only option is to cheat
added system of random numbers and if statements to determine if cpu will call cheat on itself, asks player beforehand if they think the cpu cheated, if they select yes and the cpu is not fast enough (number selected =/= resulting in cpu calling cheat) they will either claim or give the pile from/to the cpu player depending on if they cheated or not. cpu can still beat the player and call cheat first if the random number reflects this outcome, selecting "no" will result in nothing being called or a cpu player randomly calling cheat

No comments:

Post a Comment