xiranda/test.x

54 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-03-31 22:58:48 -04:00
--- Heyo
type boolean (false, true)
type character = -128 .. 127;
type integer = -2000000000 .. 2000000000;
type natural % 2000000000;
2024-04-01 07:23:49 -04:00
type structure (
a: integer = 0;
b: boolean = false;
c: natural = 0)
2024-03-31 22:58:48 -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 (
standard_input = 0,
standard_output = 1)
2024-04-01 07:23:49 -04:00
main () > integer:
x: integer = 1;
s: structure = (-1, true, 1);
2024-03-31 22:58:48 -04:00
loop (x++ < 101):
if ((x % 3 = 0) && (x % 5 = 0))
2024-04-01 07:23:49 -04:00
echo ("fizzbuzz");
2024-03-31 22:58:48 -04:00
else if (x % 3 = 0):
echo ("fizz\n");
2024-04-01 07:23:49 -04:00
echo ("and again fizz");;
2024-03-31 22:58:48 -04:00
else if (x % 5 = 0)
echo ("buzz\n");
else
2024-04-01 07:23:49 -04:00
echo ("fuck formatting...");
echo ("\n");;
2024-03-31 22:58:48 -04:00
return (0);;
2024-04-01 07:23:49 -04:00
heyo () echo ("Heyo!");
cyaa () echo ("Heyo!");
name () > characer [] return ("Ognjen");
string_length (character string []) > natural:
2024-03-31 22:58:48 -04:00
length: natural = 0;
2024-04-01 07:23:49 -04:00
loop (! string [length])
length++;
2024-03-31 22:58:48 -04:00
return (length);;
2024-04-01 07:23:49 -04:00
echo (character text []):
2024-03-31 22:58:48 -04:00
system (linux_write_system_call, standard_output, text, string_length (text));
return;;