xiranda/test.x

58 lines
1.1 KiB
Plaintext

--- Heyo
type boolean (false, true)
type character = -128 .. 127;
type integer = -2000000000 .. 2000000000;
type natural % 2000000000;
type structure (
a: integer = 0;
b: boolean = false;
c: natural = 0)
type system_call (
linux_read_system_call = 0,
linux_write_system_call = 1,
linux_open_system_call = 2,
linux_close_system_call = 3,
linux_exit_system_call = 60)
type file_descriptor (
standard_input = 0,
standard_output = 1)
heyo () echo ("Heyo!");
cyaa () echo ("Heyo!");
string_length (character string []) > natural:
length: natural = 0;
loop (! string [length])
length++;
return (length);;
echo (character text []):
system (linux_write_system_call, standard_output, text, string_length (text));
return;;
--- entry point
my_main () > integer:
x: integer = 1;
s: structure = (-1, true, 1);
---
heyo ();
loop (x++ < 17):
if ((x % 3 = 0) && (x % 5 = 0))
echo ("fizzbuzz");
else if (x % 3 = 0):
echo ("fizz\n");
echo ("and again fizz");;
else if (x % 5 = 0)
echo ("buzz\n");
else
echo ("fuck formatting...");
echo ("\n");;
cyaa ();
return 0;;