Posted: Thu Feb 01, 2007 8:05 pm Post subject: need help with procdures
Quote:
var card : array 1 .. 52 of int
var cardcheck : array 1 .. 52 of boolean
var cardnum : array 1 .. 52 of int
var num : int
var counter : int := 1
var guess : string
for i : 1 .. 52
card (i):= Pic.FileNew ("cards/" + intstr (i) + ".jpg")
cardcheck (i) := true
end for
procedure Guess
locate (1,1) put "Higher or lower?"
get guess
end Guess
procedure Compare
if cardnum (counter) > cardnum (counter-1) and guess = "lower" then
put "You are right."
elsif cardnum (counter) < cardnum (counter-1) and guess = "higher" then
put "You are right."
else
put "Your are wrong."
end if
end Compare
Dealing
Guess
Dealing
Compare
during my compare procedure i dont get any value on any variable so it doesnt run correctly, andyone can give me any advice on how to fix it?
Sponsor Sponsor
CodeMonkey2000
Posted: Thu Feb 01, 2007 8:39 pm Post subject: Re: need help with procdures
My guess is that cardnum (counter) never gets assigned a value.
someguy123
Posted: Thu Feb 01, 2007 8:42 pm Post subject: Re: need help with procdures
any idea how to fix that?
CodeMonkey2000
Posted: Thu Feb 01, 2007 9:20 pm Post subject: RE:need help with procdures
try cardnum (counter-1) > cardnum (counter-2)
someguy123
Posted: Thu Feb 01, 2007 9:49 pm Post subject: Re: RE:need help with procdures
spearmonkey2000 @ Thu Feb 01, 2007 9:20 pm wrote:
try cardnum (counter-1) > cardnum (counter-2)
how would that make a difference..
runhardndie
Posted: Tue Feb 06, 2007 4:42 pm Post subject: Re: need help with procdures
Just choose 2 different numbers in your deal procedure. I reordered your program for you to look at..(see attached)