diff options
Diffstat (limited to 'comp/lucas-standen-NEA/code2/examples')
-rw-r--r-- | comp/lucas-standen-NEA/code2/examples/Makefile | 6 | ||||
-rwxr-xr-x | comp/lucas-standen-NEA/code2/examples/fib_example | bin | 0 -> 21624 bytes | |||
-rw-r--r-- | comp/lucas-standen-NEA/code2/examples/fib_example.zpy | 13 | ||||
-rwxr-xr-x | comp/lucas-standen-NEA/code2/examples/raylib_example | bin | 0 -> 1082656 bytes | |||
-rw-r--r-- | comp/lucas-standen-NEA/code2/examples/raylib_example.zpy | 16 | ||||
-rwxr-xr-x | comp/lucas-standen-NEA/code2/examples/str_example | bin | 0 -> 21944 bytes | |||
-rw-r--r-- | comp/lucas-standen-NEA/code2/examples/str_example.zpy | 5 |
7 files changed, 40 insertions, 0 deletions
diff --git a/comp/lucas-standen-NEA/code2/examples/Makefile b/comp/lucas-standen-NEA/code2/examples/Makefile new file mode 100644 index 0000000..ccb9b35 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/Makefile @@ -0,0 +1,6 @@ +all: + zpy raylib_example.zpy -o raylib_example -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 +clean: + rm -rf fib_example raylib_example 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..e81a20c --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/fib_example diff --git a/comp/lucas-standen-NEA/code2/examples/fib_example.zpy b/comp/lucas-standen-NEA/code2/examples/fib_example.zpy new file mode 100644 index 0000000..a79b7d7 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/fib_example.zpy @@ -0,0 +1,13 @@ +(defun fib int n:int) + (if (< n 2)) + (return n) + (endif) + + (return (+ (fib (- n 1)) (fib (- n 2)))) +(endfun) + +(defun main int) + (let n:int (readint)) + (printint (fib n)) + (printchar '\n') +(endfun) diff --git a/comp/lucas-standen-NEA/code2/examples/raylib_example b/comp/lucas-standen-NEA/code2/examples/raylib_example Binary files differnew file mode 100755 index 0000000..2e3f1e9 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/raylib_example diff --git a/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy b/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy new file mode 100644 index 0000000..931c0e4 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy @@ -0,0 +1,16 @@ +(defun main int) + (InitWindow 800 800 "test") + (SetTargetFPS 40) + (let x:int 0) + (let y:int 0) + (for i:int 0 (= (WindowShouldClose) 0) 0) + (BeginDrawing) + (ClearBackground RAYWHITE) + (DrawText "test" x y 40 RED) + (EndDrawing) + + (set x (+ x 5)) + (set y (+ y 5)) + (endfor) + (CloseWindow) +(endfun) 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..ca715dd --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/str_example diff --git a/comp/lucas-standen-NEA/code2/examples/str_example.zpy b/comp/lucas-standen-NEA/code2/examples/str_example.zpy new file mode 100644 index 0000000..9b67f5f --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/str_example.zpy @@ -0,0 +1,5 @@ +(defun main int) + (let str:string* (String "hello")) + (printchar str->_str[0]) + (str->free str) +(endfun) |