Click to See Complete Forum and Search --> : I really need help with this. I have a bug somewhere in this code.


chrishj7
11-20-2003, 11:07 PM
Thanks!

Gollum
11-21-2003, 05:22 AM
Probably a bit late, but anyway...

There are a few things.

first is the if statement on line 17...

If (numCompDexterity > numUserDexterity) {

"if" must be spelt in lower case.

next, you have mixed up the names of a few variables...
In function GetUserValues(), you start with...
strUserStyle = Math.floor(Math.random() * 4) + 1;
and then later refer to numUserStyle. You need to call them the same thing.

similarly in GetCompValues() you have done the same thing (I detect a cut and paste operation here ;) )

finally,
line 21 you refer to numUserName, which should probably be strUserName should it not?

chrishj7
11-21-2003, 03:22 PM
Man thanks so much, you totally saved me. I can't believe the whole time the major problem holding me back was a capitalized I in "if". Thanks again, it's working great!