Computer Science Canada Need Button and return help please |
Author: | jacobjacobb [ Thu Jun 10, 2010 1:34 pm ] |
Post subject: | Need Button and return help please |
I'm having problems with my code. I'm trying to make a poker game. I'm fairly new to buttons and such so I set it up that when you check the computer randomly chooses to fold,check or raise. The problem is getting the code to reset itself after the computer folds and how to reset the pot number when that hand is over. Please help. Also I would like to know how to permanently keep the pot number and the amount the persona and the computer has left. Please help. Heres the part of the code I'm having problems with. import GUI setscreen("graphics :300;125") var temp : int := 0 var blind := 1 var blind2 := 10 var blind3 := 5 var blind4 := 15 var money := 1000 var money2 := 1000 var auto := 4 var call : string put "Your little blind." put "Do you want to check(c), raise(r) or fold(f)? " .. procedure check locate(1,1) put "You have checked." money := money - blind2 money2 := money2 - blind2 temp := temp + blind2 + blind2 if auto = 1 or auto = 2 then put "The computer has checked." elsif auto = 3 then put "The computer has raised." temp := temp + blind2 money2 := money2 - blind2 elsif auto = 4 then put "The computer has folded." money := money + temp return end if end check var hello : int :=GUI.CreateButton(50,100,0,"Check",check) loop exit when GUI.ProcessEvent end loop |