Connecting Tech Pros Worldwide Forums | Help | Site Map

Begginer Stuck!!

::::x::::
Guest
 
Posts: n/a
#1: Jul 20 '05
Anyone want to help me with this??
Even when all condition are met, it drops to the else and doesn't look at
the if and else if.
Ie. when bet_in = 1 and rullnum is between 0 and 5, it doesn't work..

if ( bet_in == 1 && rollnum >= 1 && rollnum <= 4 ) {
bank = bank + ( betbank * 2 )
win = betbank * 2
alert( "You won: $" + win )
alert( "1 Bank $" + bank ) //debugging
win = 0 }
else {
if ( bet_in == 2 && rollnum >= 5 && rollnum <= 8 ) {
bank = bank + ( betbank * 2 )
win = betbank * 2
alert( "You won: $" + win )
alert( "2 Bank $" + bank ) //debugging
win = 0
betbank = 0
pick_clickcount = 0
dep_clickcount = 0
roll_clickcount = 0 }
else {
if ( bet_in == 3 && rollnum >= 9 && rollnum <= 12 ) {
bank = bank + ( betbank * 2 )
win = betbank * 2
alert( "You won: $" + win )
alert( "3 Bank $" + bank ) //debugging
win = 0
betbank = 0
pick_clickcount = 0
dep_clickcount = 0
roll_clickcount = 0 }
else {
alert( "You lost: $" + betbank )
alert( "loose Bank $" + bank ) //debugging
betbank = 0
win = 0
pick_clickcount = 0
dep_clickcount = 0
roll_clickcount = 0
}
}
}

--
::::x::::

"Me fail English, that's unpossible"



Janwillem Borleffs
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Begginer Stuck!!



"::::x::::" <x@x.com> schreef in bericht news:3f57f4c9@dnews.tpgi.com.au...[color=blue]
> Anyone want to help me with this??
> Even when all condition are met, it drops to the else and doesn't look at
> the if and else if.
> Ie. when bet_in = 1 and rullnum is between 0 and 5, it doesn't work..
>[/color]

With pre-defined bet_in, rollnum, bank and betbank variables, it works fine.
This means that the logics are okay, but the values within the variables
aren't.

How are they retrieved?


JW



Closed Thread