Cart #28912 | 2016-09-21 | Code ▽ | License: CC4-BY-NC-SA

Just starting out. So much to learn in PICO ! Just found out today that <> is not recognized, no, you must use ~= ... Screwy !

I'll be working on this cart quite a bit now and when done, hopefully it will be an effective notepad and maybe even give you some good ideas on coding and design. :)

P#28913 2016-09-20 20:16 ( Edited 2016-09-22 17:05)

FWIW, you can also use != ;)

P#28926 2016-09-21 02:13 ( Edited 2016-09-21 06:13)

I was reading that last night. That does make a bit more sense than ~=. Odd that I can't use <> . Even C++ uses <>, right ?

P#28938 2016-09-21 11:32 ( Edited 2016-09-21 15:32)

C++ uses !=
Pretty much only BASIC and Pascal use <>

I have no idea why Lua uses ~= but I'm guessing it stems from the fact that ~ in most languages is Bitwise NOT, so ... apply that logic looking for a symbol for not equals and come up with ~= , even though it's just a logical operator? I dunno.

P#29017 2016-09-22 02:40 ( Edited 2016-09-22 06:57)

It's strange that ~ is bitwise NOT in some languages when in written language it means "approximately", and in mathematics, it can have two different meanings - in set theory, it denotes equivalence relation, and in statistics it denotes distribution. In none of them does it ever mean "not".

P#29037 2016-09-22 12:40 ( Edited 2016-09-22 16:40)

In my game maker the tilde also represents near. This for instance:

 ```~20 ```

Means to return a random value from 15 to 25. A "near" value of 75% to 125% of the input.

 ```~~20 ```

Means to return a random value from 19 to 21. A "nearer" value of 95% to 105% of the input.

P#29044 2016-09-22 13:05 ( Edited 2016-09-22 17:05)