diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2024-10-15 10:19:30 +0100 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2024-10-15 10:19:30 +0100 |
commit | faef2d81c224b715c5e429d04c59ba50fb772d9e (patch) | |
tree | 2f75197a884ded3486c14e09908cb23bd24b968c /comp/lucas-standen-NEA/code2/examples | |
parent | 3564e513623bb3fc4d528d3d29df9aa91dae1396 (diff) |
added a stupid amount of work to zpy, and started the document work in latex
rather than groff
Diffstat (limited to 'comp/lucas-standen-NEA/code2/examples')
20 files changed, 37 insertions, 4 deletions
diff --git a/comp/lucas-standen-NEA/code2/examples/Makefile b/comp/lucas-standen-NEA/code2/examples/Makefile index 18a9e64..d3ee327 100644 --- a/comp/lucas-standen-NEA/code2/examples/Makefile +++ b/comp/lucas-standen-NEA/code2/examples/Makefile @@ -1,9 +1,8 @@ all: - zpy raylib_example.zpy -o raylib_example -f -lraylib -f -lm -i raylib.h zpy spaceinvaders.zpy -o spaceinvaders -f -lraylib -f -lm -i raylib.h zpy fib_example.zpy -o fib_example -f -ggdb zpy str_example.zpy -o str_example -f -ggdb - zpy syntaxerr.zpy -o syntaxerr + zpy syntaxerr.zpy -o syntaxerr clean: - rm -rf fib_example raylib_example str_example spaceinvaders tmp.zpy.c + rm -rf fib_example raylib_example str_example spaceinvaders syntaxerr tmp.zpy.c diff --git a/comp/lucas-standen-NEA/code2/examples/fib_example b/comp/lucas-standen-NEA/code2/examples/fib_example Binary files differnew file mode 100755 index 0000000..bdd94ec --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/fib_example diff --git a/comp/lucas-standen-NEA/code2/examples/helloworld/main b/comp/lucas-standen-NEA/code2/examples/helloworld/main Binary files differnew file mode 100755 index 0000000..653d84c --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/helloworld/main diff --git a/comp/lucas-standen-NEA/code2/examples/helloworld/main.zpy b/comp/lucas-standen-NEA/code2/examples/helloworld/main.zpy new file mode 100644 index 0000000..ef0a288 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/helloworld/main.zpy @@ -0,0 +1,3 @@ +(defun main int) + (printstr "hello world\n") +(endfun) diff --git a/comp/lucas-standen-NEA/code2/examples/helloworld/zpybuild.sh b/comp/lucas-standen-NEA/code2/examples/helloworld/zpybuild.sh new file mode 100644 index 0000000..7f675c3 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/helloworld/zpybuild.sh @@ -0,0 +1,2 @@ +#!/bin/sh +zpy ./main.zpy -o main diff --git a/comp/lucas-standen-NEA/code2/examples/helloworldadv/helloworld.c b/comp/lucas-standen-NEA/code2/examples/helloworldadv/helloworld.c new file mode 100644 index 0000000..f1e746f --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/helloworldadv/helloworld.c @@ -0,0 +1,4 @@ +#include <zpylib.h> +void helloworld(){ +printstr("hello world\n"); +} diff --git a/comp/lucas-standen-NEA/code2/examples/helloworldadv/helloworld.zpy b/comp/lucas-standen-NEA/code2/examples/helloworldadv/helloworld.zpy new file mode 100644 index 0000000..9e3553b --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/helloworldadv/helloworld.zpy @@ -0,0 +1,3 @@ +(defun helloworld void) + (printstr "hello world\n") +(endfun) diff --git a/comp/lucas-standen-NEA/code2/examples/helloworldadv/main b/comp/lucas-standen-NEA/code2/examples/helloworldadv/main Binary files differnew file mode 100755 index 0000000..593fe40 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/helloworldadv/main diff --git a/comp/lucas-standen-NEA/code2/examples/helloworldadv/main.c b/comp/lucas-standen-NEA/code2/examples/helloworldadv/main.c new file mode 100644 index 0000000..a2b6927 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/helloworldadv/main.c @@ -0,0 +1,4 @@ +#include <zpylib.h> +int main(){ +helloworld(); +} diff --git a/comp/lucas-standen-NEA/code2/examples/helloworldadv/main.zpy b/comp/lucas-standen-NEA/code2/examples/helloworldadv/main.zpy new file mode 100644 index 0000000..05b6155 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/helloworldadv/main.zpy @@ -0,0 +1,3 @@ +(defun main int) + (helloworld) +(endfun) diff --git a/comp/lucas-standen-NEA/code2/examples/helloworldadv/zpybuild.sh b/comp/lucas-standen-NEA/code2/examples/helloworldadv/zpybuild.sh new file mode 100644 index 0000000..26424d7 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/helloworldadv/zpybuild.sh @@ -0,0 +1,4 @@ +#!/bin/sh +zpy ./main.zpy -c -o main.c +zpy ./helloworld.zpy -c -o helloworld.c +cc main.c helloworld.c /usr/local/share/zpylib/zpylib.o -o main -I/usr/local/share/zpylib/include -Wno-implicit-function-declaration diff --git a/comp/lucas-standen-NEA/code2/examples/dvd.png b/comp/lucas-standen-NEA/code2/examples/raylib_example/dvd.png Binary files differindex 8e219f7..8e219f7 100644 --- a/comp/lucas-standen-NEA/code2/examples/dvd.png +++ b/comp/lucas-standen-NEA/code2/examples/raylib_example/dvd.png diff --git a/comp/lucas-standen-NEA/code2/examples/raylib_example/main b/comp/lucas-standen-NEA/code2/examples/raylib_example/main Binary files differnew file mode 100755 index 0000000..b124ebf --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/raylib_example/main diff --git a/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy b/comp/lucas-standen-NEA/code2/examples/raylib_example/main.zpy index 7c6e599..cd6a382 100644 --- a/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy +++ b/comp/lucas-standen-NEA/code2/examples/raylib_example/main.zpy @@ -1,3 +1,4 @@ +//# this function is my main loop (defun main int) (InitWindow 800 800 "test test") (SetTargetFPS 60) diff --git a/comp/lucas-standen-NEA/code2/examples/raylib_example/zpybuild.sh b/comp/lucas-standen-NEA/code2/examples/raylib_example/zpybuild.sh new file mode 100644 index 0000000..3916f3b --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/raylib_example/zpybuild.sh @@ -0,0 +1,4 @@ +#!/bin/sh +zpy ./main.zpy -c -o main.c -i raylib.h +cc main.c /usr/local/share/zpylib/zpylib.o -o main -I/usr/local/share/zpylib/include -Wno-implicit-function-declaration -lraylib -lm +rm -rf main.c diff --git a/comp/lucas-standen-NEA/code2/examples/spaceinvaders b/comp/lucas-standen-NEA/code2/examples/spaceinvaders Binary files differnew file mode 100755 index 0000000..ec88002 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/spaceinvaders diff --git a/comp/lucas-standen-NEA/code2/examples/spaceinvaders.zpy b/comp/lucas-standen-NEA/code2/examples/spaceinvaders.zpy index 698999a..5e51ed3 100644 --- a/comp/lucas-standen-NEA/code2/examples/spaceinvaders.zpy +++ b/comp/lucas-standen-NEA/code2/examples/spaceinvaders.zpy @@ -8,6 +8,7 @@ (def exists:bool) (endstruct) +//# this checks if 2 entitys are touching (defun touching bool a:entity* b:entity*) (def r1:Rectangle) (def r2:Rectangle) @@ -24,6 +25,7 @@ (return (CheckCollisionRecs r1 r2)) (endfun) +//# the main loop of the program (defun main int) (InitWindow 800 800 "test test") (SetTargetFPS 60) diff --git a/comp/lucas-standen-NEA/code2/examples/str_example b/comp/lucas-standen-NEA/code2/examples/str_example Binary files differnew file mode 100755 index 0000000..c543ab7 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/str_example diff --git a/comp/lucas-standen-NEA/code2/examples/syntaxerr.zpy b/comp/lucas-standen-NEA/code2/examples/syntaxerr.zpy index c74d53b..87494ed 100644 --- a/comp/lucas-standen-NEA/code2/examples/syntaxerr.zpy +++ b/comp/lucas-standen-NEA/code2/examples/syntaxerr.zpy @@ -1,3 +1,5 @@ (defun main int) - (return) + (let x:int) + (set x 10) + (return 10) (endfun) diff --git a/comp/lucas-standen-NEA/code2/examples/tmp.zpy.c b/comp/lucas-standen-NEA/code2/examples/tmp.zpy.c new file mode 100644 index 0000000..2305f24 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/tmp.zpy.c @@ -0,0 +1,2 @@ +#include <zpylib.h> +int main(){ |