Results 1 to 5 of 5
Thread: Comparisions for while loop
- 08-31-2010, 11:35 AM #1
Member
- Join Date
- Jul 2010
- Posts
- 43
- Rep Power
- 0
- 08-31-2010, 11:42 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
Try replacing each of those comparison "phrases" with the corresponding symbols and see what you come up with.
- 08-31-2010, 11:47 AM #3
Member
- Join Date
- Jul 2010
- Posts
- 43
- Rep Power
- 0
I've tried but if you do a direct "translation" into java language you get:
which donen't work. The best I can come up with is:Java Code:verticalVelocity == 0 && angle.getValue() != 0 || 90
but this isn't the same as my origonal statement in the my first post.Java Code:verticalVelocity == 0 && angle.getValue() != 0 || verticalVelocity == 0 && angle.getValue() != 90
- 08-31-2010, 11:52 AM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
Starting point is your first attempt. Put parens around the rest of the statement after the && and add make the part after the || "complete" (i.e. add the condition you are comparing "90" to).
The second example would also work (but is "wordy") if you put parens around the two "halfs" of the statements (i.e. on each side of the ||).
The thing you are not thinking of is the "grouping". You acheive that through selective use of parens.Last edited by masijade; 08-31-2010 at 11:54 AM.
- 08-31-2010, 11:58 AM #5
Member
- Join Date
- Jul 2010
- Posts
- 43
- Rep Power
- 0
Similar Threads
-
How can I rewrite the following while loop using a for loop?
By gt11990 in forum New To JavaReplies: 5Last Post: 04-30-2010, 05:05 PM -
Do While Loop
By s4rd59 in forum New To JavaReplies: 2Last Post: 02-14-2010, 03:29 PM -
while-loop stopping on first loop
By davester in forum New To JavaReplies: 6Last Post: 06-26-2009, 08:46 PM -
While loop
By verbazon in forum New To JavaReplies: 5Last Post: 02-25-2009, 01:29 AM -
while loop
By michcio in forum New To JavaReplies: 5Last Post: 01-27-2008, 12:56 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks