Skip to content

Examples

Muhammad-Salman-Sheikh edited this page May 8, 2018 · 2 revisions

Examples :

doing the primality test :

'p'        (prime : 197 input via stdinput)        ---> true
'p197'     (prime : 197 input given in prog)       ---> true

doing collatz conjecture :

'C'        (Collatz : 310 input via stdinput)      ---> 86
'C310'     (Collatz : 310 input given in prog)     ---> 86

doing leap year test :

'L'        (Leap : 400 input via stdinput)         ---> true
'L400'     (leap : 400 input given in prog)        ---> true

doing basic mathematics :

'+'        (add : 2,3 via input separated via ,)   ---> 5
'-'        (sub : 2,10 via stdinput separated ,)   ---> -8
'*'        (mul : 10,2 via stdinput separated ,)   ---> 20
'/'        (div : 20,4 via stdinput separated ,)   ---> 5
'%'        (mod : 20,4 via stdinput separated ,)   ---> 0

Hello , World! :

' '        (space : builtin for hello world)       ---> Hello, World!

FizzBuzz :

''         (empty program)                         ---> Fizz Buzz program (separated by newlines)

Clone this wiki locally