All pastes #177450 Raw Edit

Stuff

public text v1 · immutable
#177450 ·published 2006-09-20 13:46 UTC
rendered paste body
[] – Standard block
[?] – If statement
[!] – Then statement
[!?] – Else If statement
[.,] – Do Loop statement
[=] – Equals
[<=] – If lesser than…
[>=] – If greater than…
[!=] – Everything except…
[&&] – And
[#] - While loop
[>] – Output to screen
[++] – Add 1 to value
[--] – Remove 1 to value
[-] – Minus
[+] – Plus
[*] – Times
[/] – Divided

So it works pretty much like every other programming language. For example, setting the array ’a’ to be 10, we simply take a standard block [] and put a in it:

[a]

Then, inside this block we put the equal block [=] followed by the value:

[a[=]10]

This tells the program that ’a’ is 10.

If we then have another array, called ’b’ wich has the value 0 and we want the program to add 1 value to b, until it equals a, we simply write this:

[a[=]10]  //Sets the array ’a’ to be 10
[b[=]0]  //Sets the array ’b’ to be 0
[.  //Loop begins
[?  //If statement begins
   [b[<=][a]]  //b is lesser than a
]  //If statement ends
[!  //Then statement begins
   [b[++]]  //Add one value to b
]  //Then statement ends
,]  //Loop ends, telling the program to jump back to the nearest ’[.’

The code above could also be written as a single line, like this:

[a[=]10] [b[=]0][.[?[b[<=][a]]][![b[++]]],]





Then lets say we have three arrays, ’a’, ’b’ and ’c’. We want to tell the program to check that if ’a’ AND ’b’ is everything except ’c’, it should output ’a’ plus ’b’.

[a[=]5]  //Sets the array ’a’ to be the value 5
[b[=]5]  //Sets the array ’b’ to be the value 5
[c[=]10]  //Sets the array ’c’ to be the value 10

[?  //If statement begins
   [a[&&[b]][!=][c]]  //If ’a’ AND ’b’ is everything except ’c’
]  //If statement ends
[!  //Then statement begins
   [>[a[+][b]]]  //Output ’a’ plus ’b’, wich would output 10, since 5+5=10
]  //Then statement ends


Simple mathematics

Lets say we want to calculate 10/3*5. Then we have to use a total of 3 arrays, and set the values ’10’, ’3’ and ’5’ to them. Then we simply use the operators divided [/], times [*] and print to screen [>]. The source would look like this:

[a[=]10]
[b[=]3]
[c[=]5]

[>[a[/[b[*[c]]]]]]

Or like this for a more overview:

[a
   [=]10
]
[b
   [=]3
]
[c
   [=]5
]

[>
   [a
      [/
         [b
            [*
               [c]
            ]
         ]
      ]
   ]
]

It would output 16,666666666666666666666666666667, since that is what 10/3*5 equals to.