Go to Post You never know when the GDC will slide in a rule about any robot with a laser must do a laser light show on the floor of the field or face a 50-point penalty :p. - EricH [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 30-11-2002, 17:34
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Re: Re: Thanks everyone!

Quote:
Originally posted by Steve Shade

So in your expression, this is what is really evaluated: ~(((p1_y>127) & p2_y) > 127)
Not quite. The PBASIC compiler is smart enough to do comparisons (>, =, etc) after regular stuff. Here's an example straight from the BASIC Stamp Manual:
Code:
number1 con 99
number2 con 30

if number1=number2 * 4 - 21 then equal
debug "not equal"
stop

equal:
debug "equal"
stop
This will evaluate each side of the expression before comparing them with =, so it will print "equal" because (30*4-21) is 99.

Also, true is not necessarily 1. Like most processors, the basic stamp interprets 0 to mean false, and ANYTHING else to be true. Therefore, always make sure to use the logic operators (AND, NOT, OR, XOR) instead of the bitwise equivalents (&, ~, |, ^).
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'll delete this in a couple of hours. hixofthehood Chit-Chat 9 04-02-2003 23:26
couple of questions... archiver 2001 5 23-06-2002 22:48
A couple of problems I observed at the MAR archiver 2000 3 23-06-2002 22:27
Couple other thank yous Jason Haaga Thanks and/or Congrats 0 29-04-2002 03:29
A Couple Questions about Chairman's Award ben_whly Chairman's Award 4 26-01-2002 18:24


All times are GMT -5. The time now is 04:25.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi