This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-05-17 00:06:58

osbock
Scratcher
Registered: 2007-05-16
Posts: 14

Suggestion/philosophy question: Comparison operators

Why no <= <= != operators? I understand the need for simplicity, but the code gets rather verbose, and I have to scratch (hehe) my head sometimes to figure out that I need to say
if (not (x=0))
or
if (not (x<150))
as a replacement for
if (x>=150)

I hope I'm not being critical, because what you have created is wonderful.

Offline

 

#2 2007-05-17 00:13:29

jasonholm
Scratcher
Registered: 2007-05-16
Posts: 5

Re: Suggestion/philosophy question: Comparison operators

why not use
if x=150 or x>150

you can put the "not" statement inside the "or" statement, too. Should still be only one line.

Offline

 

#3 2007-05-17 08:29:15

osbock
Scratcher
Registered: 2007-05-16
Posts: 14

Re: Suggestion/philosophy question: Comparison operators

I know, it just seems inelegant to me, and harder to explain to my children (though, not inverting, but using or as you suggest is more easily understood)

Offline

 

Board footer