xiranda/test_x.x

50 lines
843 B
Plaintext
Raw Normal View History

2024-04-03 06:10:35 -04:00
type integer = 4;
type natural = 4;
2024-04-01 07:23:49 -04:00
2024-04-03 06:10:35 -04:00
type boolean (
false,
true)
2024-04-01 07:23:49 -04:00
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 (
2024-04-03 06:10:35 -04:00
standard_input,
standard_output)
2024-04-01 07:23:49 -04:00
2024-04-03 06:10:35 -04:00
string_length (string):
2024-04-01 07:23:49 -04:00
length: natural = 0;
loop (! string [length])
length++;
return (length);;
2024-04-03 06:10:35 -04:00
echo (text):
2024-04-01 07:23:49 -04:00
system (linux_write_system_call, standard_output, text, string_length (text));
return;;
2024-04-03 06:10:35 -04:00
heyo () echo ("Heyo!");
cyaa () echo ("Cyaa!");
global: integer = 666;
uberglobal = 666;
my_main ():
heyo ();
loop (x = 1 .. 17):
if ((x % 3 = 0) & (x % 5 = 0))
echo ("fizz+buzz");
else if (x % 3 = 0)
echo ("fizz");
else if (x % 5 = 0)
echo ("buzz");
else
echo ("<>");
echo ("\n");;
cyaa ();
return 60;;