473,505 Members | 13,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Begginer Stuck!!

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"
Jul 20 '05 #1
1 1315

"::::x::::" <x@x.com> schreef in bericht news:3f******@dnews.tpgi.com.au...
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..


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

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1626
by: Player | last post by:
During my setup install of python, I came across an option stating... Compile python files to, .pyc I left it unchecked for now, should I of done otherwise?? As I am a begginer to this, I...
8
2934
by: MLH | last post by:
I use a mouse-down procedure to trap right mouse clicks and CTRL-Right mouse clicks. Running the procedure must put honey or some other sticky substance into my keyboard because subsequent...
4
8707
by: Astronomically Confused | last post by:
using System; using System.Collections; using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; class HttpProcessor { private Socket s;
2
243
by: thecamisland | last post by:
Hello, I'm a begginer. Is this going to work? Dim fm As FirstMenu Class TransHeadInfo Public Function Validate() As Boolean ... fm.Show() ...
4
3111
by: =?Utf-8?B?TWF1cg==?= | last post by:
My cd is stuck in the drive. I can open the drawer O K but the c d will not come out Help me please -- Maur
0
1842
by: =?Utf-8?B?QmlsbEI=?= | last post by:
This is a tough one... My Windows Service app periodically performs some processing on new entries to a SQL Server database table. It uses a simple System.Timer to call the Elapsed event...
13
1628
by: deshix | last post by:
Hi everyone, can you recommend me the best way to learn the PHP? I'm really begginer...
7
2845
by: alphasahoo | last post by:
Hi I am working on a program which writes the output a SQL select statements from number of source tables first to a load matrix and then writes to a load.dat file. But while writing to the...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.