diff options
Diffstat (limited to 'comp')
-rw-r--r-- | comp/lucas-standen-NEA/code2/examples/Makefile | 1 | ||||
-rwxr-xr-x | comp/lucas-standen-NEA/code2/examples/raylib_example | bin | 1085488 -> 1085488 bytes | |||
-rw-r--r-- | comp/lucas-standen-NEA/code2/examples/raylib_example.zpy | 2 | ||||
-rwxr-xr-x | comp/lucas-standen-NEA/code2/examples/str_example | bin | 24840 -> 24856 bytes | |||
-rw-r--r-- | comp/lucas-standen-NEA/code2/examples/str_example.zpy | 1 | ||||
-rwxr-xr-x | comp/work/35/binaryseach | bin | 0 -> 15456 bytes | |||
-rw-r--r-- | comp/work/35/binaryseach.c | 44 |
7 files changed, 46 insertions, 2 deletions
diff --git a/comp/lucas-standen-NEA/code2/examples/Makefile b/comp/lucas-standen-NEA/code2/examples/Makefile index 04bb54c..13178a5 100644 --- a/comp/lucas-standen-NEA/code2/examples/Makefile +++ b/comp/lucas-standen-NEA/code2/examples/Makefile @@ -2,6 +2,5 @@ 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 - zpy guestbook.zpy -o guestbook -f -ggdb clean: rm -rf fib_example raylib_example str_example diff --git a/comp/lucas-standen-NEA/code2/examples/raylib_example b/comp/lucas-standen-NEA/code2/examples/raylib_example Binary files differindex 28f2a9d..74d52ed 100755 --- a/comp/lucas-standen-NEA/code2/examples/raylib_example +++ 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 index 10f326e..90ef8b8 100644 --- a/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy +++ b/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy @@ -1,6 +1,6 @@ (defun main int) (InitWindow 800 800 "test_test") - (SetTargetFPS 60) + (SetTargetFPS 30) (let img:Image (LoadImage "dvd.png")) (let tex:Texture (LoadTextureFromImage img)) diff --git a/comp/lucas-standen-NEA/code2/examples/str_example b/comp/lucas-standen-NEA/code2/examples/str_example Binary files differindex ede98e9..8f86844 100755 --- a/comp/lucas-standen-NEA/code2/examples/str_example +++ 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 index 9b67f5f..7311660 100644 --- a/comp/lucas-standen-NEA/code2/examples/str_example.zpy +++ b/comp/lucas-standen-NEA/code2/examples/str_example.zpy @@ -2,4 +2,5 @@ (let str:string* (String "hello")) (printchar str->_str[0]) (str->free str) + (printstr "<first_letter\n") (endfun) diff --git a/comp/work/35/binaryseach b/comp/work/35/binaryseach Binary files differnew file mode 100755 index 0000000..1794f4f --- /dev/null +++ b/comp/work/35/binaryseach diff --git a/comp/work/35/binaryseach.c b/comp/work/35/binaryseach.c new file mode 100644 index 0000000..e6ce234 --- /dev/null +++ b/comp/work/35/binaryseach.c @@ -0,0 +1,44 @@ +#include <stdio.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> + +char *arr[] = { + "ali", + "ben", + "carl", + "joe", + "ken", + "lara", + "mo", + "oli", + "pam", + "stan", + "tara" +}; +int len = 11; + +char *binsearch(char *tofind){ + int l = len/2; + char *start = arr[0]; + char *end = arr[len]; + char *mid = arr[l]; + + while (mid != tofind){ + if (strcmp(mid, tofind) < 0){ + start = mid; + l /= 2; + mid = arr[len - l]; + }else { + end = mid; + l /= 2; + mid = arr[len - l] + } + } + + return start; +} + +int main(){ + binsearch("pam"); +} |