473,569 Members | 2,683 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 1320

"::::x::::" <x@x.com> schreef in bericht news:3f******@d news.tpgi.com.a u...
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
1638
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 didn't no if it was a needed option to be checked or otherwise. I assume by compiling the python files to pyc they would run that little bit faster??
8
2940
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 RightMouseClicks run as if they were CTRL-RightMouseClicks I have to close the form and reopen it to clear this behavior. Then, after the first...
4
8716
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
3118
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
1844
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 handler (which contains the processing code) every minute. The processing itself usually takes no more than a few seconds. Even so, I have a boolean set...
13
1636
by: deshix | last post by:
Hi everyone, can you recommend me the best way to learn the PHP? I'm really begginer...
7
2856
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 load.dat file, the program gets stuck if I am putting float variables getting rounded to 8 or 9 decimal places. But runs fine if the float variable...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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 we have to send another system
0
937
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.