
-----------------------------------
mike12255
Wed Dec 17, 2008 10:36 am

Stand button not working propper
-----------------------------------
Im creating a black jack game for my ISU. I went to test the stand button that i just created and i some how manage to win every time. I narrowed down the problem to the amount of the computer players cards always being more then it really should be, below is my code, its not very well commented sorry, however any help is appriciated.


import GUI in "%oot/lib/GUI"

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Set the initial variables%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
type card :
    record
        suit : string                                                                    
        num : int
    end record
var hitbutton : int
var deck : array 2 .. 53 of card %This array holds the 'cards'
var playercard1 : int
var standbutton : int
var playercard : string
var housecard : string
var font4 : int := Font.New ("Arial:24:bold,italic")
var font5 : int := Font.New ("Arial:24:bold,italic")
var font6 : int := Font.New ("Arial:20:bold,italic")
var pc3 : string %players third card
var amount : int := 2 %store the amount of times user has hit the button
var bet : int
var cpuamount : int := 1
var gotbet : boolean
var winfont : int := Font.New ("Arial:20:bold,italic")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%fills the array with cards uses a global parameter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc createDeck
    for createcards : 2 .. 53
        if createcards  14 and createcards  27 and createcards 