Removed examples...

This commit is contained in:
Ognjen Milan Robovic 2024-02-23 12:50:42 -05:00
parent 6e2d53a69b
commit ab42f181f7
5 changed files with 0 additions and 133 deletions

View File

@ -1,45 +0,0 @@
-- gnatmake -o example_ada example_ada.adb
with ada.text_io, ada.command_line;
use ada.text_io, ada.command_line;
procedure example_ada is
type colours is (RED, GREEN, YELLOW);
type structure is record
x : integer := -1;
y : natural := 1;
end record;
escape : constant character := character'val (27);
procedure put_colour (colour : colours) is
code : integer := colours'pos (colour) + 49;
begin
put (escape & "[0;3" & character'val (code) & "m");
end put_colour;
procedure put_cancel is
begin
put (escape & "[0m");
end put_cancel;
heyo : structure := (-103, 107);
begin
for colour in colours
loop
put_colour (colour);
put_line ("x = " & integer'image (heyo.x));
put_line ("y = " & natural'image (heyo.y));
heyo.x := heyo.x - 1;
heyo.y := heyo.y + 1;
put_cancel;
end loop;
end example_ada;

View File

@ -1,28 +0,0 @@
/* gcc -o example_c example_c.c */
#include <stdio.h>
static struct {
char * x;
int y;
int z;
} const data [3] = {
{ "-- 1", 2, 3 },
{ "-- 4", 5, 6 },
{ "-- 7", 8, 9 }
};
int main (void) {
int i;
for (i = 0; i != 3; ++i) {
printf ("\033[%c;3%cm%s%i%i\033[0m\n",
i + '1',
i + '1',
data [i]. x,
data [i]. y,
data [i]. z);
}
return (0);
}

View File

@ -1 +0,0 @@
// I hate this language so much it's unreal...

View File

@ -1,49 +0,0 @@
; fasm example_flat_assembly.fasm example_flat_assembly && chmod +x example_flat_assembly
format ELF64 executable 3
entry main
TERMINAL_INPUT = 0
TERMINAL_OUTPUT = 1
EXIT_SUCCESS = 0
EXIT_FAILURE = 1
macro write file, data, size {
mov rax, 1
mov rdi, file
mov rsi, data
mov rdx, size
syscall
}
macro exit code {
mov rax, 60
mov rdi, code
syscall
}
segment readable executable
colour:
write TERMINAL_OUTPUT, colour_red, 7
ret
cancel:
write TERMINAL_OUTPUT, colour_end, 4
ret
main:
call colour
write TERMINAL_OUTPUT, string, length
call cancel
exit EXIT_SUCCESS
segment readable writable
colour_red db 27, "[1;31m"
colour_end db 27, "[0m"
string db "Heyo world!", 10, 0
length dq $ - string

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -xe
xighlight -a -i ./example/example_ada.adb
xighlight -c -i ./example/example_c.c
xighlight -C -i ./example/example_cpp.cpp
xighlight -F -i ./example/example_flat_assembly.fasm
exit