[cubescript]fizzbuzz = [ loop i 101 [
if (&& (= (mod $i 3) 0) (= (mod $i 5) 0)) [
echo "FizzBuzz" ] [
if (= (mod $i 3) 0) [
echo "Fizz" ] [
if (= (mod $i 5) 0) [
echo "Buzz" ] [
echo $i ]
]
]
]
][/cubescript]
Cubescript implementation of the Fizzbuzz test.
It's amazing the amount of cubescript I learnt in the 5 minutes of writing this :D
@Scripters: How can I add indentation and line breaks to my scripts? The above looks terrible.
Cubescript has silly rules :P
if (&& (= (mod $i 3) 0) (= (mod $i 5) 0)) [
echo "FizzBuzz" ] [
if (= (mod $i 3) 0) [
echo "Fizz" ] [
if (= (mod $i 5) 0) [
echo "Buzz" ] [
echo $i ]
]
]
]
][/cubescript]
Cubescript implementation of the Fizzbuzz test.
It's amazing the amount of cubescript I learnt in the 5 minutes of writing this :D
@Scripters: How can I add indentation and line breaks to my scripts? The above looks terrible.
Cubescript has silly rules :P