I'm pretty sure this topic fits here. Very Happy

I'm working on tutorial for Grammer. I worked until chapter 4.

The link is right here: http://yeong.comli.com
or
http://yeong.57o9.org

Any criticism/suggestions? (But not on the web design please. Sad I just used a template. If my webpage looks bad, blame the template XD)
There is still the trouble with Chapter 4 since the logic expressions are actually not like TI-BASIC (they perform bitwise logic). Since I am pretty sure you know sprites, think of it exactly like that. Also, they use the full 16-bits of the instruction. In cases where you are using just Boolean logic, though it works fine Smile
With that, I want to look at this:
Quote:

So 3=5 and 7>3 will return 0, and 3=5 or 7>3 will return 1. Also, !3=5 will return 1.

The first one:
3=5 and 7>3
3=5 and 1
3=1
0
That is correct, but not based on the way you presented it.

3=5 or 7>3
3=5 or 1
3=5
0
And that one doesn't work :/

EDIT: Oops, I forgot to present how to fix that. The easiest way is to use the colon Very Happy


Code:

3=5: and 7>3
3=5: or 7>3

Since colons are allowed in If statements, these are really useful. They pretty much take the place of parentheses. In both cases they start with 3=5 which returns 0. That is then passed to the next section of the math:

0 and 7>3
0 and 1
0

0 or 7>3
0 or 1
1
Hmm, that's interesting. So Grammer doesn't use grouping parentheses for logical expressions at all?
Unfortunately, not :/ It reads them as just another math operation.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement