View Single Post
Old 12-26-2008, 08:54 PM   #2 (permalink)
Eriond
Crumbly, but Good
 
Eriond's Avatar
 
Join Date: May 2006
Location: Montreal
Posts: 1,645
Reputation: 67
Send a message via MSN to Eriond
Default

I'm not really familiar with JavaScript, but uh... it seems to me you're using a string where you should be using an int.

pal1.charAt is going to return a character. Adding the character value (If the character is '9', the character value is 57) to the other character values will give you some random number. (I don't know why you'd want to have this line in your program)

Anyway, if pal2 is a string, and you're trying to make it equal to an integer, it's not going to work (at least in JavaScript, I think. There might be some weird toString stuff going on, but, I dunno.).

It's like saying

String1 = 45

I don't think it'll work. Try wrapping it in String( ). i.e. pal2=String(pal1.charAt(5)+pal1.charAt(4)+pal1.cha rAt(3)+ pal1.charAt(2)+pal1.charAt(1)+pal1.charAt(0))
__________________
Outsider
3D Space Action Shooter/RPG in Development
http://www.youtube.com/user/outsidergame
Eriond is offline