# Not equal more than two things

• C360
• Novice
• Joined: Jul 10, 2004
• Posts: 23
• Status: Offline

December 9th, 2004, 10:28 am

Can I have a equation equal more than one number? How do I do it!

Example:
Code: [ Select ]
if ( dir == "up" && _parent.myMap[upY][centerX] != 1) {
_y -= speed;
}
1.     if ( dir == "up" && _parent.myMap[upY][centerX] != 1) {
2.         _y -= speed;
3.     }

Can I have that equal not 1 and 2? I tried 1 && 2 and 1|2 and 1||2...can't figure it out. And I dont want two if statements. Appreicate it thanks.

*EDIT*

I just figured out:
Code: [ Select ]
if ( dir == "up" && _parent.myMap[upY][centerX] != 1 && dir == "up" && _parent.myMap[upY][centerX] != 2) {
_y -= speed;
1.     if ( dir == "up" && _parent.myMap[upY][centerX] != 1 && dir == "up" && _parent.myMap[upY][centerX] != 2) {
2.         _y -= speed;

But if there's a better way I'd appreciate you posting it thanks.
• Anonymous
• Bot
• Joined: 25 Feb 2008
• Posts: ?
• Loc: Ozzuland
• Status: Online

December 9th, 2004, 10:28 am

• Lord Sivell
• Novice
• Joined: Dec 08, 2003
• Posts: 32
• Loc: Australia
• Status: Offline

January 6th, 2005, 3:48 am

Hey,

You don't need the second dir == "up". It has already been tested.

## Post Information

• Total Posts in this topic: 2 posts
• Users browsing this forum: No registered users and 50 guests
• You cannot post new topics in this forum
• You cannot reply to topics in this forum
• You cannot edit your posts in this forum
• You cannot delete your posts in this forum
• You cannot post attachments in this forum

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.