summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrushs/evalexpr/80cols/80cols.sh11
-rw-r--r--rushs/evalexpr/80cols_grep/80cols.grep1
-rw-r--r--rushs/evalexpr/Makefile (renamed from rushs/evalexpr/evalexpr/Makefile)0
-rwxr-xr-xrushs/evalexpr/a.outbin15816 -> 0 bytes
-rw-r--r--rushs/evalexpr/add_int_ptr/add_int_ptr.c7
-rw-r--r--rushs/evalexpr/alphabet/alphabet.c13
-rwxr-xr-xrushs/evalexpr/alphanum/alphanum.sh53
-rw-r--r--rushs/evalexpr/array_max_min/array_max_min.c23
-rw-r--r--rushs/evalexpr/ascii_carousel/rot_x.c26
-rwxr-xr-xrushs/evalexpr/ascii_house/ascii_house.sh9
-rw-r--r--rushs/evalexpr/assignment_operator/assignment_operator.c37
-rw-r--r--rushs/evalexpr/binary_search_ptr/bsearch.c38
-rw-r--r--rushs/evalexpr/binary_search_ptr/bsearch.h16
-rw-r--r--rushs/evalexpr/binary_tree_dynamic/Makefile15
-rw-r--r--rushs/evalexpr/binary_tree_dynamic/binary_tree.c95
-rw-r--r--rushs/evalexpr/binary_tree_dynamic/binary_tree.h22
-rw-r--r--rushs/evalexpr/binary_tree_dynamic/binary_tree_print.c40
-rw-r--r--rushs/evalexpr/bit_rotation/rol.c5
-rw-r--r--rushs/evalexpr/bubble_sort/bubble_sort.c25
-rw-r--r--rushs/evalexpr/bubble_sort/bubble_sort.h8
-rw-r--r--rushs/evalexpr/check_alphabet/check_alphabet.c25
-rw-r--r--rushs/evalexpr/check_alphabet/check_alphabet.h6
-rw-r--r--rushs/evalexpr/clang-format/.clang-format79
-rw-r--r--rushs/evalexpr/clang-format/zaza.c78
-rwxr-xr-xrushs/evalexpr/create_files/create_files.sh34
-rw-r--r--rushs/evalexpr/cut_csv/test.csv15
-rwxr-xr-xrushs/evalexpr/cut_csv/with_cut.sh23
-rwxr-xr-xrushs/evalexpr/cut_csv/with_sed.sh24
-rw-r--r--rushs/evalexpr/digit/digit.c13
-rw-r--r--rushs/evalexpr/display_square/display_square.c44
-rw-r--r--rushs/evalexpr/dlist/Makefile15
-rw-r--r--rushs/evalexpr/dlist/dlist-1.c78
-rw-r--r--rushs/evalexpr/dlist/dlist-2.c113
-rw-r--r--rushs/evalexpr/dlist/dlist-3.c83
-rw-r--r--rushs/evalexpr/dlist/dlist-4.c97
-rw-r--r--rushs/evalexpr/dlist/dlist.h44
-rw-r--r--rushs/evalexpr/element_count/element_count.c10
-rw-r--r--rushs/evalexpr/element_count/element_count.h8
-rw-r--r--rushs/evalexpr/fact/fact.c8
-rwxr-xr-xrushs/evalexpr/facto/facto.sh10
-rw-r--r--rushs/evalexpr/fibo/fibo.c8
-rw-r--r--rushs/evalexpr/fibo_iter/fibo_iter.c21
-rw-r--r--rushs/evalexpr/fifo/Makefile16
-rw-r--r--rushs/evalexpr/fifo/fifo.h28
-rw-r--r--rushs/evalexpr/fifo/fifo_access.c66
-rw-r--r--rushs/evalexpr/fifo/fifo_setup_destroy.c39
-rwxr-xr-xrushs/evalexpr/find_ascii/find_ascii.sh5
-rw-r--r--rushs/evalexpr/freq_analysis/freq_analysis.c28
-rw-r--r--rushs/evalexpr/functional_programming/foldl.c11
-rw-r--r--rushs/evalexpr/functional_programming/foldr.c10
-rw-r--r--rushs/evalexpr/functional_programming/functional_programming.h10
-rw-r--r--rushs/evalexpr/functional_programming/map.c9
-rwxr-xr-xrushs/evalexpr/generate_files/generate_files.sh32
-rw-r--r--rushs/evalexpr/generic_void_list/list.c36
-rw-r--r--rushs/evalexpr/generic_void_list/list.h31
-rwxr-xr-xrushs/evalexpr/glob_easy/glob_easy.sh3
-rwxr-xr-xrushs/evalexpr/glob_remove_shell/glob_remove_shell.sh7
-rw-r--r--rushs/evalexpr/grade/grade.c29
-rw-r--r--rushs/evalexpr/greatest_divisor/greatest_divisor.c15
-rw-r--r--rushs/evalexpr/hacker_news/input.html147
-rw-r--r--rushs/evalexpr/hacker_news/news.sed1
-rw-r--r--rushs/evalexpr/hacker_news/output.txt90
-rw-r--r--rushs/evalexpr/handling_complex/complex.c51
-rw-r--r--rushs/evalexpr/handling_complex/complex.h20
-rw-r--r--rushs/evalexpr/hanoi/hanoi.c31
-rw-r--r--rushs/evalexpr/hash_map/hash.c13
-rw-r--r--rushs/evalexpr/hash_map/hash_map.c177
-rw-r--r--rushs/evalexpr/hash_map/hash_map.h29
-rw-r--r--rushs/evalexpr/heap/Makefile14
-rw-r--r--rushs/evalexpr/heap/add.c39
-rw-r--r--rushs/evalexpr/heap/create.c19
-rw-r--r--rushs/evalexpr/heap/del.c9
-rw-r--r--rushs/evalexpr/heap/heap.h20
-rw-r--r--rushs/evalexpr/heap/pop.c49
-rw-r--r--rushs/evalexpr/heap/print.c27
-rw-r--r--rushs/evalexpr/hello_friends/hello.c13
-rw-r--r--rushs/evalexpr/hello_world/hello.c7
-rwxr-xr-xrushs/evalexpr/hello_world_shebang/hello.sh3
-rw-r--r--rushs/evalexpr/hill_array/hill_array.c43
-rw-r--r--rushs/evalexpr/hill_array/hill_array.h8
-rw-r--r--rushs/evalexpr/insertion_sort/insertion_sort.c20
-rw-r--r--rushs/evalexpr/insertion_sort/insertion_sort.h8
-rwxr-xr-xrushs/evalexpr/inside/inside.sh15
-rwxr-xr-xrushs/evalexpr/inside_noif/inside_noif.sh6
-rw-r--r--rushs/evalexpr/int_palindrome/int_palindrome.c18
-rw-r--r--rushs/evalexpr/int_sqrt/int_sqrt.c20
-rw-r--r--rushs/evalexpr/io_count_words/count_words.c33
-rw-r--r--rushs/evalexpr/io_merge_files/merge_files.c31
-rw-r--r--rushs/evalexpr/io_replace_line/replace_line.c50
-rw-r--r--rushs/evalexpr/levenshtein/levenshtein.c72
-rw-r--r--rushs/evalexpr/levenshtein/levenshtein.h8
-rw-r--r--rushs/evalexpr/main.c15
-rw-r--r--rushs/evalexpr/my_abs/my_abs.c11
-rw-r--r--rushs/evalexpr/my_atoi/my_atoi.c61
-rw-r--r--rushs/evalexpr/my_atoi/my_atoi.h8
-rw-r--r--rushs/evalexpr/my_atoi_base/my_atoi_base.c86
-rw-r--r--rushs/evalexpr/my_atoi_base/my_atoi_base.h8
-rwxr-xr-xrushs/evalexpr/my_bc/my_bc.sh7
-rw-r--r--rushs/evalexpr/my_c_tail/main.c10
-rw-r--r--rushs/evalexpr/my_c_tail/my_c_tail.c46
-rw-r--r--rushs/evalexpr/my_c_tail/my_c_tail.h6
-rw-r--r--rushs/evalexpr/my_calloc/my_calloc.c11
-rw-r--r--rushs/evalexpr/my_calloc/my_calloc.h8
-rwxr-xr-xrushs/evalexpr/my_file/my_file.sh11
-rwxr-xr-xrushs/evalexpr/my_first_variable/create.sh5
-rwxr-xr-xrushs/evalexpr/my_first_variable/edit.sh9
-rwxr-xr-xrushs/evalexpr/my_first_variable/use.sh3
-rw-r--r--rushs/evalexpr/my_itoa/my_itoa.c38
-rw-r--r--rushs/evalexpr/my_itoa/my_itoa.h6
-rw-r--r--rushs/evalexpr/my_itoa_base/my_itoa_base.c49
-rw-r--r--rushs/evalexpr/my_itoa_base/my_itoa_base.h6
-rw-r--r--rushs/evalexpr/my_memcmp/my_memcmp.c18
-rw-r--r--rushs/evalexpr/my_memcmp/my_memcmp.h8
-rw-r--r--rushs/evalexpr/my_memcpy/my_memcpy.c28
-rw-r--r--rushs/evalexpr/my_memcpy/my_memcpy.h8
-rw-r--r--rushs/evalexpr/my_memmove/my_memmove.c23
-rw-r--r--rushs/evalexpr/my_memmove/my_memmove.h8
-rw-r--r--rushs/evalexpr/my_memset/my_memset.c12
-rw-r--r--rushs/evalexpr/my_memset/my_memset.h6
-rw-r--r--rushs/evalexpr/my_pow/my_pow.c13
-rw-r--r--rushs/evalexpr/my_round/my_round.c6
-rw-r--r--rushs/evalexpr/my_strcmp/my_strcmp.c11
-rw-r--r--rushs/evalexpr/my_strcmp/my_strcmp.h6
-rw-r--r--rushs/evalexpr/my_strcpy/my_strcpy.c13
-rw-r--r--rushs/evalexpr/my_strlen/my_strlen.c12
-rw-r--r--rushs/evalexpr/my_strlen/my_strlen.h6
-rw-r--r--rushs/evalexpr/my_strlowcase/my_strlowcase.c13
-rw-r--r--rushs/evalexpr/my_strlowcase/my_strlowcase.h8
-rw-r--r--rushs/evalexpr/my_strspn/my_strspn.c26
-rw-r--r--rushs/evalexpr/my_strspn/my_strspn.h8
-rw-r--r--rushs/evalexpr/my_strstr/my_strstr.c34
-rw-r--r--rushs/evalexpr/my_strstr/my_strstr.h6
-rw-r--r--rushs/evalexpr/my_strtok_r/my_strtok_r.c51
-rw-r--r--rushs/evalexpr/my_strtok_r/my_strtok_r.h6
-rw-r--r--rushs/evalexpr/null_terminated_arrays/null_terminated_arrays.c50
-rw-r--r--rushs/evalexpr/null_terminated_arrays/null_terminated_arrays.h6
-rw-r--r--rushs/evalexpr/number_digits_rec/number_digits_rec.c8
-rw-r--r--rushs/evalexpr/palindrome/palindrome.c47
-rw-r--r--rushs/evalexpr/palindrome/palindrome.h6
-rw-r--r--rushs/evalexpr/pine/pine.c36
-rw-r--r--rushs/evalexpr/pointer_swap/pointer_swap.c6
-rwxr-xr-xrushs/evalexpr/prototypes/prototypes.sh3
-rw-r--r--rushs/evalexpr/quick_sort/quick_sort.c18
-rw-r--r--rushs/evalexpr/quick_sort/quick_sort_example.c19
-rw-r--r--rushs/evalexpr/repeat/repeat.c11
-rw-r--r--rushs/evalexpr/right_tarball/my_tarball.tar.gzbin340 -> 0 bytes
-rw-r--r--rushs/evalexpr/rotx/rotx.c59
-rw-r--r--rushs/evalexpr/sed_trailing_whitespaces/whitespaces.sed1
-rw-r--r--rushs/evalexpr/selection_sort/selection_sort.c30
-rwxr-xr-xrushs/evalexpr/seq/seq.sh33
-rw-r--r--rushs/evalexpr/sieve_eratosthenes_advanced/Makefile13
-rw-r--r--rushs/evalexpr/sieve_eratosthenes_advanced/sieve.c39
-rw-r--r--rushs/evalexpr/simple_fnmatch/simple_fnmatch.c46
-rw-r--r--rushs/evalexpr/simple_fnmatch/simple_fnmatch.h8
-rw-r--r--rushs/evalexpr/src/evalexpr.c (renamed from rushs/evalexpr/evalexpr/src/evalexpr.c)0
-rw-r--r--rushs/evalexpr/src/evalexpr.h (renamed from rushs/evalexpr/evalexpr/src/evalexpr.h)0
-rw-r--r--rushs/evalexpr/src/evalrpn.c (renamed from rushs/evalexpr/evalexpr/src/evalrpn.c)0
-rw-r--r--rushs/evalexpr/src/fifo.h (renamed from rushs/evalexpr/evalexpr/src/fifo.h)0
-rw-r--r--rushs/evalexpr/src/fifo_access.c (renamed from rushs/evalexpr/evalexpr/src/fifo_access.c)0
-rw-r--r--rushs/evalexpr/src/fifo_setup_destroy.c (renamed from rushs/evalexpr/evalexpr/src/fifo_setup_destroy.c)0
-rw-r--r--rushs/evalexpr/src/shunting_yard.c (renamed from rushs/evalexpr/evalexpr/src/shunting_yard.c)0
-rw-r--r--rushs/evalexpr/src/stack.c (renamed from rushs/evalexpr/evalexpr/src/stack.c)0
-rw-r--r--rushs/evalexpr/src/stack.h (renamed from rushs/evalexpr/evalexpr/src/stack.h)0
-rw-r--r--rushs/evalexpr/src/stack_struct.h (renamed from rushs/evalexpr/evalexpr/src/stack_struct.h)0
-rw-r--r--rushs/evalexpr/stack/stack.c30
-rw-r--r--rushs/evalexpr/stack/stack.h14
-rw-r--r--rushs/evalexpr/str_revert/str_revert.c25
-rw-r--r--rushs/evalexpr/str_revert/str_revert.h6
-rw-r--r--rushs/evalexpr/test.txt3
-rw-r--r--rushs/evalexpr/test_a_bit/is_set.c6
-rw-r--r--rushs/evalexpr/test_a_bit/is_set.h6
-rw-r--r--rushs/evalexpr/test_a_bit/test.c11
-rwxr-xr-xrushs/evalexpr/tests/tests.sh (renamed from rushs/evalexpr/evalexpr/tests/tests.sh)0
-rw-r--r--rushs/evalexpr/tests/unit_tests.c (renamed from rushs/evalexpr/evalexpr/tests/unit_tests.c)0
-rw-r--r--rushs/evalexpr/tinylibstream/Makefile13
-rw-r--r--rushs/evalexpr/tinylibstream/include/libstream.h167
-rw-r--r--rushs/evalexpr/tinylibstream/src/tinylibstream.c221
-rw-r--r--rushs/evalexpr/tinylibstream/stdin_buffering_test.c70
-rw-r--r--rushs/evalexpr/tinylibstream/stdout_buffering_test.c13
-rw-r--r--rushs/evalexpr/traffic_lights/traffic_lights.c38
-rw-r--r--rushs/evalexpr/traffic_lights/traffic_lights.h11
-rw-r--r--rushs/evalexpr/user_ids/get_ids.sh3
-rwxr-xr-xrushs/evalexpr/using_special_variables/print.sh9
-rw-r--r--rushs/evalexpr/variant/variant.c96
-rw-r--r--rushs/evalexpr/variant/variant.h35
-rw-r--r--rushs/evalexpr/vector/Makefile13
-rw-r--r--rushs/evalexpr/vector/vector.c152
-rw-r--r--rushs/evalexpr/vector/vector.h64
-rwxr-xr-xrushs/tinyprintf/80cols/80cols.sh11
-rw-r--r--rushs/tinyprintf/80cols_grep/80cols.grep1
-rw-r--r--rushs/tinyprintf/Makefile (renamed from rushs/evalexpr/tinyprintf/Makefile)0
-rwxr-xr-xrushs/tinyprintf/a.outbin15816 -> 0 bytes
-rw-r--r--rushs/tinyprintf/add_int_ptr/add_int_ptr.c7
-rw-r--r--rushs/tinyprintf/alphabet/alphabet.c13
-rwxr-xr-xrushs/tinyprintf/alphanum/alphanum.sh53
-rw-r--r--rushs/tinyprintf/array_max_min/array_max_min.c23
-rw-r--r--rushs/tinyprintf/ascii_carousel/rot_x.c26
-rwxr-xr-xrushs/tinyprintf/ascii_house/ascii_house.sh9
-rw-r--r--rushs/tinyprintf/assignment_operator/assignment_operator.c37
-rw-r--r--rushs/tinyprintf/binary_search_ptr/bsearch.c38
-rw-r--r--rushs/tinyprintf/binary_search_ptr/bsearch.h16
-rw-r--r--rushs/tinyprintf/binary_tree_dynamic/Makefile15
-rw-r--r--rushs/tinyprintf/binary_tree_dynamic/binary_tree.c95
-rw-r--r--rushs/tinyprintf/binary_tree_dynamic/binary_tree.h22
-rw-r--r--rushs/tinyprintf/binary_tree_dynamic/binary_tree_print.c40
-rw-r--r--rushs/tinyprintf/bit_rotation/rol.c5
-rw-r--r--rushs/tinyprintf/bubble_sort/bubble_sort.c25
-rw-r--r--rushs/tinyprintf/bubble_sort/bubble_sort.h8
-rw-r--r--rushs/tinyprintf/check_alphabet/check_alphabet.c25
-rw-r--r--rushs/tinyprintf/check_alphabet/check_alphabet.h6
-rw-r--r--rushs/tinyprintf/clang-format/.clang-format79
-rw-r--r--rushs/tinyprintf/clang-format/zaza.c78
-rwxr-xr-xrushs/tinyprintf/create_files/create_files.sh34
-rw-r--r--rushs/tinyprintf/cut_csv/test.csv15
-rwxr-xr-xrushs/tinyprintf/cut_csv/with_cut.sh23
-rwxr-xr-xrushs/tinyprintf/cut_csv/with_sed.sh24
-rw-r--r--rushs/tinyprintf/digit/digit.c13
-rw-r--r--rushs/tinyprintf/display_square/display_square.c44
-rw-r--r--rushs/tinyprintf/dlist/Makefile15
-rw-r--r--rushs/tinyprintf/dlist/dlist-1.c78
-rw-r--r--rushs/tinyprintf/dlist/dlist-2.c113
-rw-r--r--rushs/tinyprintf/dlist/dlist-3.c83
-rw-r--r--rushs/tinyprintf/dlist/dlist-4.c97
-rw-r--r--rushs/tinyprintf/dlist/dlist.h44
-rw-r--r--rushs/tinyprintf/element_count/element_count.c10
-rw-r--r--rushs/tinyprintf/element_count/element_count.h8
-rw-r--r--rushs/tinyprintf/evalexpr/Makefile23
-rw-r--r--rushs/tinyprintf/evalexpr/src/evalexpr.c93
-rw-r--r--rushs/tinyprintf/evalexpr/src/evalexpr.h43
-rw-r--r--rushs/tinyprintf/evalexpr/src/evalrpn.c145
-rw-r--r--rushs/tinyprintf/evalexpr/src/fifo.h29
-rw-r--r--rushs/tinyprintf/evalexpr/src/fifo_access.c61
-rw-r--r--rushs/tinyprintf/evalexpr/src/fifo_setup_destroy.c44
-rw-r--r--rushs/tinyprintf/evalexpr/src/shunting_yard.c199
-rw-r--r--rushs/tinyprintf/evalexpr/src/stack.c57
-rw-r--r--rushs/tinyprintf/evalexpr/src/stack.h20
-rw-r--r--rushs/tinyprintf/evalexpr/src/stack_struct.h10
-rwxr-xr-xrushs/tinyprintf/evalexpr/tests/tests.sh82
-rw-r--r--rushs/tinyprintf/evalexpr/tests/unit_tests.c208
-rw-r--r--rushs/tinyprintf/fact/fact.c8
-rwxr-xr-xrushs/tinyprintf/facto/facto.sh10
-rw-r--r--rushs/tinyprintf/fibo/fibo.c8
-rw-r--r--rushs/tinyprintf/fibo_iter/fibo_iter.c21
-rw-r--r--rushs/tinyprintf/fifo/Makefile16
-rw-r--r--rushs/tinyprintf/fifo/fifo.h28
-rw-r--r--rushs/tinyprintf/fifo/fifo_access.c66
-rw-r--r--rushs/tinyprintf/fifo/fifo_setup_destroy.c39
-rwxr-xr-xrushs/tinyprintf/find_ascii/find_ascii.sh5
-rw-r--r--rushs/tinyprintf/freq_analysis/freq_analysis.c28
-rw-r--r--rushs/tinyprintf/functional_programming/foldl.c11
-rw-r--r--rushs/tinyprintf/functional_programming/foldr.c10
-rw-r--r--rushs/tinyprintf/functional_programming/functional_programming.h10
-rw-r--r--rushs/tinyprintf/functional_programming/map.c9
-rwxr-xr-xrushs/tinyprintf/generate_files/generate_files.sh32
-rw-r--r--rushs/tinyprintf/generic_void_list/list.c36
-rw-r--r--rushs/tinyprintf/generic_void_list/list.h31
-rwxr-xr-xrushs/tinyprintf/glob_easy/glob_easy.sh3
-rwxr-xr-xrushs/tinyprintf/glob_remove_shell/glob_remove_shell.sh7
-rw-r--r--rushs/tinyprintf/grade/grade.c29
-rw-r--r--rushs/tinyprintf/greatest_divisor/greatest_divisor.c15
-rw-r--r--rushs/tinyprintf/hacker_news/input.html147
-rw-r--r--rushs/tinyprintf/hacker_news/news.sed1
-rw-r--r--rushs/tinyprintf/hacker_news/output.txt90
-rw-r--r--rushs/tinyprintf/handling_complex/complex.c51
-rw-r--r--rushs/tinyprintf/handling_complex/complex.h20
-rw-r--r--rushs/tinyprintf/hanoi/hanoi.c31
-rw-r--r--rushs/tinyprintf/hash_map/hash.c13
-rw-r--r--rushs/tinyprintf/hash_map/hash_map.c177
-rw-r--r--rushs/tinyprintf/hash_map/hash_map.h29
-rw-r--r--rushs/tinyprintf/heap/Makefile14
-rw-r--r--rushs/tinyprintf/heap/add.c39
-rw-r--r--rushs/tinyprintf/heap/create.c19
-rw-r--r--rushs/tinyprintf/heap/del.c9
-rw-r--r--rushs/tinyprintf/heap/heap.h20
-rw-r--r--rushs/tinyprintf/heap/pop.c49
-rw-r--r--rushs/tinyprintf/heap/print.c27
-rw-r--r--rushs/tinyprintf/hello_friends/hello.c13
-rw-r--r--rushs/tinyprintf/hello_world/hello.c7
-rwxr-xr-xrushs/tinyprintf/hello_world_shebang/hello.sh3
-rw-r--r--rushs/tinyprintf/hill_array/hill_array.c43
-rw-r--r--rushs/tinyprintf/hill_array/hill_array.h8
-rw-r--r--rushs/tinyprintf/insertion_sort/insertion_sort.c20
-rw-r--r--rushs/tinyprintf/insertion_sort/insertion_sort.h8
-rwxr-xr-xrushs/tinyprintf/inside/inside.sh15
-rwxr-xr-xrushs/tinyprintf/inside_noif/inside_noif.sh6
-rw-r--r--rushs/tinyprintf/int_palindrome/int_palindrome.c18
-rw-r--r--rushs/tinyprintf/int_sqrt/int_sqrt.c20
-rw-r--r--rushs/tinyprintf/io_count_words/count_words.c33
-rw-r--r--rushs/tinyprintf/io_merge_files/merge_files.c31
-rw-r--r--rushs/tinyprintf/io_replace_line/replace_line.c50
-rw-r--r--rushs/tinyprintf/levenshtein/levenshtein.c72
-rw-r--r--rushs/tinyprintf/levenshtein/levenshtein.h8
-rw-r--r--rushs/tinyprintf/main.c15
-rw-r--r--rushs/tinyprintf/my_abs/my_abs.c11
-rw-r--r--rushs/tinyprintf/my_atoi/my_atoi.c61
-rw-r--r--rushs/tinyprintf/my_atoi/my_atoi.h8
-rw-r--r--rushs/tinyprintf/my_atoi_base/my_atoi_base.c86
-rw-r--r--rushs/tinyprintf/my_atoi_base/my_atoi_base.h8
-rwxr-xr-xrushs/tinyprintf/my_bc/my_bc.sh7
-rw-r--r--rushs/tinyprintf/my_c_tail/main.c10
-rw-r--r--rushs/tinyprintf/my_c_tail/my_c_tail.c46
-rw-r--r--rushs/tinyprintf/my_c_tail/my_c_tail.h6
-rw-r--r--rushs/tinyprintf/my_calloc/my_calloc.c11
-rw-r--r--rushs/tinyprintf/my_calloc/my_calloc.h8
-rwxr-xr-xrushs/tinyprintf/my_file/my_file.sh11
-rwxr-xr-xrushs/tinyprintf/my_first_variable/create.sh5
-rwxr-xr-xrushs/tinyprintf/my_first_variable/edit.sh9
-rwxr-xr-xrushs/tinyprintf/my_first_variable/use.sh3
-rw-r--r--rushs/tinyprintf/my_itoa/my_itoa.c38
-rw-r--r--rushs/tinyprintf/my_itoa/my_itoa.h6
-rw-r--r--rushs/tinyprintf/my_itoa_base/my_itoa_base.c49
-rw-r--r--rushs/tinyprintf/my_itoa_base/my_itoa_base.h6
-rw-r--r--rushs/tinyprintf/my_memcmp/my_memcmp.c18
-rw-r--r--rushs/tinyprintf/my_memcmp/my_memcmp.h8
-rw-r--r--rushs/tinyprintf/my_memcpy/my_memcpy.c28
-rw-r--r--rushs/tinyprintf/my_memcpy/my_memcpy.h8
-rw-r--r--rushs/tinyprintf/my_memmove/my_memmove.c23
-rw-r--r--rushs/tinyprintf/my_memmove/my_memmove.h8
-rw-r--r--rushs/tinyprintf/my_memset/my_memset.c12
-rw-r--r--rushs/tinyprintf/my_memset/my_memset.h6
-rw-r--r--rushs/tinyprintf/my_pow/my_pow.c13
-rw-r--r--rushs/tinyprintf/my_round/my_round.c6
-rw-r--r--rushs/tinyprintf/my_strcmp/my_strcmp.c11
-rw-r--r--rushs/tinyprintf/my_strcmp/my_strcmp.h6
-rw-r--r--rushs/tinyprintf/my_strcpy/my_strcpy.c13
-rw-r--r--rushs/tinyprintf/my_strlen/my_strlen.c12
-rw-r--r--rushs/tinyprintf/my_strlen/my_strlen.h6
-rw-r--r--rushs/tinyprintf/my_strlowcase/my_strlowcase.c13
-rw-r--r--rushs/tinyprintf/my_strlowcase/my_strlowcase.h8
-rw-r--r--rushs/tinyprintf/my_strspn/my_strspn.c26
-rw-r--r--rushs/tinyprintf/my_strspn/my_strspn.h8
-rw-r--r--rushs/tinyprintf/my_strstr/my_strstr.c34
-rw-r--r--rushs/tinyprintf/my_strstr/my_strstr.h6
-rw-r--r--rushs/tinyprintf/my_strtok_r/my_strtok_r.c51
-rw-r--r--rushs/tinyprintf/my_strtok_r/my_strtok_r.h6
-rw-r--r--rushs/tinyprintf/null_terminated_arrays/null_terminated_arrays.c50
-rw-r--r--rushs/tinyprintf/null_terminated_arrays/null_terminated_arrays.h6
-rw-r--r--rushs/tinyprintf/number_digits_rec/number_digits_rec.c8
-rw-r--r--rushs/tinyprintf/palindrome/palindrome.c47
-rw-r--r--rushs/tinyprintf/palindrome/palindrome.h6
-rw-r--r--rushs/tinyprintf/pine/pine.c36
-rw-r--r--rushs/tinyprintf/pointer_swap/pointer_swap.c6
-rwxr-xr-xrushs/tinyprintf/prototypes/prototypes.sh3
-rw-r--r--rushs/tinyprintf/quick_sort/quick_sort.c18
-rw-r--r--rushs/tinyprintf/quick_sort/quick_sort_example.c19
-rw-r--r--rushs/tinyprintf/repeat/repeat.c11
-rw-r--r--rushs/tinyprintf/right_tarball/my_tarball.tar.gzbin340 -> 0 bytes
-rw-r--r--rushs/tinyprintf/rotx/rotx.c59
-rw-r--r--rushs/tinyprintf/sed_trailing_whitespaces/whitespaces.sed1
-rw-r--r--rushs/tinyprintf/selection_sort/selection_sort.c30
-rwxr-xr-xrushs/tinyprintf/seq/seq.sh33
-rw-r--r--rushs/tinyprintf/sieve_eratosthenes_advanced/Makefile13
-rw-r--r--rushs/tinyprintf/sieve_eratosthenes_advanced/sieve.c39
-rw-r--r--rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c46
-rw-r--r--rushs/tinyprintf/simple_fnmatch/simple_fnmatch.h8
-rw-r--r--rushs/tinyprintf/src/tinyprintf.c (renamed from rushs/evalexpr/tinyprintf/src/tinyprintf.c)0
-rw-r--r--rushs/tinyprintf/src/tinyprintf.h (renamed from rushs/evalexpr/tinyprintf/src/tinyprintf.h)0
-rw-r--r--rushs/tinyprintf/stack/stack.c30
-rw-r--r--rushs/tinyprintf/stack/stack.h14
-rw-r--r--rushs/tinyprintf/str_revert/str_revert.c25
-rw-r--r--rushs/tinyprintf/str_revert/str_revert.h6
-rw-r--r--rushs/tinyprintf/test.txt3
-rw-r--r--rushs/tinyprintf/test_a_bit/is_set.c6
-rw-r--r--rushs/tinyprintf/test_a_bit/is_set.h6
-rw-r--r--rushs/tinyprintf/test_a_bit/test.c11
-rw-r--r--rushs/tinyprintf/tests/tests.c (renamed from rushs/evalexpr/tinyprintf/tests/tests.c)0
-rw-r--r--rushs/tinyprintf/tinylibstream/Makefile13
-rw-r--r--rushs/tinyprintf/tinylibstream/include/libstream.h167
-rw-r--r--rushs/tinyprintf/tinylibstream/src/tinylibstream.c221
-rw-r--r--rushs/tinyprintf/tinylibstream/stdin_buffering_test.c70
-rw-r--r--rushs/tinyprintf/tinylibstream/stdout_buffering_test.c13
-rw-r--r--rushs/tinyprintf/tinyprintf/Makefile17
-rw-r--r--rushs/tinyprintf/tinyprintf/src/tinyprintf.c251
-rw-r--r--rushs/tinyprintf/tinyprintf/src/tinyprintf.h15
-rw-r--r--rushs/tinyprintf/tinyprintf/tests/tests.c213
-rw-r--r--rushs/tinyprintf/traffic_lights/traffic_lights.c38
-rw-r--r--rushs/tinyprintf/traffic_lights/traffic_lights.h11
-rw-r--r--rushs/tinyprintf/user_ids/get_ids.sh3
-rwxr-xr-xrushs/tinyprintf/using_special_variables/print.sh9
-rw-r--r--rushs/tinyprintf/variant/variant.c96
-rw-r--r--rushs/tinyprintf/variant/variant.h35
-rw-r--r--rushs/tinyprintf/vector/Makefile13
-rw-r--r--rushs/tinyprintf/vector/vector.c152
-rw-r--r--rushs/tinyprintf/vector/vector.h64
384 files changed, 0 insertions, 11360 deletions
diff --git a/rushs/evalexpr/80cols/80cols.sh b/rushs/evalexpr/80cols/80cols.sh
deleted file mode 100755
index d66cf9b..0000000
--- a/rushs/evalexpr/80cols/80cols.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 1 ] && exit 1
-[ -f $1 ] || exit 1
-
-while IFS='' read -r line; do
- var=$(printf '%s' "$line" | wc -m)
- [ "$var" -ge 80 ] && printf '%s\n' "$line"
-done < "$1"
-
-exit 0
diff --git a/rushs/evalexpr/80cols_grep/80cols.grep b/rushs/evalexpr/80cols_grep/80cols.grep
deleted file mode 100644
index 1fe0c1f..0000000
--- a/rushs/evalexpr/80cols_grep/80cols.grep
+++ /dev/null
@@ -1 +0,0 @@
-.\{80,\}
diff --git a/rushs/evalexpr/evalexpr/Makefile b/rushs/evalexpr/Makefile
index 280f19c..280f19c 100644
--- a/rushs/evalexpr/evalexpr/Makefile
+++ b/rushs/evalexpr/Makefile
diff --git a/rushs/evalexpr/a.out b/rushs/evalexpr/a.out
deleted file mode 100755
index 33e84ed..0000000
--- a/rushs/evalexpr/a.out
+++ /dev/null
Binary files differ
diff --git a/rushs/evalexpr/add_int_ptr/add_int_ptr.c b/rushs/evalexpr/add_int_ptr/add_int_ptr.c
deleted file mode 100644
index ad48639..0000000
--- a/rushs/evalexpr/add_int_ptr/add_int_ptr.c
+++ /dev/null
@@ -1,7 +0,0 @@
-int *add_int_ptr(int *a, int *b)
-{
- if (!a || !b)
- return a;
- *a += *b;
- return a;
-}
diff --git a/rushs/evalexpr/alphabet/alphabet.c b/rushs/evalexpr/alphabet/alphabet.c
deleted file mode 100644
index 9496c66..0000000
--- a/rushs/evalexpr/alphabet/alphabet.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdio.h>
-
-int main(void)
-{
- for (char i = 'a'; i < 'z'; i++)
- {
- putchar(i);
- putchar(' ');
- }
- putchar('z');
- putchar('\n');
- return 0;
-}
diff --git a/rushs/evalexpr/alphanum/alphanum.sh b/rushs/evalexpr/alphanum/alphanum.sh
deleted file mode 100755
index e4c5aee..0000000
--- a/rushs/evalexpr/alphanum/alphanum.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-letters()
-{
- grepped=$(echo "$1" | grep -E "^[a-zA-Z]+$")
- [ "$1" = "$grepped" ] && return 0 || return 1
-}
-
-empty()
-{
- if echo "$1" | grep -qE '^[[:space:]]+$'; then
- return 0
- fi
- return 1
-}
-
-digit()
-{
- grepped=$(echo "$1" | grep -E "^[0-9]$")
- [ "$1" = "$grepped" ] && return 0 || return 1
-}
-
-number()
-{
- grepped=$(echo "$1" | grep -E "^[1-9][0-9]+$")
- [ "$1" = "$grepped" ] && return 0 || return 1
-}
-
-alph()
-{
- grepped=$(echo "$1" | grep -E "^[a-zA-Z0-9]+$")
- [ "$1" = "$grepped" ] && return 0 || return 1
-}
-
-while IFS='' read -r str; do
- if [ -z "$str" ]; then
- echo it is empty
- continue
- elif letters "$str"; then
- echo "it is a word"
- elif number "$str"; then
- echo "it is a number"
- elif digit "$str"; then
- echo "it is a digit"
- elif empty "$str"; then
- echo "it is empty"
- elif alph "$str"; then
- echo "it is an alphanum"
- else
- echo "it is too complicated"
- exit
- fi
-done
diff --git a/rushs/evalexpr/array_max_min/array_max_min.c b/rushs/evalexpr/array_max_min/array_max_min.c
deleted file mode 100644
index 8b2d3a5..0000000
--- a/rushs/evalexpr/array_max_min/array_max_min.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <stddef.h>
-#include <stdio.h>
-
-void array_max_min(int tab[], size_t len, int *max, int *min)
-{
- if (tab && len)
- {
- *min = tab[0];
- *max = tab[0];
-
- for (size_t i = 0; i < len; i++)
- {
- if (tab[i] > *max)
- {
- *max = tab[i];
- }
- else if (tab[i] < *min)
- {
- *min = tab[i];
- }
- }
- }
-}
diff --git a/rushs/evalexpr/ascii_carousel/rot_x.c b/rushs/evalexpr/ascii_carousel/rot_x.c
deleted file mode 100644
index 667106d..0000000
--- a/rushs/evalexpr/ascii_carousel/rot_x.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stddef.h>
-
-void rot_x(char *s, int x)
-{
- if (s == NULL)
- {
- return;
- }
-
- if (x < 0)
- {
- x = 26 + x;
- }
-
- for (size_t i = 0; s[i]; i++)
- {
- if (s[i] >= 'a' && s[i] <= 'z')
- {
- s[i] = ((s[i] - 'a') + x) % 26 + 'a';
- }
- else if (s[i] >= 'A' && s[i] <= 'Z')
- {
- s[i] = ((s[i] - 'A') + x) % 26 + 'A';
- }
- }
-}
diff --git a/rushs/evalexpr/ascii_house/ascii_house.sh b/rushs/evalexpr/ascii_house/ascii_house.sh
deleted file mode 100755
index 83d907e..0000000
--- a/rushs/evalexpr/ascii_house/ascii_house.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-
-echo ' /\'
-echo ' / \'
-echo -n "/____\\ \`" && echo "'\`"
-echo -n "| | \`" && echo "'''\`"
-echo "| | \`|\`"
-echo '|_/\_|___|__'
diff --git a/rushs/evalexpr/assignment_operator/assignment_operator.c b/rushs/evalexpr/assignment_operator/assignment_operator.c
deleted file mode 100644
index cae560f..0000000
--- a/rushs/evalexpr/assignment_operator/assignment_operator.c
+++ /dev/null
@@ -1,37 +0,0 @@
-void plus_equal(int *a, int *b)
-{
- if (!a || !b)
- {
- return;
- }
- *a = *a + *b;
-}
-
-void minus_equal(int *a, int *b)
-{
- if (!a || !b)
- {
- return;
- }
- *a = *a - *b;
-}
-
-void mult_equal(int *a, int *b)
-{
- if (!a || !b)
- {
- return;
- }
- *a = *a * *b;
-}
-
-int div_equal(int *a, int *b)
-{
- if (!a || !b || *b == 0)
- {
- return 0;
- }
- int res = *a % *b;
- *a = *a / *b;
- return res;
-}
diff --git a/rushs/evalexpr/binary_search_ptr/bsearch.c b/rushs/evalexpr/binary_search_ptr/bsearch.c
deleted file mode 100644
index bdc189c..0000000
--- a/rushs/evalexpr/binary_search_ptr/bsearch.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "bsearch.h"
-
-#include <stddef.h>
-
-int *binary_search(int *begin, int *end, int elt)
-{
- if (begin == end)
- {
- return begin;
- }
- if (begin > end)
- {
- if (elt > *begin)
- {
- return begin + 1;
- }
- return begin;
- }
-
- size_t m = (end - begin) / 2;
-
- if (begin[m] == elt)
- {
- return begin + m;
- }
-
- if (begin[m] > elt)
- {
- return binary_search(begin, begin + m, elt);
- }
-
- if (m == 0)
- {
- m++;
- }
-
- return binary_search(begin + m, end, elt);
-}
diff --git a/rushs/evalexpr/binary_search_ptr/bsearch.h b/rushs/evalexpr/binary_search_ptr/bsearch.h
deleted file mode 100644
index e011744..0000000
--- a/rushs/evalexpr/binary_search_ptr/bsearch.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef BSEARCH_H_
-#define BSEARCH_H_
-
-/*
-** Search `elt` in the memory range of [`begin` - `end`[.
-** `begin` is a pointer to the first element.
-** `end` is a pointer **AFTER** the last element.
-** The elements in the range [`begin` - `end`[ are sorted in ascending order.
-** If the range is empty, `begin` == `end`.
-** `begin` and `end` can't be `NULL`.
-** Returns a pointer to the element if found, or a pointer to the memory
-** location where the element could be inserted to keep the array sorted.
-*/
-int *binary_search(int *begin, int *end, int elt);
-
-#endif /* !BSEARCH_H_ */
diff --git a/rushs/evalexpr/binary_tree_dynamic/Makefile b/rushs/evalexpr/binary_tree_dynamic/Makefile
deleted file mode 100644
index 7fa9879..0000000
--- a/rushs/evalexpr/binary_tree_dynamic/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-CC = gcc
-CFLAGS = -Wall -Werror -Wvla -Wextra -std=c99 -pedantic
-
-SRC = binary_tree.c binary_tree_print.c
-OBJ = $(SRC:.c=.o)
-
-.PHONY: library clean
-
-library: $(OBJ)
- ar csr libbinary_tree.a $(OBJ)
-
-$(OBJ): $(SRC)
-
-clean:
- $(RM) libbinary_tree.a $(OBJ)
diff --git a/rushs/evalexpr/binary_tree_dynamic/binary_tree.c b/rushs/evalexpr/binary_tree_dynamic/binary_tree.c
deleted file mode 100644
index 6d99e99..0000000
--- a/rushs/evalexpr/binary_tree_dynamic/binary_tree.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "binary_tree.h"
-
-#include <stddef.h>
-#include <stdio.h>
-
-int size(const struct binary_tree *tree)
-{
- if (tree == NULL)
- return 0;
-
- return 1 + size(tree->left) + size(tree->right);
-}
-
-static int max(int a, int b)
-{
- if (a > b)
- return a;
- return b;
-}
-
-int height(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return -1;
- }
-
- return 1 + max(height(tree->left), height(tree->right));
-}
-
-int is_perfect(const struct binary_tree *tree)
-{
- if (tree == NULL)
- return 1;
- return height(tree->left) == height(tree->right) && is_perfect(tree->right)
- && is_perfect(tree->right);
-}
-
-int is_complete(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return 1;
- }
-
- int hg = height(tree->left);
- int hd = height(tree->right);
-
- if (hg - hd != 0 && hg - hd != 1)
- {
- return 0;
- }
-
- return is_complete(tree->left) && is_complete(tree->right);
-}
-
-int is_degenerate(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return 1;
- }
-
- if (tree->left && tree->right)
- {
- return 0;
- }
- return is_degenerate(tree->left) && is_degenerate(tree->right);
-}
-
-int is_full(const struct binary_tree *tree)
-{
- if (tree == NULL)
- return 1;
- if ((tree->left && !tree->right) || (!tree->left && tree->right))
- return 0;
- return is_full(tree->right) && is_full(tree->left);
-}
-
-static int is_bzt(const struct binary_tree *tree, int min, int max)
-{
- if (tree == NULL)
- return 1;
- if (tree->data > max || tree->data <= min)
- return 0;
- return is_bzt(tree->left, min, tree->data)
- && is_bzt(tree->right, tree->data, max);
-}
-
-int is_bst(const struct binary_tree *tree)
-{
- if (tree == NULL)
- return 1;
- return is_bzt(tree, -2147483647, 2147483647);
-}
diff --git a/rushs/evalexpr/binary_tree_dynamic/binary_tree.h b/rushs/evalexpr/binary_tree_dynamic/binary_tree.h
deleted file mode 100644
index a08e4ef..0000000
--- a/rushs/evalexpr/binary_tree_dynamic/binary_tree.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef BINARY_TREE_H
-#define BINARY_TREE_H
-
-struct binary_tree
-{
- int data;
- struct binary_tree *left;
- struct binary_tree *right;
-};
-
-int size(const struct binary_tree *tree);
-int height(const struct binary_tree *tree);
-void dfs_print_prefix(const struct binary_tree *tree);
-void dfs_print_infix(const struct binary_tree *tree);
-void dfs_print_postfix(const struct binary_tree *tree);
-int is_perfect(const struct binary_tree *tree);
-int is_complete(const struct binary_tree *tree);
-int is_degenerate(const struct binary_tree *tree);
-int is_full(const struct binary_tree *tree);
-int is_bst(const struct binary_tree *tree);
-
-#endif /* !BINARY_TREE_H */
diff --git a/rushs/evalexpr/binary_tree_dynamic/binary_tree_print.c b/rushs/evalexpr/binary_tree_dynamic/binary_tree_print.c
deleted file mode 100644
index bce0f77..0000000
--- a/rushs/evalexpr/binary_tree_dynamic/binary_tree_print.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <stddef.h>
-#include <stdio.h>
-
-#include "binary_tree.h"
-
-void dfs_print_prefix(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return;
- }
-
- printf("%d ", tree->data);
- dfs_print_prefix(tree->left);
- dfs_print_prefix(tree->right);
-}
-
-void dfs_print_infix(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return;
- }
-
- dfs_print_infix(tree->left);
- printf("%d ", tree->data);
- dfs_print_infix(tree->right);
-}
-
-void dfs_print_postfix(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return;
- }
-
- dfs_print_postfix(tree->left);
- dfs_print_postfix(tree->right);
- printf("%d ", tree->data);
-}
diff --git a/rushs/evalexpr/bit_rotation/rol.c b/rushs/evalexpr/bit_rotation/rol.c
deleted file mode 100644
index 151ebb5..0000000
--- a/rushs/evalexpr/bit_rotation/rol.c
+++ /dev/null
@@ -1,5 +0,0 @@
-unsigned char rol(unsigned char value, unsigned char roll)
-{
- roll %= sizeof(unsigned char) * 8;
- return (value << roll) | (value >> (8 * sizeof(unsigned char) - roll));
-}
diff --git a/rushs/evalexpr/bubble_sort/bubble_sort.c b/rushs/evalexpr/bubble_sort/bubble_sort.c
deleted file mode 100644
index 13d2ba3..0000000
--- a/rushs/evalexpr/bubble_sort/bubble_sort.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "bubble_sort.h"
-
-void bubble_sort(int array[], size_t size)
-{
- if (!array || size == 0)
- {
- return;
- }
-
- int mod;
- do
- {
- mod = 0;
- for (size_t i = 0; i < size - 1; i++)
- {
- if (array[i] > array[i + 1])
- {
- mod = 1;
- int tmp = array[i];
- array[i] = array[i + 1];
- array[i + 1] = tmp;
- }
- }
- } while (mod);
-}
diff --git a/rushs/evalexpr/bubble_sort/bubble_sort.h b/rushs/evalexpr/bubble_sort/bubble_sort.h
deleted file mode 100644
index a33d531..0000000
--- a/rushs/evalexpr/bubble_sort/bubble_sort.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef BUBBLE_SORT_H
-#define BUBBLE_SORT_H
-
-#include <stddef.h>
-
-void bubble_sort(int array[], size_t size);
-
-#endif /* !BUBBLE_SORT_H */
diff --git a/rushs/evalexpr/check_alphabet/check_alphabet.c b/rushs/evalexpr/check_alphabet/check_alphabet.c
deleted file mode 100644
index fc540b4..0000000
--- a/rushs/evalexpr/check_alphabet/check_alphabet.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "check_alphabet.h"
-
-#include <stddef.h>
-
-int check_alphabet(const char *str, const char *alphabet)
-{
- if (alphabet == NULL || *alphabet == '\0')
- {
- return 1;
- }
-
- for (int i = 0; alphabet[i]; i++)
- {
- int j;
- for (j = 0; str[j] && str[j] != alphabet[i]; j++)
- {
- continue;
- }
- if (str[j] == '\0')
- {
- return 0;
- }
- }
- return 1;
-}
diff --git a/rushs/evalexpr/check_alphabet/check_alphabet.h b/rushs/evalexpr/check_alphabet/check_alphabet.h
deleted file mode 100644
index 667a20f..0000000
--- a/rushs/evalexpr/check_alphabet/check_alphabet.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef CHECK_ALPHABET_H
-#define CHECK_ALPHABET_H
-
-int check_alphabet(const char *str, const char *alphabet);
-
-#endif /* !CHECK_ALPHABET_H */
diff --git a/rushs/evalexpr/clang-format/.clang-format b/rushs/evalexpr/clang-format/.clang-format
deleted file mode 100644
index 7ed8115..0000000
--- a/rushs/evalexpr/clang-format/.clang-format
+++ /dev/null
@@ -1,79 +0,0 @@
-AccessModifierOffset: -4
-AlignAfterOpenBracket: Align
-AlignConsecutiveAssignments: false
-AlignConsecutiveDeclarations: false
-AlignEscapedNewlines: Right
-AlignOperands: false
-AlignTrailingComments: false
-AllowAllParametersOfDeclarationOnNextLine: false
-AllowShortBlocksOnASingleLine: false
-AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
-AllowShortIfStatementsOnASingleLine: false
-AlwaysBreakAfterReturnType: None
-AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: Yes
-BinPackArguments: true
-BinPackParameters: true
-BreakBeforeBraces: Custom
-BraceWrapping:
- AfterEnum: true
- AfterClass: true
- AfterControlStatement: true
- AfterFunction: true
- AfterNamespace: true
- AfterStruct: true
- AfterUnion: true
- AfterExternBlock: true
- BeforeCatch: true
- BeforeElse: true
- IndentBraces: false
- SplitEmptyFunction: false
- SplitEmptyRecord: false
- SplitEmptyNamespace: false
-BreakBeforeBinaryOperators: NonAssignment
-BreakBeforeTernaryOperators: true
-BreakConstructorInitializers: BeforeComma
-BreakInheritanceList: BeforeComma
-BreakStringLiterals: true
-ColumnLimit: 80
-CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
-ConstructorInitializerIndentWidth: 4
-Cpp11BracedListStyle: false
-DerivePointerAlignment: false
-FixNamespaceComments: true
-ForEachMacros: ['ILIST_FOREACH', 'ILIST_FOREACH_ENTRY']
-IncludeBlocks: Regroup
-IncludeCategories:
- - Regex: '<.*>'
- Priority: 1
- - Regex: '.*'
- Priority: 2
-IndentCaseLabels: false
-IndentPPDirectives: AfterHash
-IndentWidth: 4
-IndentWrappedFunctionNames: false
-KeepEmptyLinesAtTheStartOfBlocks: false
-Language: Cpp
-NamespaceIndentation: All
-PointerAlignment: Right
-ReflowComments: true
-SortIncludes: true
-SortUsingDeclarations: false
-SpaceAfterCStyleCast: false
-SpaceAfterTemplateKeyword: true
-SpaceBeforeAssignmentOperators: true
-SpaceBeforeCpp11BracedList: false
-SpaceBeforeCtorInitializerColon: true
-SpaceBeforeParens: ControlStatements
-SpaceBeforeRangeBasedForLoopColon: true
-SpaceInEmptyParentheses: false
-SpacesBeforeTrailingComments: 1
-SpacesInAngles: false
-SpacesInCStyleCastParentheses: false
-SpacesInContainerLiterals: false
-SpacesInParentheses: false
-SpacesInSquareBrackets: false
-TabWidth: 4
-UseTab: Never
diff --git a/rushs/evalexpr/clang-format/zaza.c b/rushs/evalexpr/clang-format/zaza.c
deleted file mode 100644
index a6eec9a..0000000
--- a/rushs/evalexpr/clang-format/zaza.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#define ZAZA_SIZE 4
-
-static char get_zaza_char(size_t id)
-{
- const int zaza[ZAZA_SIZE] = {
- 10 * 10 + 2 * 10 + 2 * 10 / 10,
- 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
-
- * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- - (1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1),
- 122,
- (38943 * 43 - 84393 / 34583
-
- ) % 10
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1
- };
- switch (id * 2 + 4 - 2 + id * 4 - 2 + -5 * id)
-
- {
- case (0):
- return (zaza[0]);
- case (1000 - 100 - 4 * 100 + 10 * 100 - 14 * 100 - (10 * 10 - 1)):
- return (zaza[1]);
- case (1 << 11 >> 3 << 5 >> 2 << 1 << 1 << 1 >> 1 >> 1 >> 1 << 5 >> 4 << 1
- >> 1 >> 2 >> 9):
- return zaza[2];
- case (3 ^ 100) - (100 ^ 100) - (99 - 99) - (98 - 98) - (97 - 97) - (96 - 96)
- - (95 - 95) - (94 - 94) - (93 - 93) - (92 - 92) - (91 - 91) - (90 - 90)
- - (89 - 89) - (88 - 88) - (87 - 87) - (86 - 86) - (85 - 85) - (84 - 84)
- - (83 - 83) - (82 - 82) - (81 - 81) - (80 - 80) - (79 - 79) - (78 - 78)
- - (77 - 77) - (76 - 76) - (75 - 75) - (74 - 74) - (73 - 73) - (72 - 72)
- - (71 - 71) - (70 - 70) -
-
- (69 - 69) - (68 - 68) - (67 - 67) - (66 - 66) - (65 - 65) - (64 - 64)
- - (63 - 63) - (62 - 62) - (61 - 61) - (60 - 60) - (59 - 59) - (58 - 58)
- - (57 - 57) - (56 - 56) - (55 - 55) - (54 - 54) - (53 - 53) - (52 - 52)
- - (51 - 51) - 100 - (50 - 50) - (49 - 49) - (48 - 48) - (47 - 47)
- - (46 - 46) - (45 - 45) - (44 - 44) - (43 - 43) - (42 - 42) - (41 - 41)
- - (40 - 40) - (39 - 39) - (38 - 38) - (37 - 37)
-
- - (36 - 36) - (35 - 35) - (34 - 34) - (33 - 33) - (32 - 32) - (31 - 31)
- - (30 - 30) - (29 - 29) - (28 - 28) - (27 - 27) - (26 - 26) - (25 - 25)
- - (24 - 24) - (23 - 23) - (22 - 22) - (21 - 21) - (20 - 20) - (19 - 19)
- - (18 - 18) - (17 - 17) - (16 - 16) - (15 - 15) - (14 - 14) - (13 - 13)
- - (12 - 12) - (11 - 11) - (10 - 10) - (9 - 9) - (8 - 8) - (7 - 7)
- - (6 - 6) - (5 - 5) - (4 - 4) - (3 - 3) - (2 - 2) - (1 - 1):
- return (zaza[3]);
- default:
- return (0);
- }
-}
-int main(void)
-{
- for (size_t i = 0; i < ZAZA_SIZE; i += (i % 2 == 2 - 2) ? 1 % 2 : 1 % 2)
- {
- putchar(get_zaza_char(i));
- }
- putchar('\n');
- return (0);
-}
diff --git a/rushs/evalexpr/create_files/create_files.sh b/rushs/evalexpr/create_files/create_files.sh
deleted file mode 100755
index 28dba00..0000000
--- a/rushs/evalexpr/create_files/create_files.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-touch ' '
-chmod 644 ' '
-
-touch '\'
-chmod 644 '\'
-
-touch -- --
-chmod 644 -- --
-
-touch '|'
-chmod 644 '|'
-
-touch '"'
-chmod 644 '"'
-
-touch "'"
-chmod 644 "'"
-
-touch -- --\$i*\'\"\\
-chmod 644 -- --\$i*\'\"\\
-
-touch '# Exams are fun!'
-chmod 644 '# Exams are fun!'
-
-touch ";\`kill -9 0\`"
-chmod 644 ";\`kill -9 0\`"
-
-path="1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34/35/36/37/38/39/40/41/42/43/44/45/46/47/48/49/50"
-
-mkdir -p "$path"
-touch $path/farfaraway
-chmod 644 $path/farfaraway
diff --git a/rushs/evalexpr/cut_csv/test.csv b/rushs/evalexpr/cut_csv/test.csv
deleted file mode 100644
index d88282b..0000000
--- a/rushs/evalexpr/cut_csv/test.csv
+++ /dev/null
@@ -1,15 +0,0 @@
-James;Lebron;LABron;Lakers;
-Davis;Anthony;Unibrow;Pelicans;
-Mitchell;Donovan;Spida;Jazz;
-Harden;James;TheBeard;Rockets;
-Cousins;DeMarcus;Boogie;Wariors;
-Embiid;Joel;TheProcess;76Sixers;
-Bryant;Kobe;BlackMamba;Lakers;
-Jordan;Michael;AirJordan;Bulls;
-Johnson;Earvin;Magic;Lakers;
-Howard;Dwight;Superman;Wizards;
-Westbrook;Russel;MrTripleDouble;Thunder;
-Durant;Kevin;KD;Wariors;
-George;Paul;PG-13;Thunder;
-Leonard;Kawhi;TheKlaw;Raptors;
-Irving;Kyrie;UncleDrew;Celtics;
diff --git a/rushs/evalexpr/cut_csv/with_cut.sh b/rushs/evalexpr/cut_csv/with_cut.sh
deleted file mode 100755
index 9618f00..0000000
--- a/rushs/evalexpr/cut_csv/with_cut.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 2 ] && exit 1
-
-if ! [ -f "$1" ]; then
- exit 1
-fi
-
-if ! [ "$2" -eq "$2" ] 2> /dev/null; then
- exit 1
-fi
-
-[ "$2" -lt 0 ] && exit 1
-
-if [ "$2" -gt "$(wc -l < "$1")" ]; then
- exit 1
-fi
-
-line=$(head --lines="$2" "$1" 2> /dev/null | tail -n 1 | cut -d ';' -f 2-3 || exit 1)
-c1=$(echo "$line" | cut -d ';' -f 1)
-c2=$(echo "$line" | cut -d ';' -f 2)
-
-echo "$c1 is $c2"
diff --git a/rushs/evalexpr/cut_csv/with_sed.sh b/rushs/evalexpr/cut_csv/with_sed.sh
deleted file mode 100755
index fb5e1f8..0000000
--- a/rushs/evalexpr/cut_csv/with_sed.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 2 ] && exit 1
-
-if ! [ -f "$1" ]; then
- exit 1
-fi
-
-if ! [ "$2" -eq "$2" ] 2>/dev/null; then
- exit 1
-fi
-
-[ "$2" -lt 0 ] && exit 1
-
-if [ "$2" -gt $(wc -l < "$1") ]; then
- exit 1
-fi
-
-i=1
-
-while IFS= read -r line; do
- [ "$i" -eq "$2" ] && echo "$line" | sed 's/^.*;\(.*\);\(.*\);.*;$/\1 is \2/'
- i=$(($i + 1))
-done < "$1"
diff --git a/rushs/evalexpr/digit/digit.c b/rushs/evalexpr/digit/digit.c
deleted file mode 100644
index 5646b13..0000000
--- a/rushs/evalexpr/digit/digit.c
+++ /dev/null
@@ -1,13 +0,0 @@
-unsigned int digit(int n, int k)
-{
- if (n <= 0 || k <= 0)
- {
- return 0;
- }
-
- for (int i = 0; i < k - 1; i++)
- {
- n /= 10;
- }
- return n % 10;
-}
diff --git a/rushs/evalexpr/display_square/display_square.c b/rushs/evalexpr/display_square/display_square.c
deleted file mode 100644
index 9e834d7..0000000
--- a/rushs/evalexpr/display_square/display_square.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdio.h>
-
-void display_square(int width)
-{
- if (width <= 0)
- {
- return;
- }
-
- if (width % 2 == 0)
- {
- width++;
- }
-
- if (width == 1)
- {
- putchar('*');
- putchar('\n');
- return;
- }
-
- for (int i = 0; i < width; i++)
- {
- putchar('*');
- }
- putchar('\n');
-
- for (int i = 0; i < ((width - 3) / 2); i++)
- {
- putchar('*');
- for (int j = 0; j < width - 2; j++)
- {
- putchar(' ');
- }
- putchar('*');
- putchar('\n');
- }
-
- for (int i = 0; i < width; i++)
- {
- putchar('*');
- }
- putchar('\n');
-}
diff --git a/rushs/evalexpr/dlist/Makefile b/rushs/evalexpr/dlist/Makefile
deleted file mode 100644
index 1251967..0000000
--- a/rushs/evalexpr/dlist/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-CC = gcc
-CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
-
-SRC = dlist-1.c dlist-2.c dlist-3.c dlist-4.c
-OBJ = $(SRC:.c=.o)
-
-.PHONY: library clean
-
-library: $(OBJ)
- ar csr libdlist.a $(OBJ)
-
-clean: $(OBJ)
- $(RM) *.a $(OBJ)
-
-$(OBJ): $(SRC)
diff --git a/rushs/evalexpr/dlist/dlist-1.c b/rushs/evalexpr/dlist/dlist-1.c
deleted file mode 100644
index 443ebca..0000000
--- a/rushs/evalexpr/dlist/dlist-1.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dlist.h"
-
-struct dlist *dlist_init(void)
-{
- struct dlist *res = malloc(sizeof(struct dlist));
- if (res == NULL)
- return NULL;
-
- res->size = 0;
- res->head = NULL;
- res->tail = NULL;
- return res;
-}
-
-int dlist_push_front(struct dlist *list, int element)
-{
- if (element < 0)
- return 0;
- struct dlist_item *new = malloc(sizeof(struct dlist_item));
- if (new == NULL)
- return 0;
-
- new->data = element;
- new->next = list->head;
- new->prev = NULL;
-
- if (list->size == 0)
- list->tail = new;
- else
- list->head->prev = new;
-
- list->head = new;
- list->size++;
-
- return 1;
-}
-
-void dlist_print(const struct dlist *list)
-{
- if (list->size == 0)
- return;
-
- for (struct dlist_item *i = list->head; i != list->tail; i = i->next)
- {
- printf("%d\n", i->data);
- }
- printf("%d\n", list->tail->data);
-}
-
-int dlist_push_back(struct dlist *list, int element)
-{
- if (element < 0)
- return 0;
- struct dlist_item *new = malloc(sizeof(struct dlist_item));
- if (new == NULL)
- return 0;
-
- new->data = element;
- new->prev = list->tail;
- new->next = NULL;
-
- if (list->size == 0)
- list->head = new;
- else
- list->tail->next = new;
- list->tail = new;
- list->size++;
-
- return 1;
-}
-
-size_t dlist_size(const struct dlist *list)
-{
- return list->size;
-}
diff --git a/rushs/evalexpr/dlist/dlist-2.c b/rushs/evalexpr/dlist/dlist-2.c
deleted file mode 100644
index 5ccdaa3..0000000
--- a/rushs/evalexpr/dlist/dlist-2.c
+++ /dev/null
@@ -1,113 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dlist.h"
-
-int dlist_get(const struct dlist *list, size_t index)
-{
- if (index >= list->size)
- return -1;
-
- struct dlist_item *i;
- for (i = list->head; index; index--, i = i->next)
- {
- continue;
- }
-
- return i->data;
-}
-
-int dlist_insert_at(struct dlist *list, int element, size_t index)
-{
- if (index > list->size || element < 0)
- return 0;
- else if (index == list->size)
- dlist_push_back(list, element);
- else if (index == 0)
- dlist_push_front(list, element);
- else
- {
- struct dlist_item *new = malloc(sizeof(struct dlist_item));
- if (new == NULL)
- return 0;
- new->data = element;
-
- struct dlist_item *i;
- for (i = list->head; index - 1; index--, i = i->next)
- continue;
- new->next = i->next;
- i->next->prev = new;
- i->next = new;
- new->prev = i;
- list->size++;
- }
- return 1;
-}
-
-int dlist_find(const struct dlist *list, int element)
-{
- int index = 0;
- struct dlist_item *i;
- for (i = list->head; i && i->data != element; index++, i = i->next)
- continue;
- if (!i)
- return -1;
- return index;
-}
-
-int dlist_remove_at(struct dlist *list, size_t index)
-{
- if (index >= list->size)
- return -1;
- int res;
- struct dlist_item *item;
- if (list->size == 1)
- {
- item = list->head;
- res = list->head->data;
- list->head = NULL;
- list->tail = NULL;
- }
- else if (index == 0)
- {
- item = list->head;
- res = item->data;
- item->next->prev = NULL;
- list->head = item->next;
- }
- else if (index == list->size - 1)
- {
- item = list->tail;
- res = item->data;
- item->prev->next = NULL;
- list->tail = item->prev;
- }
- else
- {
- for (item = list->head; index; index--, item = item->next)
- continue;
-
- res = item->data;
- item->prev->next = item->next;
- item->next->prev = item->prev;
- }
-
- free(item);
- list->size--;
- return res;
-}
-
-void dlist_clear(struct dlist *list)
-{
- if (list->size == 0)
- return;
- for (struct dlist_item *i = list->head; i;)
- {
- struct dlist_item *tmp = i->next;
- free(i);
- i = tmp;
- }
- list->size = 0;
- list->head = NULL;
- list->tail = NULL;
-}
diff --git a/rushs/evalexpr/dlist/dlist-3.c b/rushs/evalexpr/dlist/dlist-3.c
deleted file mode 100644
index 22b4b52..0000000
--- a/rushs/evalexpr/dlist/dlist-3.c
+++ /dev/null
@@ -1,83 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dlist.h"
-
-void dlist_map_square(struct dlist *list)
-{
- for (struct dlist_item *i = list->head; i; i = i->next)
- {
- i->data *= i->data;
- }
-}
-
-void dlist_reverse(struct dlist *list)
-{
- struct dlist_item *tmp;
- for (struct dlist_item *i = list->head; i; i = i->prev)
- {
- tmp = i->next;
- i->next = i->prev;
- i->prev = tmp;
- }
- tmp = list->tail;
- list->tail = list->head;
- list->head = tmp;
-}
-
-struct dlist *dlist_split_at(struct dlist *list, size_t index)
-{
- if (list->size == 0)
- return dlist_init();
- if (index >= list->size)
- {
- return NULL;
- }
-
- struct dlist *new = dlist_init();
- if (new == NULL)
- return NULL;
- new->size = list->size - index;
- list->size = index;
-
- struct dlist_item *i;
- for (i = list->head; index; index--, i = i->next)
- {
- continue;
- }
-
- new->head = i;
- new->tail = list->tail;
- list->tail = i->prev;
- if (i->prev)
- {
- i->prev->next = NULL;
- }
- else
- {
- list->head = NULL;
- }
- i->prev = NULL;
- return new;
-}
-
-void dlist_concat(struct dlist *list1, struct dlist *list2)
-{
- if (list2->head == NULL)
- return;
- if (list1->tail == NULL)
- {
- list1->head = list2->head;
- list1->tail = list2->tail;
- list1->size = list2->size;
- return;
- }
-
- list1->tail->next = list2->head;
- list2->head->prev = list1->tail;
- list1->tail = list2->tail;
- list1->size += list2->size;
- list2->size = 0;
- list2->head = NULL;
- list2->tail = NULL;
-}
diff --git a/rushs/evalexpr/dlist/dlist-4.c b/rushs/evalexpr/dlist/dlist-4.c
deleted file mode 100644
index 9ed7aaa..0000000
--- a/rushs/evalexpr/dlist/dlist-4.c
+++ /dev/null
@@ -1,97 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dlist.h"
-
-size_t max(size_t a, size_t b)
-{
- if (a >= b)
- {
- return a;
- }
- return b;
-}
-
-size_t min(size_t a, size_t b)
-{
- if (a <= b)
- {
- return a;
- }
- return b;
-}
-
-size_t min_3(size_t a, size_t b, size_t c)
-{
- if (a <= b)
- {
- if (a <= c)
- {
- return a;
- }
- return c;
- }
- else
- {
- if (b <= c)
- {
- return b;
- }
- return c;
- }
-}
-
-size_t my_strlen(const int *s)
-{
- size_t i;
- for (i = 0; s[i] != -1; i++)
- {
- continue;
- }
- return i;
-}
-
-size_t levenshtein(const int *s1, const int *s2)
-{
- size_t l1 = my_strlen(s1);
- size_t l2 = my_strlen(s2);
- if (min(l1, l2) == 0)
- {
- return max(l1, l2);
- }
-
- if (s1[0] == s2[0])
- {
- return levenshtein(s1 + 1, s2 + 1);
- }
-
- size_t lev1 = levenshtein(s1 + 1, s2);
- size_t lev2 = levenshtein(s1, s2 + 1);
- size_t lev3 = levenshtein(s1 + 1, s2 + 1);
-
- return 1 + min_3(lev1, lev2, lev3);
-}
-
-int *to_str(const struct dlist *l)
-{
- int *res = malloc((l->size + 1) * sizeof(int));
- res[l->size] = -1;
- size_t j = 0;
- for (struct dlist_item *i = l->head; i; i = i->next, j++)
- {
- res[j] = i->data;
- }
- return res;
-}
-
-unsigned int dlist_levenshtein(const struct dlist *list1,
- const struct dlist *list2)
-{
- int *l1 = to_str(list1);
- int *l2 = to_str(list2);
-
- unsigned int res = levenshtein(l1, l2);
- free(l1);
- free(l2);
- return res;
-}
diff --git a/rushs/evalexpr/dlist/dlist.h b/rushs/evalexpr/dlist/dlist.h
deleted file mode 100644
index 97cde1a..0000000
--- a/rushs/evalexpr/dlist/dlist.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef DLIST_H
-#define DLIST_H
-
-#include <stddef.h>
-
-struct dlist_item
-{
- int data;
- struct dlist_item *next;
- struct dlist_item *prev;
-};
-
-struct dlist
-{
- size_t size;
- struct dlist_item *head;
- struct dlist_item *tail;
-};
-
-// Threshold 1
-struct dlist *dlist_init(void);
-int dlist_push_front(struct dlist *list, int element);
-void dlist_print(const struct dlist *list);
-int dlist_push_back(struct dlist *list, int element);
-size_t dlist_size(const struct dlist *list);
-
-// Threshold 2
-int dlist_get(const struct dlist *list, size_t index);
-int dlist_insert_at(struct dlist *list, int element, size_t index);
-int dlist_find(const struct dlist *list, int element);
-int dlist_remove_at(struct dlist *list, size_t index);
-void dlist_clear(struct dlist *list);
-
-// Threshold 3
-void dlist_map_square(struct dlist *list);
-void dlist_reverse(struct dlist *list);
-struct dlist *dlist_split_at(struct dlist *list, size_t index);
-void dlist_concat(struct dlist *list1, struct dlist *list2);
-
-// Threshold 4
-unsigned int dlist_levenshtein(const struct dlist *list1,
- const struct dlist *list2);
-
-#endif /* !DLIST_H */
diff --git a/rushs/evalexpr/element_count/element_count.c b/rushs/evalexpr/element_count/element_count.c
deleted file mode 100644
index cec47ae..0000000
--- a/rushs/evalexpr/element_count/element_count.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "element_count.h"
-
-size_t element_count(int *begin, int *end)
-{
- if (!begin || !end || begin >= end)
- {
- return 0;
- }
- return end - begin;
-}
diff --git a/rushs/evalexpr/element_count/element_count.h b/rushs/evalexpr/element_count/element_count.h
deleted file mode 100644
index 57412ed..0000000
--- a/rushs/evalexpr/element_count/element_count.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef ELEMENT_COUNT_H
-#define ELEMENT_COUNT_H
-
-#include <stddef.h>
-
-size_t element_count(int *begin, int *end);
-
-#endif /* !ELEMENT_COUNT_H */
diff --git a/rushs/evalexpr/fact/fact.c b/rushs/evalexpr/fact/fact.c
deleted file mode 100644
index 1440c94..0000000
--- a/rushs/evalexpr/fact/fact.c
+++ /dev/null
@@ -1,8 +0,0 @@
-unsigned long fact(unsigned n)
-{
- if (n == 0)
- {
- return 1;
- }
- return n * fact(n - 1);
-}
diff --git a/rushs/evalexpr/facto/facto.sh b/rushs/evalexpr/facto/facto.sh
deleted file mode 100755
index 350973a..0000000
--- a/rushs/evalexpr/facto/facto.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 1 ] && exit 1
-i=$1
-res=1
-while [ "$i" -gt 0 ]; do
- res=$(($res * $i))
- i=$(($i - 1))
-done
-echo "$res"
diff --git a/rushs/evalexpr/fibo/fibo.c b/rushs/evalexpr/fibo/fibo.c
deleted file mode 100644
index 99c0d79..0000000
--- a/rushs/evalexpr/fibo/fibo.c
+++ /dev/null
@@ -1,8 +0,0 @@
-unsigned long fibonacci(unsigned long n)
-{
- if (n == 0 || n == 1)
- {
- return n;
- }
- return fibonacci(n - 1) + fibonacci(n - 2);
-}
diff --git a/rushs/evalexpr/fibo_iter/fibo_iter.c b/rushs/evalexpr/fibo_iter/fibo_iter.c
deleted file mode 100644
index 36ebf46..0000000
--- a/rushs/evalexpr/fibo_iter/fibo_iter.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <stdio.h>
-
-unsigned long fibo_iter(unsigned long n)
-{
- if (n == 0)
- {
- return 0;
- }
- unsigned long prev = 1;
- unsigned long pprev = 0;
- unsigned long i;
-
- for (i = 1; i < n; i++)
- {
- unsigned long next = pprev + prev;
- pprev = prev;
- prev = next;
- }
-
- return prev;
-}
diff --git a/rushs/evalexpr/fifo/Makefile b/rushs/evalexpr/fifo/Makefile
deleted file mode 100644
index e5c9374..0000000
--- a/rushs/evalexpr/fifo/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-CC=gcc
-CFLAGS=-std=c99 -Wall -Wextra -Wvla -Werror -pedantic
-
-.PHONY: library clean
-
-library: fifo_access.o fifo_setup_destroy.o
- ar csr libfifo.a $^
-
-fifo_access.o: fifo_access.c
- $(CC) $(CFLAGS) -c -o fifo_access.o fifo_access.c
-
-fifo_setup_destroy.o: fifo_setup_destroy.c
- $(CC) $(CFLAGS) -c -o fifo_setup_destroy.o fifo_setup_destroy.c
-
-clean:
- rm *.o libfifo.a
diff --git a/rushs/evalexpr/fifo/fifo.h b/rushs/evalexpr/fifo/fifo.h
deleted file mode 100644
index c4b0a6f..0000000
--- a/rushs/evalexpr/fifo/fifo.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef FIFO_H
-#define FIFO_H
-
-#include <stddef.h>
-
-struct list
-{
- int data;
- struct list *next;
-};
-
-struct fifo
-{
- struct list *head;
- struct list *tail;
- size_t size;
-};
-
-struct fifo *fifo_init(void);
-size_t fifo_size(struct fifo *fifo);
-void fifo_push(struct fifo *fifo, int elt);
-int fifo_head(struct fifo *fifo);
-void fifo_pop(struct fifo *fifo);
-void fifo_clear(struct fifo *fifo);
-void fifo_destroy(struct fifo *fifo);
-void fifo_print(const struct fifo *fifo);
-
-#endif /* !FIFO_H */
diff --git a/rushs/evalexpr/fifo/fifo_access.c b/rushs/evalexpr/fifo/fifo_access.c
deleted file mode 100644
index 5d31586..0000000
--- a/rushs/evalexpr/fifo/fifo_access.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "fifo.h"
-
-size_t fifo_size(struct fifo *fifo)
-{
- return fifo->size;
-}
-
-void fifo_push(struct fifo *fifo, int elt)
-{
- struct list *new = malloc(sizeof(struct list));
- if (new == NULL)
- {
- return;
- }
- new->data = elt;
-
- if (fifo_size(fifo) == 0)
- {
- fifo->head = new;
- }
- new->next = NULL;
- if (fifo_size(fifo) != 0)
- {
- fifo->tail->next = new;
- }
- fifo->tail = new;
-
- fifo->size++;
-}
-
-int fifo_head(struct fifo *fifo)
-{
- return fifo->head->data;
-}
-
-void fifo_pop(struct fifo *fifo)
-{
- if (fifo_size(fifo) == 0)
- {
- return;
- }
- if (fifo_size(fifo) == 1)
- {
- free(fifo->head);
- fifo->head = NULL;
- fifo->tail = NULL;
- return;
- }
-
- struct list *tmp = fifo->head->next;
- free(fifo->head);
- fifo->head = tmp;
-
- fifo->size--;
-}
-
-void fifo_print(const struct fifo *fifo)
-{
- for (struct list *l = fifo->head; l; l = l->next)
- {
- printf("%d\n", l->data);
- }
-}
diff --git a/rushs/evalexpr/fifo/fifo_setup_destroy.c b/rushs/evalexpr/fifo/fifo_setup_destroy.c
deleted file mode 100644
index 80820e1..0000000
--- a/rushs/evalexpr/fifo/fifo_setup_destroy.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdlib.h>
-
-#include "fifo.h"
-
-struct fifo *fifo_init(void)
-{
- struct fifo *f = malloc(sizeof(struct fifo));
- if (f == NULL)
- {
- return NULL;
- }
-
- f->size = 0;
- f->head = NULL;
- f->tail = NULL;
-
- return f;
-}
-
-void fifo_clear(struct fifo *fifo)
-{
- for (struct list *l = fifo->head; l != fifo->tail;)
- {
- struct list *tmp = l->next;
- free(l);
- l = tmp;
- }
- free(fifo->tail);
-
- fifo->head = NULL;
- fifo->tail = NULL;
- fifo->size = 0;
-}
-
-void fifo_destroy(struct fifo *fifo)
-{
- fifo_clear(fifo);
- free(fifo);
-}
diff --git a/rushs/evalexpr/find_ascii/find_ascii.sh b/rushs/evalexpr/find_ascii/find_ascii.sh
deleted file mode 100755
index db31722..0000000
--- a/rushs/evalexpr/find_ascii/find_ascii.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-for filename in $(ls "$1"); do
- echo $1/$filename | file -f - | grep ASCII
-done
diff --git a/rushs/evalexpr/freq_analysis/freq_analysis.c b/rushs/evalexpr/freq_analysis/freq_analysis.c
deleted file mode 100644
index c60d7a6..0000000
--- a/rushs/evalexpr/freq_analysis/freq_analysis.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <stdio.h>
-
-int find_rank(int h[26], int min)
-{
- int res = 0;
- for (int i = 0; i < 26; i++)
- {
- res += h[i] > h[min] || (h[i] == h[min] && i < min);
- }
- return res;
-}
-
-void freq_analysis(const char text[], const char table[])
-{
- int h[26] = { 0 };
- for (int i = 0; text[i]; i++)
- {
- h[text[i] - 'A']++;
- }
-
- for (int j = 0; j < 26; j++)
- {
- if (h[j] != 0)
- {
- printf("%c %c\n", j + 'A', table[find_rank(h, j)]);
- }
- }
-}
diff --git a/rushs/evalexpr/functional_programming/foldl.c b/rushs/evalexpr/functional_programming/foldl.c
deleted file mode 100644
index ac222a7..0000000
--- a/rushs/evalexpr/functional_programming/foldl.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "functional_programming.h"
-
-int foldl(int *array, size_t len, int (*func)(int, int))
-{
- int acc = 0;
- for (size_t i = 0; i < len; i++)
- {
- acc = (*func)(acc, array[i]);
- }
- return acc;
-}
diff --git a/rushs/evalexpr/functional_programming/foldr.c b/rushs/evalexpr/functional_programming/foldr.c
deleted file mode 100644
index c232410..0000000
--- a/rushs/evalexpr/functional_programming/foldr.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "functional_programming.h"
-
-int foldr(int *array, size_t len, int (*func)(int, int))
-{
- if (len == 1)
- {
- return (*func)(array[0], 0);
- }
- return (*func)(array[0], foldr(array + 1, len - 1, func));
-}
diff --git a/rushs/evalexpr/functional_programming/functional_programming.h b/rushs/evalexpr/functional_programming/functional_programming.h
deleted file mode 100644
index 429b13c..0000000
--- a/rushs/evalexpr/functional_programming/functional_programming.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef FUNCTIONAL_PROGRAMMING_H
-#define FUNCTIONAL_PROGRAMMING_H
-
-#include <stddef.h>
-
-void map(int *array, size_t len, void (*func)(int *));
-int foldr(int *array, size_t len, int (*func)(int, int));
-int foldl(int *array, size_t len, int (*func)(int, int));
-
-#endif /* !FUNCTIONAL_PROGRAMMING_H */
diff --git a/rushs/evalexpr/functional_programming/map.c b/rushs/evalexpr/functional_programming/map.c
deleted file mode 100644
index 311c39c..0000000
--- a/rushs/evalexpr/functional_programming/map.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "functional_programming.h"
-
-void map(int *array, size_t len, void (*func)(int *))
-{
- for (size_t i = 0; i < len; i++)
- {
- (*func)(array + i);
- }
-}
diff --git a/rushs/evalexpr/generate_files/generate_files.sh b/rushs/evalexpr/generate_files/generate_files.sh
deleted file mode 100755
index cf2ba0a..0000000
--- a/rushs/evalexpr/generate_files/generate_files.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-FILENAME="default"
-NUMBER="1"
-EXTENSION="txt"
-
-while [ $# -gt 0 ]; do
- case "$1" in
- '-f' | '--filename')
- shift
- FILENAME="$1"
- shift
- ;;
- '-n' | '--number')
- shift
- NUMBER="$1"
- shift
- ;;
- '-e' | '--extension')
- shift
- EXTENSION="$1"
- shift
- ;;
- *)
- exit 1
- ;;
- esac
-done
-
-for i in $(seq 1 $NUMBER); do
- touch -- "$FILENAME-$i.$EXTENSION"
-done
diff --git a/rushs/evalexpr/generic_void_list/list.c b/rushs/evalexpr/generic_void_list/list.c
deleted file mode 100644
index 20ecfa8..0000000
--- a/rushs/evalexpr/generic_void_list/list.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "list.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-struct list *list_prepend(struct list *list, const void *value,
- size_t data_size)
-{
- struct list *new = malloc(sizeof(struct list));
- new->next = list;
- new->data = malloc(sizeof(void *));
- memcpy(new->data, value, data_size);
- return new;
-}
-
-size_t list_length(struct list *list)
-{
- size_t res = 0;
- while (list)
- {
- res++;
- list = list->next;
- }
- return res;
-}
-
-void list_destroy(struct list *list)
-{
- while (list)
- {
- struct list *tmp = list->next;
- free(list->data);
- free(list);
- list = tmp;
- }
-}
diff --git a/rushs/evalexpr/generic_void_list/list.h b/rushs/evalexpr/generic_void_list/list.h
deleted file mode 100644
index a1bc035..0000000
--- a/rushs/evalexpr/generic_void_list/list.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef LIST_H
-#define LIST_H
-
-#include <stddef.h>
-
-struct list
-{
- void *data;
- struct list *next;
-};
-
-/*
-** Insert a node containing `value` at the beginning of the list.
-** Return `NULL` if an error occurred.
-*/
-struct list *list_prepend(struct list *list, const void *value,
- size_t data_size);
-
-/*
-** Return the length of the list.
-** Return `0` if the list is empty.
-*/
-size_t list_length(struct list *list);
-
-/*
-** Release the memory used by the list.
-** Does nothing if `list` is `NULL`.
-*/
-void list_destroy(struct list *list);
-
-#endif /* !LIST_H */
diff --git a/rushs/evalexpr/glob_easy/glob_easy.sh b/rushs/evalexpr/glob_easy/glob_easy.sh
deleted file mode 100755
index b6ae028..0000000
--- a/rushs/evalexpr/glob_easy/glob_easy.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo $1/*.[A-Za-z][A-Za-z]
diff --git a/rushs/evalexpr/glob_remove_shell/glob_remove_shell.sh b/rushs/evalexpr/glob_remove_shell/glob_remove_shell.sh
deleted file mode 100755
index c2e7ff7..0000000
--- a/rushs/evalexpr/glob_remove_shell/glob_remove_shell.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-fmt=*.${1:-"txt"}
-
-for file in $(echo "$fmt"); do
- [ -e "$file" ] && rm "$file" || exit 1
-done
diff --git a/rushs/evalexpr/grade/grade.c b/rushs/evalexpr/grade/grade.c
deleted file mode 100644
index caecc82..0000000
--- a/rushs/evalexpr/grade/grade.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <stdio.h>
-
-void grade(char g)
-{
- switch (g)
- {
- case 'A':
- puts("Excellent");
- break;
- case 'B':
- puts("Good");
- break;
- case 'C':
- puts("Not so bad");
- break;
- case 'D':
- puts("Could be worse");
- break;
- case 'E':
- puts("Maybe next time");
- break;
- case 'F':
- puts("No comment");
- break;
- default:
- puts("Call a wild ACU");
- break;
- }
-}
diff --git a/rushs/evalexpr/greatest_divisor/greatest_divisor.c b/rushs/evalexpr/greatest_divisor/greatest_divisor.c
deleted file mode 100644
index 4c8efef..0000000
--- a/rushs/evalexpr/greatest_divisor/greatest_divisor.c
+++ /dev/null
@@ -1,15 +0,0 @@
-unsigned int greatest_divisor(unsigned int n)
-{
- if (n == 0 || n == 1)
- {
- return 1;
- }
-
- int i;
- for (i = n / 2; i > 0 && n % i; i--)
- {
- continue;
- }
-
- return i;
-}
diff --git a/rushs/evalexpr/hacker_news/input.html b/rushs/evalexpr/hacker_news/input.html
deleted file mode 100644
index 54d338d..0000000
--- a/rushs/evalexpr/hacker_news/input.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<html op="news" class=" lddwcbt idc0_332" lang="en"><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta name="referrer" content="origin"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" type="text/css" href="02_files/news.css">
- <link rel="shortcut icon" href="https://news.ycombinator.com/favicon.ico">
- <link rel="alternate" type="application/rss+xml" title="RSS" href="https://news.ycombinator.com/rss">
- <title>Hacker News</title></head><body><center><table id="hnmain" width="85%" cellspacing="0" cellpadding="0" border="0" bgcolor="#f6f6ef">
- <tbody><tr><td bgcolor="#ff6600"><table style="padding:2px" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td style="width:18px;padding-right:4px"><a href="https://news.ycombinator.com/"><img src="02_files/y18.gif" style="border:1px white solid;" width="18" height="18"></a></td>
- <td style="line-height:12pt; height:10px;"><span class="pagetop"><b class="hnname"><a href="https://news.ycombinator.com/news">Hacker News</a></b>
- <a href="https://news.ycombinator.com/newest">new</a> | <a href="https://news.ycombinator.com/front">past</a> | <a href="https://news.ycombinator.com/newcomments">comments</a> | <a href="https://news.ycombinator.com/ask">ask</a> | <a href="https://news.ycombinator.com/show">show</a> | <a href="https://news.ycombinator.com/jobs">jobs</a> | <a href="https://news.ycombinator.com/submit">submit</a> </span></td><td style="text-align:right;padding-right:4px;"><span class="pagetop">
- <a href="https://news.ycombinator.com/login?goto=news%3Fp%3D2">login</a>
- </span></td>
- </tr></tbody></table></td></tr>
-<tr id="pagespace" title="" style="height:10px"></tr><tr><td><table class="itemlist" cellspacing="0" cellpadding="0" border="0">
- <tbody><tr class="athing" id="28943869">
- <td class="title" valign="top" align="right"><span class="rank">31.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943869" href="https://news.ycombinator.com/vote?id=28943869&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://apnews.com/article/technology-business-arts-and-entertainment-be48d7582fdd5604664fff33ed81ca80" class="titlelink">Sinclair Broadcast Group identifies data breach</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=apnews.com"><span class="sitestr">apnews.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943869">8 points</span> by <a href="https://news.ycombinator.com/user?id=xojoc" class="hnuser">xojoc</a> <span class="age" title="2021-10-21T13:12:05"><a href="https://news.ycombinator.com/item?id=28943869">1 hour ago</a></span> <span id="unv_28943869"></span> | <a href="https://news.ycombinator.com/hide?id=28943869&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943869">1&nbsp;comment</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28926775">
- <td class="title" valign="top" align="right"><span class="rank">32.</span></td> <td class="votelinks" valign="top"><center><a id="up_28926775" href="https://news.ycombinator.com/vote?id=28926775&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.earlevel.com/main/2002/08/31/a-gentle-introduction-to-the-fft/" class="titlelink">A gentle introduction to the FFT (2002)</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=earlevel.com"><span class="sitestr">earlevel.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28926775">71 points</span> by <a href="https://news.ycombinator.com/user?id=tigerlily" class="hnuser">tigerlily</a> <span class="age" title="2021-10-20T04:31:20"><a href="https://news.ycombinator.com/item?id=28926775">12 hours ago</a></span> <span id="unv_28926775"></span> | <a href="https://news.ycombinator.com/hide?id=28926775&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28926775">14&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28930157">
- <td class="title" valign="top" align="right"><span class="rank">33.</span></td> <td class="votelinks" valign="top"><center><a id="up_28930157" href="https://news.ycombinator.com/vote?id=28930157&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://thebrowser.com/notes/jon-ingold/" class="titlelink">Jon Ingold on translating archeology into video games</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=thebrowser.com"><span class="sitestr">thebrowser.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28930157">36 points</span> by <a href="https://news.ycombinator.com/user?id=nupitalnumber" class="hnuser">nupitalnumber</a> <span class="age" title="2021-10-20T13:04:53"><a href="https://news.ycombinator.com/item?id=28930157">9 hours ago</a></span> <span id="unv_28930157"></span> | <a href="https://news.ycombinator.com/hide?id=28930157&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28930157">4&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28943611">
- <td class="title" valign="top" align="right"><span class="rank">34.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943611" href="https://news.ycombinator.com/vote?id=28943611&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://news.ycombinator.com/item?id=28943611" class="titlelink">Ask HN: How to Sell a Website</a></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943611">7 points</span> by <a href="https://news.ycombinator.com/user?id=legrisch" class="hnuser">legrisch</a> <span class="age" title="2021-10-21T12:45:35"><a href="https://news.ycombinator.com/item?id=28943611">1 hour ago</a></span> <span id="unv_28943611"></span> | <a href="https://news.ycombinator.com/hide?id=28943611&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943611">3&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28933391">
- <td class="title" valign="top" align="right"><span class="rank">35.</span></td> <td class="votelinks" valign="top"><center><a id="up_28933391" href="https://news.ycombinator.com/vote?id=28933391&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://iconmap.io/blog" class="titlelink">We analyzed 425k favicons</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=iconmap.io"><span class="sitestr">iconmap.io</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28933391">493 points</span> by <a href="https://news.ycombinator.com/user?id=gurgeous" class="hnuser">gurgeous</a> <span class="age" title="2021-10-20T17:29:03"><a href="https://news.ycombinator.com/item?id=28933391">20 hours ago</a></span> <span id="unv_28933391"></span> | <a href="https://news.ycombinator.com/hide?id=28933391&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28933391">119&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28938551">
- <td class="title" valign="top" align="right"><span class="rank">36.</span></td> <td class="votelinks" valign="top"><center><a id="up_28938551" href="https://news.ycombinator.com/vote?id=28938551&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.science.org/content/article/machu-picchu-was-built-over-major-fault-zones-now-researchers-think-they-know-why" class="titlelink">Machu Picchu was built over major fault zones (2019)</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=science.org"><span class="sitestr">science.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28938551">98 points</span> by <a href="https://news.ycombinator.com/user?id=Anon84" class="hnuser">Anon84</a> <span class="age" title="2021-10-21T00:07:54"><a href="https://news.ycombinator.com/item?id=28938551">14 hours ago</a></span> <span id="unv_28938551"></span> | <a href="https://news.ycombinator.com/hide?id=28938551&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28938551">41&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940507">
- <td class="title" valign="top" align="right"><span class="rank">37.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940507" href="https://news.ycombinator.com/vote?id=28940507&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://brave.com/wp-content/uploads/2021/03/goggles.pdf" class="titlelink">Goggles: Democracy dies in darkness, and so does the Web [pdf]</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=brave.com"><span class="sitestr">brave.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940507">114 points</span> by <a href="https://news.ycombinator.com/user?id=InvaderFizz" class="hnuser">InvaderFizz</a> <span class="age" title="2021-10-21T05:03:56"><a href="https://news.ycombinator.com/item?id=28940507">9 hours ago</a></span> <span id="unv_28940507"></span> | <a href="https://news.ycombinator.com/hide?id=28940507&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940507">119&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28933663">
- <td class="title" valign="top" align="right"><span class="rank">38.</span></td> <td class="votelinks" valign="top"><center><a id="up_28933663" href="https://news.ycombinator.com/vote?id=28933663&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://browser.geekbench.com/v5/cpu/10496766" class="titlelink">Apple M1 Max Geekbench Score</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=geekbench.com"><span class="sitestr">geekbench.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28933663">467 points</span> by <a href="https://news.ycombinator.com/user?id=mv9" class="hnuser">mv9</a> <span class="age" title="2021-10-20T17:50:17"><a href="https://news.ycombinator.com/item?id=28933663">20 hours ago</a></span> <span id="unv_28933663"></span> | <a href="https://news.ycombinator.com/hide?id=28933663&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28933663">771&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28933981">
- <td class="title" valign="top" align="right"><span class="rank">39.</span></td> <td class="votelinks" valign="top"><center><a id="up_28933981" href="https://news.ycombinator.com/vote?id=28933981&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.commerce.gov/news/press-releases/2021/10/commerce-tightens-export-controls-items-used-surveillance-private" class="titlelink">U.S. tightens export controls on items used in surveillance of private citizens</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=commerce.gov"><span class="sitestr">commerce.gov</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28933981">275 points</span> by <a href="https://news.ycombinator.com/user?id=transpute" class="hnuser">transpute</a> <span class="age" title="2021-10-20T18:14:33"><a href="https://news.ycombinator.com/item?id=28933981">20 hours ago</a></span> <span id="unv_28933981"></span> | <a href="https://news.ycombinator.com/hide?id=28933981&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28933981">161&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28943645">
- <td class="title" valign="top" align="right"><span class="rank">40.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943645" href="https://news.ycombinator.com/vote?id=28943645&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.wsj.com/articles/wework-set-to-go-public-via-spac-deal-two-years-after-failed-ipo-11634808600" class="titlelink" rel="nofollow">WeWork is trying to go public – again</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=wsj.com"><span class="sitestr">wsj.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943645">8 points</span> by <a href="https://news.ycombinator.com/user?id=collegeburner" class="hnuser">collegeburner</a> <span class="age" title="2021-10-21T12:49:02"><a href="https://news.ycombinator.com/item?id=28943645">1 hour ago</a></span> <span id="unv_28943645"></span> | <a href="https://news.ycombinator.com/hide?id=28943645&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943645">2&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28934624">
- <td class="title" valign="top" align="right"><span class="rank">41.</span></td> <td class="votelinks" valign="top"><center><a id="up_28934624" href="https://news.ycombinator.com/vote?id=28934624&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.copetti.org/writings/consoles/playstation-3/" class="titlelink">Playstation 3 Architecture</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=copetti.org"><span class="sitestr">copetti.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28934624">362 points</span> by <a href="https://news.ycombinator.com/user?id=bangonkeyboard" class="hnuser">bangonkeyboard</a> <span class="age" title="2021-10-20T18:56:53"><a href="https://news.ycombinator.com/item?id=28934624">19 hours ago</a></span> <span id="unv_28934624"></span> | <a href="https://news.ycombinator.com/hide?id=28934624&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28934624">81&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28929639">
- <td class="title" valign="top" align="right"><span class="rank">42.</span></td> <td class="votelinks" valign="top"><center><a id="up_28929639" href="https://news.ycombinator.com/vote?id=28929639&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://owlpal.substack.com/p/about-that-time-i-had-an-outburst" class="titlelink">About that time I had an outburst during the Y Combinator Interview</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=owlpal.substack.com"><span class="sitestr">owlpal.substack.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28929639">498 points</span> by <a href="https://news.ycombinator.com/user?id=curiousowl" class="hnuser">curiousowl</a> <span class="age" title="2021-10-20T12:03:25"><a href="https://news.ycombinator.com/item?id=28929639">1 day ago</a></span> <span id="unv_28929639"></span> | <a href="https://news.ycombinator.com/hide?id=28929639&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28929639">242&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28938378">
- <td class="title" valign="top" align="right"><span class="rank">43.</span></td> <td class="votelinks" valign="top"><center><a id="up_28938378" href="https://news.ycombinator.com/vote?id=28938378&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.guernicamag.com/one-mans-pest/" class="titlelink" rel="nofollow">One Man's Pest</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=guernicamag.com"><span class="sitestr">guernicamag.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28938378">8 points</span> by <a href="https://news.ycombinator.com/user?id=yimby" class="hnuser">yimby</a> <span class="age" title="2021-10-20T23:47:13"><a href="https://news.ycombinator.com/item?id=28938378">6 hours ago</a></span> <span id="unv_28938378"></span> | <a href="https://news.ycombinator.com/hide?id=28938378&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28938378">discuss</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28926582">
- <td class="title" valign="top" align="right"><span class="rank">44.</span></td> <td class="votelinks" valign="top"><center><a id="up_28926582" href="https://news.ycombinator.com/vote?id=28926582&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://brave.com/search-and-web-discovery/" class="titlelink">Brave Search replaces Google as default search engine in the Brave browser</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=brave.com"><span class="sitestr">brave.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28926582">723 points</span> by <a href="https://news.ycombinator.com/user?id=skellertor" class="hnuser">skellertor</a> <span class="age" title="2021-10-20T03:56:51"><a href="https://news.ycombinator.com/item?id=28926582">1 day ago</a></span> <span id="unv_28926582"></span> | <a href="https://news.ycombinator.com/hide?id=28926582&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28926582">528&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28943866">
- <td class="title" valign="top" align="right"><span class="rank">45.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943866" href="https://news.ycombinator.com/vote?id=28943866&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://twitter.com//rashiq/status/1319346264992026624" class="titlelink" rel="nofollow">I reverse engineered mcdonald's internal API</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=twitter.com/rashiq"><span class="sitestr">twitter.com/rashiq</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943866">3 points</span> by <a href="https://news.ycombinator.com/user?id=graderjs" class="hnuser">graderjs</a> <span class="age" title="2021-10-21T13:11:46"><a href="https://news.ycombinator.com/item?id=28943866">1 hour ago</a></span> <span id="unv_28943866"></span> | <a href="https://news.ycombinator.com/hide?id=28943866&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943866">discuss</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28936324">
- <td class="title" valign="top" align="right"><span class="rank">46.</span></td> <td class="votelinks" valign="top"><center><a id="up_28936324" href="https://news.ycombinator.com/vote?id=28936324&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.science.org/doi/10.1126/scisignal.abc4764" class="titlelink">Injury response to DNA damage in live tumor cells promotes antitumor immunity</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=science.org"><span class="sitestr">science.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28936324">109 points</span> by <a href="https://news.ycombinator.com/user?id=bcaulfield" class="hnuser">bcaulfield</a> <span class="age" title="2021-10-20T20:48:40"><a href="https://news.ycombinator.com/item?id=28936324">17 hours ago</a></span> <span id="unv_28936324"></span> | <a href="https://news.ycombinator.com/hide?id=28936324&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28936324">5&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940197">
- <td class="title" valign="top" align="right"><span class="rank">47.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940197" href="https://news.ycombinator.com/vote?id=28940197&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.cowin.gov.in/" class="titlelink">India Counting Down to 1B Doses</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=cowin.gov.in"><span class="sitestr">cowin.gov.in</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940197">105 points</span> by <a href="https://news.ycombinator.com/user?id=neelkadia" class="hnuser">neelkadia</a> <span class="age" title="2021-10-21T04:17:41"><a href="https://news.ycombinator.com/item?id=28940197">10 hours ago</a></span> <span id="unv_28940197"></span> | <a href="https://news.ycombinator.com/hide?id=28940197&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940197">78&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28943066">
- <td class="title" valign="top" align="right"><span class="rank">48.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943066" href="https://news.ycombinator.com/vote?id=28943066&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://slate.com/technology/2021/10/tether-crypto-danger-ben-mckenzie.html" class="titlelink" rel="nofollow">Time to get worried about Tether, the “stablecoin” at center of cryptocurrency</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=slate.com"><span class="sitestr">slate.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943066">6 points</span> by <a href="https://news.ycombinator.com/user?id=RickJWagner" class="hnuser">RickJWagner</a> <span class="age" title="2021-10-21T11:45:09"><a href="https://news.ycombinator.com/item?id=28943066">2 hours ago</a></span> <span id="unv_28943066"></span> | <a href="https://news.ycombinator.com/hide?id=28943066&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943066">5&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940258">
- <td class="title" valign="top" align="right"><span class="rank">49.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940258" href="https://news.ycombinator.com/vote?id=28940258&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.alifewithoutlimits.com.au/the-history-of-surveying/" class="titlelink">The History of Surveying</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=alifewithoutlimits.com.au"><span class="sitestr">alifewithoutlimits.com.au</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940258">20 points</span> by <a href="https://news.ycombinator.com/user?id=barbazoo" class="hnuser">barbazoo</a> <span class="age" title="2021-10-21T04:27:11"><a href="https://news.ycombinator.com/item?id=28940258">9 hours ago</a></span> <span id="unv_28940258"></span> | <a href="https://news.ycombinator.com/hide?id=28940258&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940258">9&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28921244">
- <td class="title" valign="top" align="right"><span class="rank">50.</span></td> <td class="votelinks" valign="top"><center><a id="up_28921244" href="https://news.ycombinator.com/vote?id=28921244&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.npr.org/2021/10/19/1047303559/fda-hearing-aid-prescription-over-the-counter" class="titlelink">The FDA wants you to be able to buy a hearing aid without a prescription</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=npr.org"><span class="sitestr">npr.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28921244">722 points</span> by <a href="https://news.ycombinator.com/user?id=cf100clunk" class="hnuser">cf100clunk</a> <span class="age" title="2021-10-19T17:58:42"><a href="https://news.ycombinator.com/item?id=28921244">1 day ago</a></span> <span id="unv_28921244"></span> | <a href="https://news.ycombinator.com/hide?id=28921244&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28921244">441&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28942594">
- <td class="title" valign="top" align="right"><span class="rank">51.</span></td> <td class="votelinks" valign="top"><center><a id="up_28942594" href="https://news.ycombinator.com/vote?id=28942594&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.pcgamer.com/windows-11-pcs-can-hobble-gaming-performance/" class="titlelink">Windows 11 will hobble gaming performance by default on some prebuilt PCs</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=pcgamer.com"><span class="sitestr">pcgamer.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28942594">13 points</span> by <a href="https://news.ycombinator.com/user?id=DeathArrow" class="hnuser">DeathArrow</a> <span class="age" title="2021-10-21T10:33:39"><a href="https://news.ycombinator.com/item?id=28942594">3 hours ago</a></span> <span id="unv_28942594"></span> | <a href="https://news.ycombinator.com/hide?id=28942594&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28942594">3&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940705">
- <td class="title" valign="top" align="right"><span class="rank">52.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940705" href="https://news.ycombinator.com/vote?id=28940705&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.gimp.org/news/2021/10/20/gimp-2-99-8-released/" class="titlelink">Development version: GIMP 2.99.8 Released</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=gimp.org"><span class="sitestr">gimp.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940705">19 points</span> by <a href="https://news.ycombinator.com/user?id=pauloxnet" class="hnuser">pauloxnet</a> <span class="age" title="2021-10-21T05:33:20"><a href="https://news.ycombinator.com/item?id=28940705">8 hours ago</a></span> <span id="unv_28940705"></span> | <a href="https://news.ycombinator.com/hide?id=28940705&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940705">2&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28903383">
- <td class="title" valign="top" align="right"><span class="rank">53.</span></td> <td class="votelinks" valign="top"><center><a id="up_28903383" href="https://news.ycombinator.com/vote?id=28903383&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://mikolaj-kaminski.com/jetbrains-rider-docker-compose-unicodedecodeerror-issue-fix/" class="titlelink">I couldn't debug the code because of my name</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=mikolaj-kaminski.com"><span class="sitestr">mikolaj-kaminski.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28903383">247 points</span> by <a href="https://news.ycombinator.com/user?id=mikasjp" class="hnuser">mikasjp</a> <span class="age" title="2021-10-18T08:40:39"><a href="https://news.ycombinator.com/item?id=28903383">23 hours ago</a></span> <span id="unv_28903383"></span> | <a href="https://news.ycombinator.com/hide?id=28903383&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28903383">268&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28937484">
- <td class="title" valign="top" align="right"><span class="rank">54.</span></td> <td class="votelinks" valign="top"><center><a id="up_28937484" href="https://news.ycombinator.com/vote?id=28937484&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://calbryant.uk/blog/10-ways-to-get-the-best-out-of-openscad/" class="titlelink">Getting the best out of OpenSCAD</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=calbryant.uk"><span class="sitestr">calbryant.uk</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28937484">109 points</span> by <a href="https://news.ycombinator.com/user?id=naggie" class="hnuser">naggie</a> <span class="age" title="2021-10-20T22:13:20"><a href="https://news.ycombinator.com/item?id=28937484">16 hours ago</a></span> <span id="unv_28937484"></span> | <a href="https://news.ycombinator.com/hide?id=28937484&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28937484">52&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28921083">
- <td class="title" valign="top" align="right"><span class="rank">55.</span></td> <td class="votelinks" valign="top"><center><a id="up_28921083" href="https://news.ycombinator.com/vote?id=28921083&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://spectrum.ieee.org/recycled-batteries-good-as-newly-mined" class="titlelink">Study: Recycled Lithium Batteries as Good as Newly Mined</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=ieee.org"><span class="sitestr">ieee.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28921083">623 points</span> by <a href="https://news.ycombinator.com/user?id=mpweiher" class="hnuser">mpweiher</a> <span class="age" title="2021-10-19T17:45:07"><a href="https://news.ycombinator.com/item?id=28921083">1 day ago</a></span> <span id="unv_28921083"></span> | <a href="https://news.ycombinator.com/hide?id=28921083&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28921083">179&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28934715">
- <td class="title" valign="top" align="right"><span class="rank">56.</span></td> <td class="votelinks" valign="top"><center><a id="up_28934715" href="https://news.ycombinator.com/vote?id=28934715&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://americasfuture.org/eliminating-gifted-programs-wont-make-education-fair/" class="titlelink">Eliminating gifted programs won’t make education fair</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=americasfuture.org"><span class="sitestr">americasfuture.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28934715">180 points</span> by <a href="https://news.ycombinator.com/user?id=paulpauper" class="hnuser">paulpauper</a> <span class="age" title="2021-10-20T19:03:44"><a href="https://news.ycombinator.com/item?id=28934715">19 hours ago</a></span> <span id="unv_28934715"></span> | <a href="https://news.ycombinator.com/hide?id=28934715&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28934715">400&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28939407">
- <td class="title" valign="top" align="right"><span class="rank">57.</span></td> <td class="votelinks" valign="top"><center><a id="up_28939407" href="https://news.ycombinator.com/vote?id=28939407&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://github.com/ToshioCP/Gtk4-tutorial/blob/main/Readme.md" class="titlelink">Gtk4 Tutorial</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=github.com/toshiocp"><span class="sitestr">github.com/toshiocp</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28939407">53 points</span> by <a href="https://news.ycombinator.com/user?id=marcodiego" class="hnuser">marcodiego</a> <span class="age" title="2021-10-21T01:59:18"><a href="https://news.ycombinator.com/item?id=28939407">12 hours ago</a></span> <span id="unv_28939407"></span> | <a href="https://news.ycombinator.com/hide?id=28939407&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28939407">73&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940334">
- <td class="title" valign="top" align="right"><span class="rank">58.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940334" href="https://news.ycombinator.com/vote?id=28940334&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://obua.com/publications/cosmo-id/3/" class="titlelink" rel="nofollow">Cosmopolitan Identifiers</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=obua.com"><span class="sitestr">obua.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940334">10 points</span> by <a href="https://news.ycombinator.com/user?id=BeefySwain" class="hnuser">BeefySwain</a> <span class="age" title="2021-10-21T04:39:41"><a href="https://news.ycombinator.com/item?id=28940334">9 hours ago</a></span> <span id="unv_28940334"></span> | <a href="https://news.ycombinator.com/hide?id=28940334&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940334">2&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28929840">
- <td class="title" valign="top" align="right"><span class="rank">59.</span></td> <td class="votelinks" valign="top"><center><a id="up_28929840" href="https://news.ycombinator.com/vote?id=28929840&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://madned.substack.com/p/a-talk-with-computer-gaming-pioneer" class="titlelink">A talk with Walter Bright about Empire</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=madned.substack.com"><span class="sitestr">madned.substack.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28929840">218 points</span> by <a href="https://news.ycombinator.com/user?id=mad_ned" class="hnuser">mad_ned</a> <span class="age" title="2021-10-20T12:29:16"><a href="https://news.ycombinator.com/item?id=28929840">1 day ago</a></span> <span id="unv_28929840"></span> | <a href="https://news.ycombinator.com/hide?id=28929840&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28929840">86&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28934833">
- <td class="title" valign="top" align="right"><span class="rank">60.</span></td> <td class="votelinks" valign="top"><center><a id="up_28934833" href="https://news.ycombinator.com/vote?id=28934833&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.youtube.com/watch?v=NjrYk546uBA" class="titlelink">Bioelektryczność – Polish Robotics (1968) [video]</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=youtube.com"><span class="sitestr">youtube.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28934833">123 points</span> by <a href="https://news.ycombinator.com/user?id=danielEM" class="hnuser">danielEM</a> <span class="age" title="2021-10-20T19:11:59"><a href="https://news.ycombinator.com/item?id=28934833">19 hours ago</a></span> <span id="unv_28934833"></span> | <a href="https://news.ycombinator.com/hide?id=28934833&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28934833">27&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="morespace" style="height:10px"></tr><tr><td colspan="2"></td><td class="title"><a href="https://news.ycombinator.com/news?p=3" class="morelink" rel="next">More</a></td></tr>
- </tbody></table>
-</td></tr>
-<tr><td><img src="02_files/s.gif" width="0" height="10"><table width="100%" cellspacing="0" cellpadding="1"><tbody><tr><td bgcolor="#ff6600"></td></tr></tbody></table><br><center><span class="yclinks"><a href="https://news.ycombinator.com/newsguidelines.html">Guidelines</a>
- | <a href="https://news.ycombinator.com/newsfaq.html">FAQ</a>
- | <a href="https://news.ycombinator.com/lists">Lists</a>
- | <a href="https://github.com/HackerNews/API">API</a>
- | <a href="https://news.ycombinator.com/security.html">Security</a>
- | <a href="http://www.ycombinator.com/legal/">Legal</a>
- | <a href="http://www.ycombinator.com/apply/">Apply to YC</a>
- | <a href="mailto:hn@ycombinator.com">Contact</a></span><br><br><form method="get" action="//hn.algolia.com/">Search:
- <input type="text" name="q" size="17" autocorrect="off" spellcheck="false" autocapitalize="none" autocomplete="false"></form>
- </center></td></tr>
- </tbody></table></center><script type="text/javascript" src="02_files/hn.js"></script>
-</body></html> \ No newline at end of file
diff --git a/rushs/evalexpr/hacker_news/news.sed b/rushs/evalexpr/hacker_news/news.sed
deleted file mode 100644
index 91b76d6..0000000
--- a/rushs/evalexpr/hacker_news/news.sed
+++ /dev/null
@@ -1 +0,0 @@
-s/^.*"\(https\?:\/\/.*\)" class="titlelink"\( rel="nofollow"\)\?>\([^<]*\).*$/**\3**\n\1\n/p
diff --git a/rushs/evalexpr/hacker_news/output.txt b/rushs/evalexpr/hacker_news/output.txt
deleted file mode 100644
index 68cc714..0000000
--- a/rushs/evalexpr/hacker_news/output.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-**Sinclair Broadcast Group identifies data breach**
-https://apnews.com/article/technology-business-arts-and-entertainment-be48d7582fdd5604664fff33ed81ca80
-
-**A gentle introduction to the FFT (2002)**
-https://www.earlevel.com/main/2002/08/31/a-gentle-introduction-to-the-fft/
-
-**Jon Ingold on translating archeology into video games**
-https://thebrowser.com/notes/jon-ingold/
-
-**Ask HN: How to Sell a Website**
-https://news.ycombinator.com/item?id=28943611
-
-**We analyzed 425k favicons**
-https://iconmap.io/blog
-
-**Machu Picchu was built over major fault zones (2019)**
-https://www.science.org/content/article/machu-picchu-was-built-over-major-fault-zones-now-researchers-think-they-know-why
-
-**Goggles: Democracy dies in darkness, and so does the Web [pdf]**
-https://brave.com/wp-content/uploads/2021/03/goggles.pdf
-
-**Apple M1 Max Geekbench Score**
-https://browser.geekbench.com/v5/cpu/10496766
-
-**U.S. tightens export controls on items used in surveillance of private citizens**
-https://www.commerce.gov/news/press-releases/2021/10/commerce-tightens-export-controls-items-used-surveillance-private
-
-**WeWork is trying to go public – again**
-https://www.wsj.com/articles/wework-set-to-go-public-via-spac-deal-two-years-after-failed-ipo-11634808600
-
-**Playstation 3 Architecture**
-https://www.copetti.org/writings/consoles/playstation-3/
-
-**About that time I had an outburst during the Y Combinator Interview**
-https://owlpal.substack.com/p/about-that-time-i-had-an-outburst
-
-**One Man's Pest**
-https://www.guernicamag.com/one-mans-pest/
-
-**Brave Search replaces Google as default search engine in the Brave browser**
-https://brave.com/search-and-web-discovery/
-
-**I reverse engineered mcdonald's internal API**
-https://twitter.com//rashiq/status/1319346264992026624
-
-**Injury response to DNA damage in live tumor cells promotes antitumor immunity**
-https://www.science.org/doi/10.1126/scisignal.abc4764
-
-**India Counting Down to 1B Doses**
-https://www.cowin.gov.in/
-
-**Time to get worried about Tether, the “stablecoin” at center of cryptocurrency**
-https://slate.com/technology/2021/10/tether-crypto-danger-ben-mckenzie.html
-
-**The History of Surveying**
-https://www.alifewithoutlimits.com.au/the-history-of-surveying/
-
-**The FDA wants you to be able to buy a hearing aid without a prescription**
-https://www.npr.org/2021/10/19/1047303559/fda-hearing-aid-prescription-over-the-counter
-
-**Windows 11 will hobble gaming performance by default on some prebuilt PCs**
-https://www.pcgamer.com/windows-11-pcs-can-hobble-gaming-performance/
-
-**Development version: GIMP 2.99.8 Released**
-https://www.gimp.org/news/2021/10/20/gimp-2-99-8-released/
-
-**I couldn't debug the code because of my name**
-https://mikolaj-kaminski.com/jetbrains-rider-docker-compose-unicodedecodeerror-issue-fix/
-
-**Getting the best out of OpenSCAD**
-https://calbryant.uk/blog/10-ways-to-get-the-best-out-of-openscad/
-
-**Study: Recycled Lithium Batteries as Good as Newly Mined**
-https://spectrum.ieee.org/recycled-batteries-good-as-newly-mined
-
-**Eliminating gifted programs won’t make education fair**
-https://americasfuture.org/eliminating-gifted-programs-wont-make-education-fair/
-
-**Gtk4 Tutorial**
-https://github.com/ToshioCP/Gtk4-tutorial/blob/main/Readme.md
-
-**Cosmopolitan Identifiers**
-https://obua.com/publications/cosmo-id/3/
-
-**A talk with Walter Bright about Empire**
-https://madned.substack.com/p/a-talk-with-computer-gaming-pioneer
-
-**Bioelektryczność – Polish Robotics (1968) [video]**
-https://www.youtube.com/watch?v=NjrYk546uBA
-
diff --git a/rushs/evalexpr/handling_complex/complex.c b/rushs/evalexpr/handling_complex/complex.c
deleted file mode 100644
index 79a10be..0000000
--- a/rushs/evalexpr/handling_complex/complex.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "complex.h"
-
-#include <stdio.h>
-
-void print_complex(struct complex a)
-{
- printf("complex(%.2f ", a.real);
-
- if (a.img < 0)
- {
- printf("- %.2fi", -a.img);
- }
- else
- {
- printf("+ %.2fi", a.img);
- }
- printf(")\n");
-}
-
-struct complex neg_complex(struct complex a)
-{
- struct complex z = { -a.real, -a.img };
- return z;
-}
-
-struct complex add_complex(struct complex a, struct complex b)
-{
- struct complex z = { a.real + b.real, a.img + b.img };
- return z;
-}
-
-struct complex sub_complex(struct complex a, struct complex b)
-{
- return add_complex(a, neg_complex(b));
-}
-
-struct complex mul_complex(struct complex a, struct complex b)
-{
- struct complex z = { a.real * b.real - a.img * b.img,
- a.real * b.img + a.img * b.real };
- return z;
-}
-
-struct complex div_complex(struct complex a, struct complex b)
-{
- struct complex z = {
- (a.real * b.real + a.img * b.img) / (b.real * b.real + b.img * b.img),
- (a.img * b.real - a.real * b.img) / (b.real * b.real + b.img * b.img)
- };
- return z;
-}
diff --git a/rushs/evalexpr/handling_complex/complex.h b/rushs/evalexpr/handling_complex/complex.h
deleted file mode 100644
index c562810..0000000
--- a/rushs/evalexpr/handling_complex/complex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef COMPLEX_H
-#define COMPLEX_H
-
-struct complex
-{
- float real;
- float img;
-};
-
-// Print
-void print_complex(struct complex a);
-
-// Operations
-struct complex neg_complex(struct complex a);
-struct complex add_complex(struct complex a, struct complex b);
-struct complex sub_complex(struct complex a, struct complex b);
-struct complex mul_complex(struct complex a, struct complex b);
-struct complex div_complex(struct complex a, struct complex b);
-
-#endif /* !COMPLEX_H */
diff --git a/rushs/evalexpr/hanoi/hanoi.c b/rushs/evalexpr/hanoi/hanoi.c
deleted file mode 100644
index 6ac2b71..0000000
--- a/rushs/evalexpr/hanoi/hanoi.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <stdio.h>
-
-void move(unsigned src, unsigned spare, unsigned dst, unsigned n)
-{
- if (n == 0)
- {
- return;
- }
-
- move(src, dst, spare, n - 1);
-
- printf("%u->%u\n", src, dst);
-
- move(spare, src, dst, n - 1);
-}
-
-void hanoi(unsigned n)
-{
- if (n == 0)
- {
- return;
- }
-
- move(1, 2, 3, n);
-}
-
-int main(void)
-{
- hanoi(3);
- return 0;
-}
diff --git a/rushs/evalexpr/hash_map/hash.c b/rushs/evalexpr/hash_map/hash.c
deleted file mode 100644
index 434616f..0000000
--- a/rushs/evalexpr/hash_map/hash.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stddef.h>
-
-size_t hash(const char *key)
-{
- size_t i = 0;
- size_t hash = 0;
-
- for (i = 0; key[i] != '\0'; ++i)
- hash += key[i];
- hash += i;
-
- return hash;
-}
diff --git a/rushs/evalexpr/hash_map/hash_map.c b/rushs/evalexpr/hash_map/hash_map.c
deleted file mode 100644
index 4690e8b..0000000
--- a/rushs/evalexpr/hash_map/hash_map.c
+++ /dev/null
@@ -1,177 +0,0 @@
-#include "hash_map.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-struct hash_map *hash_map_init(size_t size)
-{
- struct hash_map *new;
- if ((new = malloc(sizeof(struct hash_map))) == NULL)
- {
- return NULL;
- }
- if ((new->data = malloc(size * sizeof(struct pair_list *))) == NULL)
- {
- return NULL;
- }
- new->size = size;
-
- for (size_t i = 0; i < size; i++)
- {
- new->data[i] = NULL;
- }
-
- return new;
-}
-
-bool hash_map_insert(struct hash_map *hash_map, const char *key, char *value,
- bool *updated)
-{
- if (hash_map == NULL || updated == NULL || hash_map->size == 0)
- {
- return false;
- }
- *updated = false;
-
- size_t h = hash(key);
- if (h >= hash_map->size)
- {
- h %= hash_map->size;
- }
-
- struct pair_list *new = malloc(sizeof(struct pair_list));
- if (new == NULL)
- {
- return false;
- }
-
- for (struct pair_list *p = hash_map->data[h]; p; p = p->next)
- {
- if (strcmp(p->key, key) == 0)
- {
- p->value = value;
- *updated = true;
- free(new);
- return true;
- }
- }
-
- new->next = hash_map->data[h];
- new->key = key;
- new->value = value;
- hash_map->data[h] = new;
- return true;
-}
-
-void hash_map_free(struct hash_map *hash_map)
-{
- if (hash_map == NULL)
- {
- return;
- }
-
- if (hash_map->data == NULL)
- {
- free(hash_map);
- return;
- }
-
- for (size_t i = 0; i < hash_map->size; i++)
- {
- while (hash_map->data[i])
- {
- struct pair_list *tmp = hash_map->data[i]->next;
- free(hash_map->data[i]);
- hash_map->data[i] = tmp;
- }
- }
-
- free(hash_map->data);
- free(hash_map);
-}
-
-void hash_map_dump(struct hash_map *hash_map)
-{
- if (hash_map == NULL || hash_map->data == NULL)
- {
- return;
- }
-
- for (size_t i = 0; i < hash_map->size; i++)
- {
- if (hash_map->data[i] != NULL)
- {
- printf("%s: %s", hash_map->data[i]->key, hash_map->data[i]->value);
- for (struct pair_list *p = hash_map->data[i]->next; p; p = p->next)
- {
- printf(", %s: %s", p->key, p->value);
- }
- printf("\n");
- }
- }
-}
-
-const char *hash_map_get(const struct hash_map *hash_map, const char *key)
-{
- if (hash_map == NULL || hash_map->data == NULL || hash_map->size == 0)
- {
- return NULL;
- }
-
- size_t h = hash(key);
- if (h >= hash_map->size)
- {
- h %= hash_map->size;
- }
- struct pair_list *p;
- for (p = hash_map->data[h]; p && strcmp(p->key, key) != 0; p = p->next)
- {
- continue;
- }
-
- if (p)
- {
- return p->value;
- }
- return NULL;
-}
-
-bool hash_map_remove(struct hash_map *hash_map, const char *key)
-{
- if (hash_map == NULL || hash_map->data == NULL || hash_map->size == 0)
- {
- return false;
- }
-
- size_t h = hash(key);
- if (h >= hash_map->size)
- {
- h %= hash_map->size;
- }
- if (hash_map->data[h] == NULL)
- {
- return false;
- }
-
- if (strcmp(hash_map->data[h]->key, key) == 0)
- {
- struct pair_list *tmp = hash_map->data[h]->next;
- free(hash_map->data[h]);
- hash_map->data[h] = tmp;
- return true;
- }
-
- struct pair_list *p;
- for (p = hash_map->data[h]; p->next; p = p->next)
- {
- if (strcmp(p->next->key, key) == 0)
- {
- struct pair_list *tmp = p->next->next;
- free(p->next);
- p->next = tmp;
- return true;
- }
- }
- return false;
-}
diff --git a/rushs/evalexpr/hash_map/hash_map.h b/rushs/evalexpr/hash_map/hash_map.h
deleted file mode 100644
index c731eab..0000000
--- a/rushs/evalexpr/hash_map/hash_map.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef HASH_MAP_H
-#define HASH_MAP_H
-
-#include <stdbool.h>
-#include <stddef.h>
-
-struct pair_list
-{
- const char *key;
- char *value;
- struct pair_list *next;
-};
-
-struct hash_map
-{
- struct pair_list **data;
- size_t size;
-};
-
-size_t hash(const char *str);
-struct hash_map *hash_map_init(size_t size);
-bool hash_map_insert(struct hash_map *hash_map, const char *key, char *value,
- bool *updated);
-void hash_map_free(struct hash_map *hash_map);
-void hash_map_dump(struct hash_map *hash_map);
-const char *hash_map_get(const struct hash_map *hash_map, const char *key);
-bool hash_map_remove(struct hash_map *hash_map, const char *key);
-
-#endif /* ! HASH_MAP_H */
diff --git a/rushs/evalexpr/heap/Makefile b/rushs/evalexpr/heap/Makefile
deleted file mode 100644
index 2ed972b..0000000
--- a/rushs/evalexpr/heap/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-CC = gcc
-CFLAGS = -Wall -Werror -Wvla -Wextra -std=c99 -pedantic
-SRC = add.c del.c print.c pop.c create.c
-OBJ = $(SRC:.c=.o)
-
-.PHONY: library clean
-
-library: $(OBJ)
- ar csr libheap.a $(OBJ)
-
-$(OBJ): $(SRC)
-
-clean:
- $(RM) libheap.a $(OBJ)
diff --git a/rushs/evalexpr/heap/add.c b/rushs/evalexpr/heap/add.c
deleted file mode 100644
index 78a4db8..0000000
--- a/rushs/evalexpr/heap/add.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdlib.h>
-
-#include "heap.h"
-
-void heapify(int arr[], int n, int i)
-{
- if (i == 0)
- return;
- int parent = (i - 1) / 2;
- if (parent >= 0)
- {
- if (arr[i] > arr[parent])
- {
- int tmp = arr[i];
- arr[i] = arr[parent];
- arr[parent] = tmp;
- heapify(arr, n, parent);
- }
- }
-}
-
-void add(struct heap *heap, int val)
-{
- if (heap->size == heap->capacity)
- {
- heap->array = realloc(heap->array, heap->capacity * 2 * sizeof(int));
- if (heap->array == NULL)
- {
- free(heap);
- return;
- }
- heap->capacity *= 2;
- }
-
- heap->array[heap->size] = val;
- heap->size++;
-
- heapify(heap->array, heap->size, heap->size - 1);
-}
diff --git a/rushs/evalexpr/heap/create.c b/rushs/evalexpr/heap/create.c
deleted file mode 100644
index f0675ad..0000000
--- a/rushs/evalexpr/heap/create.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdlib.h>
-
-#include "heap.h"
-
-struct heap *create_heap(void)
-{
- struct heap *res = malloc(sizeof(struct heap));
- if (res == NULL)
- return NULL;
- res->size = 0;
- res->capacity = 8;
- res->array = malloc(8 * sizeof(int));
- if (res->array == NULL)
- {
- free(res);
- return NULL;
- }
- return res;
-}
diff --git a/rushs/evalexpr/heap/del.c b/rushs/evalexpr/heap/del.c
deleted file mode 100644
index 4d2ae35..0000000
--- a/rushs/evalexpr/heap/del.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <stdlib.h>
-
-#include "heap.h"
-
-void delete_heap(struct heap *heap)
-{
- free(heap->array);
- free(heap);
-}
diff --git a/rushs/evalexpr/heap/heap.h b/rushs/evalexpr/heap/heap.h
deleted file mode 100644
index 085f436..0000000
--- a/rushs/evalexpr/heap/heap.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef HEAP_H
-#define HEAP_H
-
-// size_t
-#include <stddef.h>
-
-struct heap
-{
- size_t size;
- size_t capacity;
- int *array;
-};
-
-struct heap *create_heap(void);
-void add(struct heap *heap, int val);
-int pop(struct heap *heap);
-void delete_heap(struct heap *heap);
-void print_heap(const struct heap *heap);
-
-#endif /* !HEAP_H */
diff --git a/rushs/evalexpr/heap/pop.c b/rushs/evalexpr/heap/pop.c
deleted file mode 100644
index 55e063f..0000000
--- a/rushs/evalexpr/heap/pop.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <assert.h>
-#include <stdlib.h>
-
-#include "heap.h"
-
-void heapify2(struct heap *h, size_t i)
-{
- size_t max = i;
- if (2 * i + 1 < h->size && h->array[2 * i + 1] > h->array[max])
- max = 2 * i + 1;
- if (2 * i + 2 < h->size && h->array[2 * i + 2] > h->array[max])
- max = 2 * i + 2;
- if (max != i)
- {
- int tmp = h->array[i];
- h->array[i] = h->array[max];
- h->array[max] = tmp;
- heapify2(h, max);
- }
-}
-
-int pop(struct heap *heap)
-{
- assert(heap->size != 0);
- if (heap->size == 1)
- {
- heap->size--;
- return heap->array[0];
- }
- else
- {
- int res = heap->array[0];
- heap->array[0] = heap->array[heap->size - 1];
- heap->size--;
- heapify2(heap, 0);
- if (heap->size < heap->capacity / 2 && heap->capacity > 8)
- {
- heap->array =
- realloc(heap->array, (heap->capacity / 2) * sizeof(int));
- if (heap->array == NULL)
- {
- free(heap);
- return -1;
- }
- heap->capacity /= 2;
- }
- return res;
- }
-}
diff --git a/rushs/evalexpr/heap/print.c b/rushs/evalexpr/heap/print.c
deleted file mode 100644
index f5bbe95..0000000
--- a/rushs/evalexpr/heap/print.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "heap.h"
-
-void print_rec(const struct heap *h, size_t i, int root)
-{
- if (i >= h->size)
- return;
- if (!root)
- printf(" ");
- else
- root = 0;
- printf("%d", h->array[i]);
- if (i == h->size - 1)
- {
- return;
- }
- print_rec(h, i * 2 + 1, root);
- print_rec(h, i * 2 + 2, root);
-}
-
-void print_heap(const struct heap *heap)
-{
- print_rec(heap, 0, 1);
- printf("\n");
-}
diff --git a/rushs/evalexpr/hello_friends/hello.c b/rushs/evalexpr/hello_friends/hello.c
deleted file mode 100644
index 63df2f1..0000000
--- a/rushs/evalexpr/hello_friends/hello.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdio.h>
-
-int main(int argc, char **argv)
-{
- if (argc == 1)
- printf("Hello World!\n");
- else
- for (int i = 1; i < argc; i++)
- {
- printf("Hello %s!\n", argv[i]);
- }
- return 0;
-}
diff --git a/rushs/evalexpr/hello_world/hello.c b/rushs/evalexpr/hello_world/hello.c
deleted file mode 100644
index 0681c18..0000000
--- a/rushs/evalexpr/hello_world/hello.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int main(void)
-{
- puts("Hello World!");
- return 0;
-}
diff --git a/rushs/evalexpr/hello_world_shebang/hello.sh b/rushs/evalexpr/hello_world_shebang/hello.sh
deleted file mode 100755
index 8dc4f64..0000000
--- a/rushs/evalexpr/hello_world_shebang/hello.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "Hello World!"
diff --git a/rushs/evalexpr/hill_array/hill_array.c b/rushs/evalexpr/hill_array/hill_array.c
deleted file mode 100644
index 14d3a85..0000000
--- a/rushs/evalexpr/hill_array/hill_array.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "hill_array.h"
-
-int top_of_the_hill(int tab[], size_t len)
-{
- if (len == 0)
- {
- return -1;
- }
-
- int top = 0;
- size_t i = 0;
-
- while (i + 1 < len && tab[i] <= tab[i + 1])
- {
- if (tab[i] < 0 || tab[i + 1] < 0)
- {
- return -1;
- }
- if (tab[i] != tab[i + 1])
- {
- top = i + 1;
- }
- i++;
- }
-
- while (i + 1 < len && tab[i] >= tab[i + 1])
- {
- if (tab[i] < 0 || tab[i + 1] < 0)
- {
- return -1;
- }
- i++;
- }
-
- if (i + 1 == len)
- {
- return top;
- }
- else
- {
- return -1;
- }
-}
diff --git a/rushs/evalexpr/hill_array/hill_array.h b/rushs/evalexpr/hill_array/hill_array.h
deleted file mode 100644
index 3152c19..0000000
--- a/rushs/evalexpr/hill_array/hill_array.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef HILL_ARRAY_H
-#define HILL_ARRAY_H
-
-#include <stddef.h>
-
-int top_of_the_hill(int tab[], size_t len);
-
-#endif /* !HILL_ARRAY_H */
diff --git a/rushs/evalexpr/insertion_sort/insertion_sort.c b/rushs/evalexpr/insertion_sort/insertion_sort.c
deleted file mode 100644
index 2edd195..0000000
--- a/rushs/evalexpr/insertion_sort/insertion_sort.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "insertion_sort.h"
-
-#include <stddef.h>
-
-void insertion_sort(void **array, f_cmp comp)
-{
- if (array == NULL || *array == NULL)
- {
- return;
- }
- for (int i = 1; array[i]; i++)
- {
- for (int j = i; j > 0 && comp(array[j - 1], array[j]) > 0; j--)
- {
- void *tmp = array[j];
- array[j] = array[j - 1];
- array[j - 1] = tmp;
- }
- }
-}
diff --git a/rushs/evalexpr/insertion_sort/insertion_sort.h b/rushs/evalexpr/insertion_sort/insertion_sort.h
deleted file mode 100644
index a7ba674..0000000
--- a/rushs/evalexpr/insertion_sort/insertion_sort.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef INSERTION_SORT_H
-#define INSERTION_SORT_H
-
-typedef int (*f_cmp)(const void *, const void *);
-
-void insertion_sort(void **array, f_cmp comp);
-
-#endif /* ! INSERTION_SORT_H */
diff --git a/rushs/evalexpr/inside/inside.sh b/rushs/evalexpr/inside/inside.sh
deleted file mode 100755
index c6872fa..0000000
--- a/rushs/evalexpr/inside/inside.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-if [ $# -ne 1 ]; then
- echo Sorry, expected 1 argument but $# were passed
- exit 1
-fi
-
-if [ -f $1 ]; then
- cat $1
- exit 0
-else
- echo "$1:
- is not a valid file"
- exit 2
-fi
diff --git a/rushs/evalexpr/inside_noif/inside_noif.sh b/rushs/evalexpr/inside_noif/inside_noif.sh
deleted file mode 100755
index d4ed8c9..0000000
--- a/rushs/evalexpr/inside_noif/inside_noif.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 1 ] && echo Sorry, expected 1 argument but $# were passed && exit 1
-
-[ -f $1 ] && cat $1 && exit 0 || echo "$1:
- is not a valid file" && exit 2
diff --git a/rushs/evalexpr/int_palindrome/int_palindrome.c b/rushs/evalexpr/int_palindrome/int_palindrome.c
deleted file mode 100644
index 6d6847f..0000000
--- a/rushs/evalexpr/int_palindrome/int_palindrome.c
+++ /dev/null
@@ -1,18 +0,0 @@
-int int_palindrome(int n)
-{
- if (n < 0)
- {
- return 0;
- }
-
- int reversed = 0;
- int m = n;
-
- while (m > 0)
- {
- reversed = reversed * 10 + m % 10;
- m /= 10;
- }
-
- return n == reversed;
-}
diff --git a/rushs/evalexpr/int_sqrt/int_sqrt.c b/rushs/evalexpr/int_sqrt/int_sqrt.c
deleted file mode 100644
index 4b2e5db..0000000
--- a/rushs/evalexpr/int_sqrt/int_sqrt.c
+++ /dev/null
@@ -1,20 +0,0 @@
-int int_sqrt(int n)
-{
- if (n < 0)
- {
- return -1;
- }
-
- if (n == 0 || n == 1)
- {
- return n;
- }
-
- int i;
- for (i = 1; i * i < n; i++)
- {
- continue;
- }
-
- return i - (i * i != n);
-}
diff --git a/rushs/evalexpr/io_count_words/count_words.c b/rushs/evalexpr/io_count_words/count_words.c
deleted file mode 100644
index 8b8c9a5..0000000
--- a/rushs/evalexpr/io_count_words/count_words.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <stdio.h>
-
-int count_words(const char *file_in)
-{
- if (file_in == NULL)
- {
- return -1;
- }
-
- FILE *f = fopen(file_in, "r");
- if (f == NULL)
- {
- return -1;
- }
-
- int word = 0;
- int count = 0;
- int c;
- while ((c = fgetc(f)) != EOF)
- {
- if ((c == ' ' || c == '\n' || c == '\t') && word == 1)
- {
- word = 0;
- }
- if (c != ' ' && c != '\n' && c != '\t' && word == 0)
- {
- word = 1;
- count++;
- }
- }
-
- return count;
-}
diff --git a/rushs/evalexpr/io_merge_files/merge_files.c b/rushs/evalexpr/io_merge_files/merge_files.c
deleted file mode 100644
index 26ac9cf..0000000
--- a/rushs/evalexpr/io_merge_files/merge_files.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#define _POSIX_C_SOURCE 200809L
-
-#include <stdio.h>
-
-int merge_files(const char *file_1, const char *file_2)
-{
- FILE *a = fopen(file_1, "a");
- if (a == NULL)
- {
- return -1;
- }
- FILE *r = fopen(file_2, "r");
- if (r == NULL)
- {
- return -1;
- }
-
- int c;
- while ((c = fgetc(r)) != EOF)
- {
- if (fputc(c, a) == EOF)
- {
- return -1;
- }
- }
-
- fclose(a);
- fclose(r);
-
- return 0;
-}
diff --git a/rushs/evalexpr/io_replace_line/replace_line.c b/rushs/evalexpr/io_replace_line/replace_line.c
deleted file mode 100644
index 7fd0e2a..0000000
--- a/rushs/evalexpr/io_replace_line/replace_line.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#define _POSIX_C_SOURCE 200809L
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int replace_line(const char *file_in, const char *file_out, const char *content,
- int n)
-{
- FILE *a = fopen(file_out, "w");
- if (a == NULL)
- {
- return -1;
- }
- FILE *r = fopen(file_in, "r");
- if (r == NULL)
- {
- return -1;
- }
-
- char *buf = NULL;
- ssize_t e;
- int l = 0;
- size_t count = 0;
- while ((e = getline(&buf, &count, r)) != 0 && e != -1)
- {
- if (l == n)
- {
- if (fputs(content, a) == EOF)
- {
- free(buf);
- return -1;
- }
- }
- else
- {
- if (fputs(buf, a) == EOF)
- {
- free(buf);
- return -1;
- }
- }
- l++;
- }
-
- fclose(a);
- fclose(r);
- free(buf);
-
- return 0;
-}
diff --git a/rushs/evalexpr/levenshtein/levenshtein.c b/rushs/evalexpr/levenshtein/levenshtein.c
deleted file mode 100644
index 4da9397..0000000
--- a/rushs/evalexpr/levenshtein/levenshtein.c
+++ /dev/null
@@ -1,72 +0,0 @@
-#include "levenshtein.h"
-
-#include <stdio.h>
-
-size_t max(size_t a, size_t b)
-{
- if (a >= b)
- {
- return a;
- }
- return b;
-}
-
-size_t min(size_t a, size_t b)
-{
- if (a <= b)
- {
- return a;
- }
- return b;
-}
-
-size_t min_3(size_t a, size_t b, size_t c)
-{
- if (a <= b)
- {
- if (a <= c)
- {
- return a;
- }
- return c;
- }
- else
- {
- if (b <= c)
- {
- return b;
- }
- return c;
- }
-}
-
-size_t my_strlen(const char *s)
-{
- size_t i;
- for (i = 0; s[i]; i++)
- {
- continue;
- }
- return i;
-}
-
-size_t levenshtein(const char *s1, const char *s2)
-{
- size_t l1 = my_strlen(s1);
- size_t l2 = my_strlen(s2);
- if (min(l1, l2) == 0)
- {
- return max(l1, l2);
- }
-
- if (s1[0] == s2[0])
- {
- return levenshtein(s1 + 1, s2 + 1);
- }
-
- size_t lev1 = levenshtein(s1 + 1, s2);
- size_t lev2 = levenshtein(s1, s2 + 1);
- size_t lev3 = levenshtein(s1 + 1, s2 + 1);
-
- return 1 + min_3(lev1, lev2, lev3);
-}
diff --git a/rushs/evalexpr/levenshtein/levenshtein.h b/rushs/evalexpr/levenshtein/levenshtein.h
deleted file mode 100644
index 70a5a7b..0000000
--- a/rushs/evalexpr/levenshtein/levenshtein.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef LEVENSHTEIN_H
-#define LEVENSHTEIN_H
-
-#include <stddef.h>
-
-size_t levenshtein(const char *s1, const char *s2);
-
-#endif /* !LEVENSHTEIN_H */
diff --git a/rushs/evalexpr/main.c b/rushs/evalexpr/main.c
deleted file mode 100644
index 4062426..0000000
--- a/rushs/evalexpr/main.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-//#include "traffic_lights/traffic_lights.h"
-unsigned char rol(unsigned char value, unsigned char roll);
-
-int main(void)
-{
- unsigned char l1 = 0b01010101;
- unsigned char l2 = 3;
-
- printf("l1: %b", rol(l1, l2));
-
- return 0;
-}
diff --git a/rushs/evalexpr/my_abs/my_abs.c b/rushs/evalexpr/my_abs/my_abs.c
deleted file mode 100644
index fc89d2f..0000000
--- a/rushs/evalexpr/my_abs/my_abs.c
+++ /dev/null
@@ -1,11 +0,0 @@
-int my_abs(int n)
-{
- if (n < 0)
- {
- return -n;
- }
- else
- {
- return n;
- }
-}
diff --git a/rushs/evalexpr/my_atoi/my_atoi.c b/rushs/evalexpr/my_atoi/my_atoi.c
deleted file mode 100644
index ca185a5..0000000
--- a/rushs/evalexpr/my_atoi/my_atoi.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include "my_atoi.h"
-
-int my_atoi(const char *str)
-{
- int res = 0;
-
- // str error check
- if (str == NULL || *str == '0')
- {
- return 0;
- }
-
- // trim whitespaces
- for (; *str && *str == ' '; str++)
- {
- continue;
- }
-
- // move to end of str
- size_t l;
- for (l = 0; str[l]; l++)
- {
- continue;
- }
- l--;
-
- // prepare for calculations
- int factor = 1;
-
- // actual conversion of up to the second element of str (potential sign)
- for (; l > 0; l--)
- {
- char val = str[l];
- if (val < '0' || val > '9')
- {
- return 0;
- }
- val -= '0';
- res += val * factor;
-
- factor *= 10;
- }
-
- // l should be 0 by now
- if (str[l] == '-')
- {
- return -res;
- }
- else if (str[l] != '+')
- {
- int val = str[l];
- if (val < '0' || val > '9')
- {
- return 0;
- }
- val -= '0';
- return res + val * factor;
- }
-
- return res;
-}
diff --git a/rushs/evalexpr/my_atoi/my_atoi.h b/rushs/evalexpr/my_atoi/my_atoi.h
deleted file mode 100644
index b520d09..0000000
--- a/rushs/evalexpr/my_atoi/my_atoi.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_ATOI_H
-#define MY_ATOI_H
-
-#include <stddef.h>
-
-int my_atoi(const char *str);
-
-#endif /* ! MY_ATOI_H */
diff --git a/rushs/evalexpr/my_atoi_base/my_atoi_base.c b/rushs/evalexpr/my_atoi_base/my_atoi_base.c
deleted file mode 100644
index 46b4560..0000000
--- a/rushs/evalexpr/my_atoi_base/my_atoi_base.c
+++ /dev/null
@@ -1,86 +0,0 @@
-#include "my_atoi_base.h"
-
-int val_in_base(char c, const char *base)
-{
- size_t i;
- for (i = 0; base[i] && base[i] != c; i++)
- {
- continue;
- }
-
- if (base[i])
- {
- return i;
- }
-
- return -1;
-}
-
-int base_size(const char *base)
-{
- int res;
- for (res = 0; base[res]; res++)
- {
- continue;
- }
- return res;
-}
-
-int my_atoi_base(const char *str, const char *base)
-{
- int res = 0;
-
- // str error check
- if (str == NULL || *str == '0')
- {
- return 0;
- }
-
- // trim whitespaces
- for (; *str && *str == ' '; str++)
- {
- continue;
- }
-
- // move to end of str
- size_t l;
- for (l = 0; str[l]; l++)
- {
- continue;
- }
- l--;
-
- // prepare for calculations
- int b = base_size(base);
- int factor = 1;
-
- // actual conversion of up to the second element of str (potential sign)
- for (; l > 0; l--)
- {
- int val = val_in_base(str[l], base);
- if (val == -1)
- {
- return 0;
- }
- res += val * factor;
-
- factor *= b;
- }
-
- // l should be 0 by now
- if (str[l] == '-')
- {
- return -res;
- }
- else if (str[l] != '+')
- {
- int val = val_in_base(str[l], base);
- if (val == -1)
- {
- return 0;
- }
- return res + val * factor;
- }
-
- return res;
-}
diff --git a/rushs/evalexpr/my_atoi_base/my_atoi_base.h b/rushs/evalexpr/my_atoi_base/my_atoi_base.h
deleted file mode 100644
index 296ae23..0000000
--- a/rushs/evalexpr/my_atoi_base/my_atoi_base.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_ATOI_BASE_H
-#define MY_ATOI_BASE_H
-
-#include <stddef.h>
-
-int my_atoi_base(const char *str, const char *base);
-
-#endif /* ! MY_ATOI_BASE_H */
diff --git a/rushs/evalexpr/my_bc/my_bc.sh b/rushs/evalexpr/my_bc/my_bc.sh
deleted file mode 100755
index f675838..0000000
--- a/rushs/evalexpr/my_bc/my_bc.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-[ -n "$1" ] && echo "$(($1))" && exit 0
-
-while IFS='' read -r line; do
- [ -z "$line" ] && exit 0 || echo "$(($line))"
-done
diff --git a/rushs/evalexpr/my_c_tail/main.c b/rushs/evalexpr/my_c_tail/main.c
deleted file mode 100644
index ba33337..0000000
--- a/rushs/evalexpr/my_c_tail/main.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdlib.h>
-
-#include "my_c_tail.h"
-
-int main(int argc, char *argv[])
-{
- if (argc > 1)
- stdintail(atoi(argv[1]));
- return 0;
-}
diff --git a/rushs/evalexpr/my_c_tail/my_c_tail.c b/rushs/evalexpr/my_c_tail/my_c_tail.c
deleted file mode 100644
index 790240c..0000000
--- a/rushs/evalexpr/my_c_tail/my_c_tail.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "my_c_tail.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-
-void stdintail(unsigned int n)
-{
- char **lines = calloc(2000, sizeof(char *));
- lines[0] = malloc(350 * sizeof(char));
- size_t m = 0;
- char c;
- size_t i = 0;
- while (read(STDIN_FILENO, &c, 1))
- {
- if (c == '\n')
- {
- lines[m][i] = '\0';
- lines[++m] = malloc(350 * sizeof(char));
- i = 0;
- }
- else
- {
- lines[m][i++] = c;
- }
- }
-
- size_t j;
- if (m > n)
- {
- for (size_t i = 0; i < m - n; i++)
- free(lines[i]);
- j = m - n;
- }
- else
- j = 0;
-
- for (; j < m; j++)
- {
- for (size_t i = 0; lines[j][i]; i++)
- write(STDOUT_FILENO, &(lines[j][i]), 1);
- write(STDOUT_FILENO, "\n", 1);
- free(lines[j]);
- }
- free(lines[m]);
- free(lines);
-}
diff --git a/rushs/evalexpr/my_c_tail/my_c_tail.h b/rushs/evalexpr/my_c_tail/my_c_tail.h
deleted file mode 100644
index 172c844..0000000
--- a/rushs/evalexpr/my_c_tail/my_c_tail.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_C_TAIL_H
-#define MY_C_TAIL_H
-
-void stdintail(unsigned int n);
-
-#endif // MY_C_TAIL_H
diff --git a/rushs/evalexpr/my_calloc/my_calloc.c b/rushs/evalexpr/my_calloc/my_calloc.c
deleted file mode 100644
index 5a2f7f2..0000000
--- a/rushs/evalexpr/my_calloc/my_calloc.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdlib.h>
-
-void *my_calloc(size_t n, size_t size)
-{
- char *res = malloc(n * size);
- for (size_t i = 0; i < n * size; i++)
- {
- res[i] = 0;
- }
- return res;
-}
diff --git a/rushs/evalexpr/my_calloc/my_calloc.h b/rushs/evalexpr/my_calloc/my_calloc.h
deleted file mode 100644
index 44bf9a2..0000000
--- a/rushs/evalexpr/my_calloc/my_calloc.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_CALLOC_H
-#define MY_CALLOC_H
-
-#include <stdlib.h>
-
-void *my_calloc(size_t n, size_t size);
-
-#endif /* ! MY_CALLOC_H */
diff --git a/rushs/evalexpr/my_file/my_file.sh b/rushs/evalexpr/my_file/my_file.sh
deleted file mode 100755
index 93c0c20..0000000
--- a/rushs/evalexpr/my_file/my_file.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-for arg; do
- if [ -f "$arg" ]; then
- echo $arg: file
- elif [ -d "$arg" ]; then
- echo $arg: directory
- else
- echo $arg: unknown
- fi
-done
diff --git a/rushs/evalexpr/my_first_variable/create.sh b/rushs/evalexpr/my_first_variable/create.sh
deleted file mode 100755
index d9264db..0000000
--- a/rushs/evalexpr/my_first_variable/create.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-my_local_frais="Javotte"
-
-echo My frais is $my_local_frais
diff --git a/rushs/evalexpr/my_first_variable/edit.sh b/rushs/evalexpr/my_first_variable/edit.sh
deleted file mode 100755
index e47e0c3..0000000
--- a/rushs/evalexpr/my_first_variable/edit.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-my_local_frais="Javotte"
-
-echo My frais is $my_local_frais
-
-my_local_frais="Pulpa"
-
-echo My frais is now $my_local_frais
diff --git a/rushs/evalexpr/my_first_variable/use.sh b/rushs/evalexpr/my_first_variable/use.sh
deleted file mode 100755
index f9d462e..0000000
--- a/rushs/evalexpr/my_first_variable/use.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "My frais is $MY_ENV_FRAIS"
diff --git a/rushs/evalexpr/my_itoa/my_itoa.c b/rushs/evalexpr/my_itoa/my_itoa.c
deleted file mode 100644
index cbb6f73..0000000
--- a/rushs/evalexpr/my_itoa/my_itoa.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "my_itoa.h"
-
-char *my_itoa(int value, char *s)
-{
- if (value == 0)
- {
- s[0] = '0';
- s[1] = '\0';
- return s;
- }
- char *head = s;
- if (value < 0)
- {
- s[0] = '-';
- s++;
- value = -value;
- }
-
- // count numbers
- int t = value;
- int n = 0;
- while (t > 0)
- {
- t /= 10;
- n++;
- }
-
- // n = number count
- s[n] = '\0';
- n--;
- for (; n >= 0; n--)
- {
- s[n] = value % 10 + '0';
- value /= 10;
- }
-
- return head;
-}
diff --git a/rushs/evalexpr/my_itoa/my_itoa.h b/rushs/evalexpr/my_itoa/my_itoa.h
deleted file mode 100644
index 8e84c72..0000000
--- a/rushs/evalexpr/my_itoa/my_itoa.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_ITOA_H
-#define MY_ITOA_H
-
-char *my_itoa(int value, char *s);
-
-#endif /* ! MY_ITOA_H */
diff --git a/rushs/evalexpr/my_itoa_base/my_itoa_base.c b/rushs/evalexpr/my_itoa_base/my_itoa_base.c
deleted file mode 100644
index 29b3042..0000000
--- a/rushs/evalexpr/my_itoa_base/my_itoa_base.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "my_itoa_base.h"
-
-int base_count(const char *base)
-{
- int i;
- for (i = 0; base[i]; i++)
- {
- continue;
- }
- return i;
-}
-
-char *my_itoa_base(int n, char *s, const char *base)
-{
- if (n == 0)
- {
- s[0] = base[0];
- s[1] = '\0';
- return s;
- }
- char *head = s;
- if (n < 0)
- {
- s[0] = '-';
- s++;
- n = -n;
- }
-
- // count numbers
- int t = n;
- int m = 0;
- int b = base_count(base);
- while (t > 0)
- {
- t /= b;
- m++;
- }
-
- // n = number count
- s[m] = '\0';
- m--;
- for (; m >= 0; m--)
- {
- s[m] = base[n % b];
- n /= b;
- }
-
- return head;
-}
diff --git a/rushs/evalexpr/my_itoa_base/my_itoa_base.h b/rushs/evalexpr/my_itoa_base/my_itoa_base.h
deleted file mode 100644
index 0be6314..0000000
--- a/rushs/evalexpr/my_itoa_base/my_itoa_base.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_ITOA_BASE_H
-#define MY_ITOA_BASE_H
-
-char *my_itoa_base(int n, char *s, const char *base);
-
-#endif /* ! MY_ITOA_BASE_H */
diff --git a/rushs/evalexpr/my_memcmp/my_memcmp.c b/rushs/evalexpr/my_memcmp/my_memcmp.c
deleted file mode 100644
index d498360..0000000
--- a/rushs/evalexpr/my_memcmp/my_memcmp.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "my_memcmp.h"
-
-int my_memcmp(const void *s1, const void *s2, size_t num)
-{
- if (num == 0)
- {
- return 0;
- }
- const unsigned char *a = s1;
- const unsigned char *b = s2;
-
- for (; num - 1 && *a == *b; a++, b++, num--)
- {
- continue;
- }
-
- return *a - *b;
-}
diff --git a/rushs/evalexpr/my_memcmp/my_memcmp.h b/rushs/evalexpr/my_memcmp/my_memcmp.h
deleted file mode 100644
index d17cbe6..0000000
--- a/rushs/evalexpr/my_memcmp/my_memcmp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_MEMCMP_H
-#define MY_MEMCMP_H
-
-#include <stddef.h>
-
-int my_memcmp(const void *s1, const void *s2, size_t num);
-
-#endif /* !MY_MEMCMP_H */
diff --git a/rushs/evalexpr/my_memcpy/my_memcpy.c b/rushs/evalexpr/my_memcpy/my_memcpy.c
deleted file mode 100644
index a6a48d4..0000000
--- a/rushs/evalexpr/my_memcpy/my_memcpy.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "my_memcpy.h"
-
-void *my_memcpy(void *dest, const void *source, size_t num)
-{
- char *d = dest;
- const char *s = source;
- if (dest > source) // reverse array
- {
- size_t l = num;
- for (; l > 0; l--)
- {
- d[l - 1] = s[l - 1];
- }
- }
- else
- {
- for (size_t i = 0; i < num; i++)
- {
- d[i] = s[i];
- }
- }
- return dest;
-}
-
-int main(void)
-{
- return 0;
-}
diff --git a/rushs/evalexpr/my_memcpy/my_memcpy.h b/rushs/evalexpr/my_memcpy/my_memcpy.h
deleted file mode 100644
index bc1b926..0000000
--- a/rushs/evalexpr/my_memcpy/my_memcpy.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_MEMCPY_H
-#define MY_MEMCPY_H
-
-#include <stddef.h>
-
-void *my_memcpy(void *dest, const void *source, size_t num);
-
-#endif /* ! MY_MEMCPY_H */
diff --git a/rushs/evalexpr/my_memmove/my_memmove.c b/rushs/evalexpr/my_memmove/my_memmove.c
deleted file mode 100644
index bb360a5..0000000
--- a/rushs/evalexpr/my_memmove/my_memmove.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "my_memmove.h"
-
-void *my_memmove(void *dest, const void *src, size_t n)
-{
- char *d = dest;
- const char *s = src;
- if (dest > src) // reverse array
- {
- size_t l = n;
- for (; l > 0; l--)
- {
- d[l - 1] = s[l - 1];
- }
- }
- else
- {
- for (size_t i = 0; i < n; i++)
- {
- d[i] = s[i];
- }
- }
- return dest;
-}
diff --git a/rushs/evalexpr/my_memmove/my_memmove.h b/rushs/evalexpr/my_memmove/my_memmove.h
deleted file mode 100644
index cb253b7..0000000
--- a/rushs/evalexpr/my_memmove/my_memmove.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_MEMMOVE_H
-#define MY_MEMMOVE_H
-
-#include <stddef.h>
-
-void *my_memmove(void *dest, const void *src, size_t n);
-
-#endif /* ! MY_MEMMOVE_H */
diff --git a/rushs/evalexpr/my_memset/my_memset.c b/rushs/evalexpr/my_memset/my_memset.c
deleted file mode 100644
index 243a5ac..0000000
--- a/rushs/evalexpr/my_memset/my_memset.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "my_memset.h"
-
-void *my_memset(void *s, int c, size_t n)
-{
- unsigned char *t = s;
- for (size_t i = 0; i < n; i++)
- {
- t[i] = c;
- }
-
- return t;
-}
diff --git a/rushs/evalexpr/my_memset/my_memset.h b/rushs/evalexpr/my_memset/my_memset.h
deleted file mode 100644
index e5ed0f0..0000000
--- a/rushs/evalexpr/my_memset/my_memset.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_MEMSET_H
-#define MY_MEMSET_H
-
-#include <stddef.h>
-
-#endif /* ! MY_MEMSET_H */
diff --git a/rushs/evalexpr/my_pow/my_pow.c b/rushs/evalexpr/my_pow/my_pow.c
deleted file mode 100644
index f529d87..0000000
--- a/rushs/evalexpr/my_pow/my_pow.c
+++ /dev/null
@@ -1,13 +0,0 @@
-int my_pow(int a, int b)
-{
- if (!a)
- return b == 0;
- int res = 1;
- for (int i = 0; i < b / 2; i++)
- {
- res *= a * a;
- }
- if (b % 2)
- res *= a;
- return res;
-}
diff --git a/rushs/evalexpr/my_round/my_round.c b/rushs/evalexpr/my_round/my_round.c
deleted file mode 100644
index 324bc1d..0000000
--- a/rushs/evalexpr/my_round/my_round.c
+++ /dev/null
@@ -1,6 +0,0 @@
-int my_round(float n)
-{
- if (n < 0)
- return n - 0.5;
- return n + 0.5;
-}
diff --git a/rushs/evalexpr/my_strcmp/my_strcmp.c b/rushs/evalexpr/my_strcmp/my_strcmp.c
deleted file mode 100644
index d3ef3e3..0000000
--- a/rushs/evalexpr/my_strcmp/my_strcmp.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "my_strcmp.h"
-
-int my_strcmp(const char *s1, const char *s2)
-{
- for (; *s1 && *s1 == *s2; s1++, s2++)
- {
- continue;
- }
-
- return *s1 - *s2;
-}
diff --git a/rushs/evalexpr/my_strcmp/my_strcmp.h b/rushs/evalexpr/my_strcmp/my_strcmp.h
deleted file mode 100644
index d89a00b..0000000
--- a/rushs/evalexpr/my_strcmp/my_strcmp.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_STRCMP_H
-#define MY_STRCMP_H
-
-#include <stddef.h>
-
-#endif /* ! MY_STRCMP_H */
diff --git a/rushs/evalexpr/my_strcpy/my_strcpy.c b/rushs/evalexpr/my_strcpy/my_strcpy.c
deleted file mode 100644
index 69ad5ee..0000000
--- a/rushs/evalexpr/my_strcpy/my_strcpy.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdlib.h>
-
-char *my_strcpy(char *dest, const char *source)
-{
- size_t i;
- for (i = 0; source[i]; i++)
- {
- dest[i] = source[i];
- }
- dest[i] = '\0';
-
- return dest;
-}
diff --git a/rushs/evalexpr/my_strlen/my_strlen.c b/rushs/evalexpr/my_strlen/my_strlen.c
deleted file mode 100644
index ec80d0b..0000000
--- a/rushs/evalexpr/my_strlen/my_strlen.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "my_strlen.h"
-
-size_t my_strlen(const char *s)
-{
- size_t i;
- for (i = 0; s[i]; i++)
- {
- continue;
- }
-
- return i;
-}
diff --git a/rushs/evalexpr/my_strlen/my_strlen.h b/rushs/evalexpr/my_strlen/my_strlen.h
deleted file mode 100644
index 02806cc..0000000
--- a/rushs/evalexpr/my_strlen/my_strlen.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_STRLEN_H
-#define MY_STRLEN_H
-
-#include <stddef.h>
-
-#endif /* ! MY_STRLEN_H */
diff --git a/rushs/evalexpr/my_strlowcase/my_strlowcase.c b/rushs/evalexpr/my_strlowcase/my_strlowcase.c
deleted file mode 100644
index e52ea32..0000000
--- a/rushs/evalexpr/my_strlowcase/my_strlowcase.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "my_strlowcase.h"
-
-void my_strlowcase(char *s)
-{
- size_t i;
- for (i = 0; s[i]; i++)
- {
- if (s[i] >= 'A' && s[i] <= 'Z')
- {
- s[i] += ('a' - 'A');
- }
- }
-}
diff --git a/rushs/evalexpr/my_strlowcase/my_strlowcase.h b/rushs/evalexpr/my_strlowcase/my_strlowcase.h
deleted file mode 100644
index d4996b8..0000000
--- a/rushs/evalexpr/my_strlowcase/my_strlowcase.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_STRLOWCASE_H
-#define MY_STRLOWCASE_H
-
-#include <stddef.h>
-
-void my_strlowcase(char *str);
-
-#endif /* ! MY_STRLOWCASE_H */
diff --git a/rushs/evalexpr/my_strspn/my_strspn.c b/rushs/evalexpr/my_strspn/my_strspn.c
deleted file mode 100644
index 18bba0f..0000000
--- a/rushs/evalexpr/my_strspn/my_strspn.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "my_strspn.h"
-
-int is_in(char c, const char *accept)
-{
- for (; *accept && *accept != c; accept++)
- {
- continue;
- }
- return *accept != '\0';
-}
-
-size_t my_strspn(const char *s, const char *accept)
-{
- if (s == NULL || *s == '\0')
- {
- return 0;
- }
-
- size_t res;
- for (res = 0; *s && is_in(*s, accept) != 0; res++, s++)
- {
- continue;
- }
-
- return res;
-}
diff --git a/rushs/evalexpr/my_strspn/my_strspn.h b/rushs/evalexpr/my_strspn/my_strspn.h
deleted file mode 100644
index f2d7759..0000000
--- a/rushs/evalexpr/my_strspn/my_strspn.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_STRSPN_H
-#define MY_STRSPN_H
-
-#include <stddef.h>
-
-size_t my_strspn(const char *s, const char *accept);
-
-#endif /* ! MY_STRSPN_H */
diff --git a/rushs/evalexpr/my_strstr/my_strstr.c b/rushs/evalexpr/my_strstr/my_strstr.c
deleted file mode 100644
index 36ac439..0000000
--- a/rushs/evalexpr/my_strstr/my_strstr.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "my_strstr.h"
-
-#include <stddef.h>
-
-int my_strstr(const char *haystack, const char *needle)
-{
- if (needle == NULL || *needle == '\0')
- {
- return 0;
- }
-
- for (int i = 0; haystack[i]; i++)
- {
- if (haystack[i] == needle[0])
- {
- int j;
- for (j = 0;
- haystack[i + j] && needle[j] && needle[j] == haystack[i + j];
- j++)
- {
- continue;
- }
- if (needle[j] == '\0')
- {
- return i;
- }
- if (haystack[i + j] == '\0')
- {
- return -1;
- }
- }
- }
- return -1;
-}
diff --git a/rushs/evalexpr/my_strstr/my_strstr.h b/rushs/evalexpr/my_strstr/my_strstr.h
deleted file mode 100644
index 1b734b2..0000000
--- a/rushs/evalexpr/my_strstr/my_strstr.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_STRSTR_H
-#define MY_STRSTR_H
-
-int my_strstr(const char *haystack, const char *needle);
-
-#endif /* ! MY_STRSTR_H */
diff --git a/rushs/evalexpr/my_strtok_r/my_strtok_r.c b/rushs/evalexpr/my_strtok_r/my_strtok_r.c
deleted file mode 100644
index ec052b7..0000000
--- a/rushs/evalexpr/my_strtok_r/my_strtok_r.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "my_strtok_r.h"
-
-#include <stddef.h>
-
-static int is_delim(char c, const char *delims)
-{
- for (const char *d = delims; *d; d++)
- {
- if (*d == c)
- return 1;
- }
- return 0;
-}
-
-char *my_strtok_r(char *str, const char *delim, char **saveptr)
-{
- if (str == NULL)
- {
- if (*saveptr == NULL)
- {
- return NULL;
- }
- str = *saveptr;
- }
-
- size_t i = 0;
- while (str[i] != '\0' && is_delim(str[i], delim))
- {
- i++;
- }
- if (str[i] == '\0')
- {
- *saveptr = NULL;
- return NULL;
- }
-
- char *res = str + i;
-
- while (str[i] != '\0' && !is_delim(str[i], delim))
- {
- i++;
- }
- if (str[i] == '\0')
- {
- *saveptr = NULL;
- return res;
- }
- *saveptr = str + i + 1;
- str[i] = '\0';
- return res;
-}
diff --git a/rushs/evalexpr/my_strtok_r/my_strtok_r.h b/rushs/evalexpr/my_strtok_r/my_strtok_r.h
deleted file mode 100644
index 5603729..0000000
--- a/rushs/evalexpr/my_strtok_r/my_strtok_r.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_STRTOK_R_H
-#define MY_STRTOK_R_H
-
-char *my_strtok_r(char *str, const char *delim, char **saveptr);
-
-#endif /* ! MY_STRTOK_R_H */
diff --git a/rushs/evalexpr/null_terminated_arrays/null_terminated_arrays.c b/rushs/evalexpr/null_terminated_arrays/null_terminated_arrays.c
deleted file mode 100644
index 32d2a17..0000000
--- a/rushs/evalexpr/null_terminated_arrays/null_terminated_arrays.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "null_terminated_arrays.h"
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdio.h>
-
-void reverse_array(const char **arr)
-{
- const char **p;
- for (p = arr; *p; p++)
- {
- continue;
- }
- p--;
-
- while (p > arr)
- {
- const char *tmp = *p;
- *p = *arr;
- *arr = tmp;
- arr++;
- p--;
- }
-}
-
-void reverse_matrix(const char ***matrix)
-{
- const char ***p;
- for (p = matrix; *p; p++)
- {
- continue;
- }
- p--;
-
- while (p > matrix)
- {
- reverse_array(*p);
- reverse_array(*matrix);
- const char **tmp = *p;
- *p = *matrix;
- *matrix = tmp;
- matrix++;
- p--;
- }
-
- if (p == matrix)
- {
- reverse_array(*matrix);
- }
-}
diff --git a/rushs/evalexpr/null_terminated_arrays/null_terminated_arrays.h b/rushs/evalexpr/null_terminated_arrays/null_terminated_arrays.h
deleted file mode 100644
index 31fccc5..0000000
--- a/rushs/evalexpr/null_terminated_arrays/null_terminated_arrays.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef NULL_TERMINATED_ARRAYS_H_
-#define NULL_TERMINATED_ARRAYS_H_
-
-void reverse_matrix(const char ***matrix);
-
-#endif /* !NULL_TERMINATED_ARRAYS_H_ */
diff --git a/rushs/evalexpr/number_digits_rec/number_digits_rec.c b/rushs/evalexpr/number_digits_rec/number_digits_rec.c
deleted file mode 100644
index 94de296..0000000
--- a/rushs/evalexpr/number_digits_rec/number_digits_rec.c
+++ /dev/null
@@ -1,8 +0,0 @@
-unsigned int number_digits_rec(unsigned int n)
-{
- if (n / 10 == 0)
- {
- return 1;
- }
- return 1 + number_digits_rec(n / 10);
-}
diff --git a/rushs/evalexpr/palindrome/palindrome.c b/rushs/evalexpr/palindrome/palindrome.c
deleted file mode 100644
index 2ecacfd..0000000
--- a/rushs/evalexpr/palindrome/palindrome.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "palindrome.h"
-
-#include <stddef.h>
-
-int palindrome(const char *s)
-{
- if (s == NULL)
- {
- return 0;
- }
-
- if (*s == '\0')
- {
- return 1;
- }
-
- const char *p = s;
- while (*p)
- {
- p++;
- }
- p--;
-
- while (p > s)
- {
- while ((*p < '0' || (*p > '9' && *p < 'A') || (*p > 'Z' && *p < 'a')
- || *p > 'z')
- && p > s)
- {
- p--;
- }
- while ((*s < '0' || (*s > '9' && *s < 'A') || (*s > 'Z' && *s < 'a')
- || *s > 'z')
- && p > s)
- {
- s++;
- }
- if (*p != *s)
- {
- return 0;
- }
- p--;
- s++;
- }
-
- return 1;
-}
diff --git a/rushs/evalexpr/palindrome/palindrome.h b/rushs/evalexpr/palindrome/palindrome.h
deleted file mode 100644
index 8595911..0000000
--- a/rushs/evalexpr/palindrome/palindrome.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef PALINDROME_H
-#define PALINDROME_H
-
-int palindrome(const char *s);
-
-#endif /* !PALINDROME_H */
diff --git a/rushs/evalexpr/pine/pine.c b/rushs/evalexpr/pine/pine.c
deleted file mode 100644
index 9d48761..0000000
--- a/rushs/evalexpr/pine/pine.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <stdio.h>
-
-int pine(unsigned n)
-{
- if (n < 3)
- {
- return 1;
- }
-
- for (unsigned i = 0; i < n; i++)
- {
- for (unsigned j = 0; j < n - i - 1; j++)
- {
- putchar(' ');
- }
-
- for (unsigned j = 0; j < 2 * i + 1; j++)
- {
- putchar('*');
- }
-
- putchar('\n');
- }
-
- for (unsigned i = 0; i < n / 2; i++)
- {
- for (unsigned j = 0; j < n - 1; j++)
- {
- putchar(' ');
- }
- putchar('*');
- putchar('\n');
- }
-
- return 0;
-}
diff --git a/rushs/evalexpr/pointer_swap/pointer_swap.c b/rushs/evalexpr/pointer_swap/pointer_swap.c
deleted file mode 100644
index 32ceb84..0000000
--- a/rushs/evalexpr/pointer_swap/pointer_swap.c
+++ /dev/null
@@ -1,6 +0,0 @@
-void pointer_swap(int **a, int **b)
-{
- int *tmp = *a;
- *a = *b;
- *b = tmp;
-}
diff --git a/rushs/evalexpr/prototypes/prototypes.sh b/rushs/evalexpr/prototypes/prototypes.sh
deleted file mode 100755
index 3c80468..0000000
--- a/rushs/evalexpr/prototypes/prototypes.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-sed -En 's/^(([a-zA-Z]* ){0,2}([a-zA-Z]*) *\**([a-z][a-z0-9_]*)\((([a-zA-Z]* )?([a-zA-Z]* )?([a-z][a-z0-9_]* *)(\**[a-z][a-z0-9_]*|[a-z][a-z0-9_]*\[([0-9][0-9]*)?\])(, ([a-zA-Z]* )?([a-zA-Z]* )?([a-z][a-z0-9_]* *)(\**[a-z][a-z0-9_]*|[a-z][a-z0-9_]*\[([0-9][0-9]*)?\])){0,3}|void)\))$/\1;/p' "$1"
diff --git a/rushs/evalexpr/quick_sort/quick_sort.c b/rushs/evalexpr/quick_sort/quick_sort.c
deleted file mode 100644
index 6c61fc3..0000000
--- a/rushs/evalexpr/quick_sort/quick_sort.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stddef.h>
-
-void quicksort(int *tab, size_t len)
-{
- if (tab == NULL)
- {
- return;
- }
- for (size_t i = 1; i < len; i++)
- {
- for (size_t j = i; j > 0 && tab[j - 1] > tab[j]; j--)
- {
- int tmp = tab[j];
- tab[j] = tab[j - 1];
- tab[j - 1] = tmp;
- }
- }
-}
diff --git a/rushs/evalexpr/quick_sort/quick_sort_example.c b/rushs/evalexpr/quick_sort/quick_sort_example.c
deleted file mode 100644
index 2a5228f..0000000
--- a/rushs/evalexpr/quick_sort/quick_sort_example.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdio.h>
-
-void quicksort(int *tab, int len);
-
-int main(void)
-{
- unsigned i = 0;
- int tab[] = { 10, 11, 2, 3, 8, 5, 7, 6, 26, 30, 2, 1, 17, 13, 14 };
-
- unsigned size = sizeof(tab) / sizeof(int);
-
- quicksort(tab, size);
-
- for (; i < size - 1; ++i)
- printf("%d ", tab[i]);
- printf("%d\n", tab[i]);
-
- return 0;
-}
diff --git a/rushs/evalexpr/repeat/repeat.c b/rushs/evalexpr/repeat/repeat.c
deleted file mode 100644
index 06d0b43..0000000
--- a/rushs/evalexpr/repeat/repeat.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-
-int main(int argc, char **argv)
-{
- if (argc != 3)
- return 1;
-
- for (int i = 0; i < argv[2][0] - '0'; i++)
- puts(argv[1]);
- return 0;
-}
diff --git a/rushs/evalexpr/right_tarball/my_tarball.tar.gz b/rushs/evalexpr/right_tarball/my_tarball.tar.gz
deleted file mode 100644
index eb6acfc..0000000
--- a/rushs/evalexpr/right_tarball/my_tarball.tar.gz
+++ /dev/null
Binary files differ
diff --git a/rushs/evalexpr/rotx/rotx.c b/rushs/evalexpr/rotx/rotx.c
deleted file mode 100644
index a2cb820..0000000
--- a/rushs/evalexpr/rotx/rotx.c
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-
-#define BUFFER_SIZE 10
-
-int main(int argc, char **argv)
-{
- if (argc != 2)
- {
- return 0;
- }
-
- int rot = atoi(argv[1]);
- int rod = rot;
- if (rot < 0)
- {
- rot = (rot % 26) + 26;
- rod = (rod % 10) + 10;
- }
-
- char buf[BUFFER_SIZE];
- ssize_t r;
-
- while ((r = read(STDIN_FILENO, buf, BUFFER_SIZE)))
- {
- if (r == -1)
- {
- return 1;
- }
-
- for (ssize_t i = 0; i < r; i++)
- {
- if (buf[i] >= 'a' && buf[i] <= 'z')
- {
- buf[i] = ((buf[i] - 'a') + rot) % 26 + 'a';
- }
- else if (buf[i] >= 'A' && buf[i] <= 'Z')
- {
- buf[i] = ((buf[i] - 'A') + rot) % 26 + 'A';
- }
- else if (buf[i] >= '0' && buf[i] <= '9')
- {
- buf[i] = ((buf[i] - '0') + rod) % 10 + '0';
- }
- }
-
- ssize_t w = write(STDOUT_FILENO, buf, r);
- while (w != r)
- {
- w += write(STDOUT_FILENO, buf, r);
- if (w == -1)
- {
- return 1;
- }
- }
- }
-
- return 0;
-}
diff --git a/rushs/evalexpr/sed_trailing_whitespaces/whitespaces.sed b/rushs/evalexpr/sed_trailing_whitespaces/whitespaces.sed
deleted file mode 100644
index 46b7017..0000000
--- a/rushs/evalexpr/sed_trailing_whitespaces/whitespaces.sed
+++ /dev/null
@@ -1 +0,0 @@
-s/[ \t]*$//
diff --git a/rushs/evalexpr/selection_sort/selection_sort.c b/rushs/evalexpr/selection_sort/selection_sort.c
deleted file mode 100644
index 98adc7e..0000000
--- a/rushs/evalexpr/selection_sort/selection_sort.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <stddef.h>
-
-void swap(int *a, int *b)
-{
- int tmp = *a;
- *a = *b;
- *b = tmp;
-}
-
-unsigned array_min(const int arr[], unsigned start, unsigned size)
-{
- unsigned min = start;
- for (; start < size; start++)
- {
- if (arr[min] > arr[start])
- {
- min = start;
- }
- }
- return min;
-}
-
-void selection_sort(int arr[], unsigned size)
-{
- for (size_t i = 0; i < size; i++)
- {
- unsigned j = array_min(arr, i, size);
- swap(&(arr[i]), &(arr[j]));
- }
-}
diff --git a/rushs/evalexpr/seq/seq.sh b/rushs/evalexpr/seq/seq.sh
deleted file mode 100755
index 9721432..0000000
--- a/rushs/evalexpr/seq/seq.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-if [ $# -ne 3 ]; then
- echo "Usage: ./seq.sh FIRST INCREMENT LAST" 1>&2
- exit 1
-fi
-
-if [ "$2" -eq 0 ]; then
- exit 1
-fi
-
-if [ "$1" -eq "$3" ]; then
- echo "$1"
- exit 0
-fi
-
-if [ "$1" -lt "$3" ]; then
- [ 0 -gt "$2" ] && exit 1
- i="$1"
- while [ "$3" -ge "$i" ]; do
- echo "$i"
- i=$(($i + $2))
- done
- exit 0
-fi
-
-[ "$2" -gt 0 ] && exit 1
-i="$1"
-while [ "$i" -ge "$3" ]; do
- echo "$i"
- i=$(($i + $2))
-done
-exit 0
diff --git a/rushs/evalexpr/sieve_eratosthenes_advanced/Makefile b/rushs/evalexpr/sieve_eratosthenes_advanced/Makefile
deleted file mode 100644
index c7e35f9..0000000
--- a/rushs/evalexpr/sieve_eratosthenes_advanced/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-CC=gcc
-CFLAGS=-std=c99 -Wall -Wextra -Werror -Wvla -pedantic
-LDLIBS=
-
-all: sieve.o
-
-sieve.o: sieve.c
- $(CC) $(CFLAGS) -c -o sieve.o sieve.c
-
-.PHONY: clean
-
-clean:
- rm sieve.o
diff --git a/rushs/evalexpr/sieve_eratosthenes_advanced/sieve.c b/rushs/evalexpr/sieve_eratosthenes_advanced/sieve.c
deleted file mode 100644
index 7dd4816..0000000
--- a/rushs/evalexpr/sieve_eratosthenes_advanced/sieve.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-void sieve(int n)
-{
- if (n <= 2)
- {
- return;
- }
-
- // Generate array
- int *a = calloc(n, sizeof(int));
- int count = 0;
-
- // Actual sieve and count
- for (int i = 2; i < n; i++)
- {
- if (a[i] == 0)
- {
- for (int k = 2 * i; k < n; k += i)
- {
- a[k] = 1;
- }
- }
- }
-
- for (int i = 2; i < n; i++)
- {
- if (a[i] == 0)
- {
- count++;
- }
- }
-
- // Print the count
- printf("%d\n", count);
-
- free(a);
-}
diff --git a/rushs/evalexpr/simple_fnmatch/simple_fnmatch.c b/rushs/evalexpr/simple_fnmatch/simple_fnmatch.c
deleted file mode 100644
index d40353f..0000000
--- a/rushs/evalexpr/simple_fnmatch/simple_fnmatch.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "simple_fnmatch.h"
-
-int simple_fnmatch(const char *pattern, const char *string)
-{
- if (!pattern || !string)
- return FNM_NOMATCH;
- if (*pattern == '*' && pattern[1] == '\0')
- return 0;
- while (*pattern && *string)
- {
- if (*pattern == '?')
- {
- pattern++;
- string++;
- }
- else if (*pattern == '\\')
- {
- pattern++;
- if (!pattern || *pattern != *string)
- return FNM_NOMATCH;
- string++;
- pattern++;
- }
- else if (*pattern == '*')
- {
- pattern++;
- while (*string && simple_fnmatch(pattern, string))
- string++;
- if (*string)
- return 0;
- }
- else if (*pattern != *string)
- return FNM_NOMATCH;
- else
- {
- string++;
- pattern++;
- }
- }
-
- if (*pattern == '*' && pattern[1] == '\0')
- return 0;
- if (*string || *pattern)
- return FNM_NOMATCH;
- return 0;
-}
diff --git a/rushs/evalexpr/simple_fnmatch/simple_fnmatch.h b/rushs/evalexpr/simple_fnmatch/simple_fnmatch.h
deleted file mode 100644
index e1ae166..0000000
--- a/rushs/evalexpr/simple_fnmatch/simple_fnmatch.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef SIMPLE_FNMATCH_H
-#define SIMPLE_FNMATCH_H
-
-#define FNM_NOMATCH 1
-
-int simple_fnmatch(const char *pattern, const char *string);
-
-#endif /* !SIMPLE_FNMATCH_H */
diff --git a/rushs/evalexpr/evalexpr/src/evalexpr.c b/rushs/evalexpr/src/evalexpr.c
index 5012355..5012355 100644
--- a/rushs/evalexpr/evalexpr/src/evalexpr.c
+++ b/rushs/evalexpr/src/evalexpr.c
diff --git a/rushs/evalexpr/evalexpr/src/evalexpr.h b/rushs/evalexpr/src/evalexpr.h
index d440ae1..d440ae1 100644
--- a/rushs/evalexpr/evalexpr/src/evalexpr.h
+++ b/rushs/evalexpr/src/evalexpr.h
diff --git a/rushs/evalexpr/evalexpr/src/evalrpn.c b/rushs/evalexpr/src/evalrpn.c
index db493eb..db493eb 100644
--- a/rushs/evalexpr/evalexpr/src/evalrpn.c
+++ b/rushs/evalexpr/src/evalrpn.c
diff --git a/rushs/evalexpr/evalexpr/src/fifo.h b/rushs/evalexpr/src/fifo.h
index b330eac..b330eac 100644
--- a/rushs/evalexpr/evalexpr/src/fifo.h
+++ b/rushs/evalexpr/src/fifo.h
diff --git a/rushs/evalexpr/evalexpr/src/fifo_access.c b/rushs/evalexpr/src/fifo_access.c
index 1986a09..1986a09 100644
--- a/rushs/evalexpr/evalexpr/src/fifo_access.c
+++ b/rushs/evalexpr/src/fifo_access.c
diff --git a/rushs/evalexpr/evalexpr/src/fifo_setup_destroy.c b/rushs/evalexpr/src/fifo_setup_destroy.c
index 0f99ad0..0f99ad0 100644
--- a/rushs/evalexpr/evalexpr/src/fifo_setup_destroy.c
+++ b/rushs/evalexpr/src/fifo_setup_destroy.c
diff --git a/rushs/evalexpr/evalexpr/src/shunting_yard.c b/rushs/evalexpr/src/shunting_yard.c
index 2db5fc8..2db5fc8 100644
--- a/rushs/evalexpr/evalexpr/src/shunting_yard.c
+++ b/rushs/evalexpr/src/shunting_yard.c
diff --git a/rushs/evalexpr/evalexpr/src/stack.c b/rushs/evalexpr/src/stack.c
index 14f659e..14f659e 100644
--- a/rushs/evalexpr/evalexpr/src/stack.c
+++ b/rushs/evalexpr/src/stack.c
diff --git a/rushs/evalexpr/evalexpr/src/stack.h b/rushs/evalexpr/src/stack.h
index d08e465..d08e465 100644
--- a/rushs/evalexpr/evalexpr/src/stack.h
+++ b/rushs/evalexpr/src/stack.h
diff --git a/rushs/evalexpr/evalexpr/src/stack_struct.h b/rushs/evalexpr/src/stack_struct.h
index 105cd5d..105cd5d 100644
--- a/rushs/evalexpr/evalexpr/src/stack_struct.h
+++ b/rushs/evalexpr/src/stack_struct.h
diff --git a/rushs/evalexpr/stack/stack.c b/rushs/evalexpr/stack/stack.c
deleted file mode 100644
index 0498abc..0000000
--- a/rushs/evalexpr/stack/stack.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "stack.h"
-
-#include <stdlib.h>
-
-struct stack *stack_push(struct stack *s, int e)
-{
- struct stack *new = malloc(sizeof(struct stack));
- new->data = e;
- new->next = NULL;
-
- new->next = s;
- return new;
-}
-
-struct stack *stack_pop(struct stack *s)
-{
- if (s == NULL)
- {
- return NULL;
- }
-
- struct stack *res = s->next;
- free(s);
- return res;
-}
-
-int stack_peek(struct stack *s)
-{
- return s->data;
-}
diff --git a/rushs/evalexpr/stack/stack.h b/rushs/evalexpr/stack/stack.h
deleted file mode 100644
index bd5dd24..0000000
--- a/rushs/evalexpr/stack/stack.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef STACK_H
-#define STACK_H
-
-struct stack
-{
- int data;
- struct stack *next;
-};
-
-struct stack *stack_push(struct stack *s, int e);
-struct stack *stack_pop(struct stack *s);
-int stack_peek(struct stack *s);
-
-#endif /* !STACK_H */
diff --git a/rushs/evalexpr/str_revert/str_revert.c b/rushs/evalexpr/str_revert/str_revert.c
deleted file mode 100644
index 31f7f3d..0000000
--- a/rushs/evalexpr/str_revert/str_revert.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "str_revert.h"
-
-#include <stddef.h>
-
-void str_revert(char str[])
-{
- if (*str == '\0')
- {
- return;
- }
-
- size_t len = 0;
- for (; str[len]; len++)
- {
- continue;
- }
- len--;
-
- for (size_t i = 0; i <= len / 2; i++)
- {
- char tmp = str[i];
- str[i] = str[len - i];
- str[len - i] = tmp;
- }
-}
diff --git a/rushs/evalexpr/str_revert/str_revert.h b/rushs/evalexpr/str_revert/str_revert.h
deleted file mode 100644
index daa23d4..0000000
--- a/rushs/evalexpr/str_revert/str_revert.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef STR_REVERT_H
-#define STR_REVERT_H
-
-void str_revert(char str[]);
-
-#endif /* ! STR_REVERT_H */
diff --git a/rushs/evalexpr/test.txt b/rushs/evalexpr/test.txt
deleted file mode 100644
index 958cdbc..0000000
--- a/rushs/evalexpr/test.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This is a short line.
-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-This is another short line.
diff --git a/rushs/evalexpr/test_a_bit/is_set.c b/rushs/evalexpr/test_a_bit/is_set.c
deleted file mode 100644
index 38fccf8..0000000
--- a/rushs/evalexpr/test_a_bit/is_set.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "is_set.h"
-
-unsigned int is_set(unsigned int value, unsigned char n)
-{
- return (value & (1 << (n - 1))) != 0;
-}
diff --git a/rushs/evalexpr/test_a_bit/is_set.h b/rushs/evalexpr/test_a_bit/is_set.h
deleted file mode 100644
index 8f2fd9a..0000000
--- a/rushs/evalexpr/test_a_bit/is_set.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef IS_SET_H
-#define IS_SET_H
-
-unsigned int is_set(unsigned int value, unsigned char n);
-
-#endif /* ! IS_SET_H */
diff --git a/rushs/evalexpr/test_a_bit/test.c b/rushs/evalexpr/test_a_bit/test.c
deleted file mode 100644
index e3403e4..0000000
--- a/rushs/evalexpr/test_a_bit/test.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-
-#include "is_set.h"
-
-int main(void)
-{
- printf("%d\n", is_set(24, 4));
- printf("%d\n", is_set(24, 3));
-
- return 0;
-}
diff --git a/rushs/evalexpr/evalexpr/tests/tests.sh b/rushs/evalexpr/tests/tests.sh
index 920f09b..920f09b 100755
--- a/rushs/evalexpr/evalexpr/tests/tests.sh
+++ b/rushs/evalexpr/tests/tests.sh
diff --git a/rushs/evalexpr/evalexpr/tests/unit_tests.c b/rushs/evalexpr/tests/unit_tests.c
index ed445a0..ed445a0 100644
--- a/rushs/evalexpr/evalexpr/tests/unit_tests.c
+++ b/rushs/evalexpr/tests/unit_tests.c
diff --git a/rushs/evalexpr/tinylibstream/Makefile b/rushs/evalexpr/tinylibstream/Makefile
deleted file mode 100644
index b060495..0000000
--- a/rushs/evalexpr/tinylibstream/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-CC = gcc
-CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
-
-.PHONY: library clean
-
-library: src/tinylibstream.o
- ar csr libstream.a src/tinylibstream.o
-
-clean:
- rm libstream.a src/tinylibstream.o
-
-check:
- $(CC) $(CFLAGS) -lcriterion src/tinylibstream.c tests/tests.c
diff --git a/rushs/evalexpr/tinylibstream/include/libstream.h b/rushs/evalexpr/tinylibstream/include/libstream.h
deleted file mode 100644
index 459432d..0000000
--- a/rushs/evalexpr/tinylibstream/include/libstream.h
+++ /dev/null
@@ -1,167 +0,0 @@
-#ifndef LIBSTREAM_H
-#define LIBSTREAM_H
-
-#include <fcntl.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <unistd.h>
-
-/*
-** /!\ DO NOT MODIFY THIS FILE, AS IT WILL BE OVERRIDDEN DURING CORRECTION. /!\
-**
-** You can add your own functions declarations to OTHER HEADER FILES.
-*/
-
-/* the value returned when end of file is reached */
-#define LBS_EOF (-1)
-
-/* the size of the buffer */
-#define LBS_BUFFER_SIZE 32
-
-/*
-** Describes the current operation:
-** - if reading, the buffer contains read-buffered data
-** - if writing, the buffer contains write-buffered data
-*/
-enum stream_io_operation
-{
- STREAM_READING = 0,
- STREAM_WRITING,
-};
-
-/*
-** Controls when to flush the buffer:
-** - when unbuffered, flush every time a character is written
-** - when buffered, flush when the buffer is full
-** - when line buffered, flush when the buffer is full or when a \n
-** character is written
-*/
-enum stream_buffering
-{
- STREAM_UNBUFFERED = 0,
- STREAM_LINE_BUFFERED,
- STREAM_BUFFERED,
-};
-
-struct stream
-{
- /* the flags passed to open */
- int flags;
-
- /*
- ** Initially, this variable is 0.
- ** When a function such as fgetc fails, it is set to 1 to indicate
- ** something went wrong. This is useful to make the difference between
- ** reaching the end of file and read errors while using fgetc and
- ** some others.
- ** It is often referred to as the error indicator.
- */
- int error;
-
- /* the file descriptor, as returned by open(2) */
- int fd;
-
- /*
- ** the kind of data stored by the buffer.
- ** The default value shouldn't matter.
- */
- enum stream_io_operation io_operation;
-
- /*
- ** defines when to flush **output**.
- ** This field does not control input buffering (which is always fully
- ** buffered).
- **
- ** The default value is LINE_BUFFERED if isatty(fd), BUFFERED otherwise.
- */
- enum stream_buffering buffering_mode;
-
- /* the amount of used bytes in the buffer */
- size_t buffered_size;
-
- /*
- ** /!\ This field only makes sense when io_operation is STREAM_READING /!\
- ** the amount of data already read from the buffer by the user.
- */
- size_t already_read;
-
- /*
- ** buffer
- ** -------------->
- ** +==============+====================+---------------------+
- ** | already_read | remaining_buffered | unused_buffer_space |
- ** +==============+====================+---------------------+
- ** \_______________________________/
- ** buffered_size
- **
- ** /!\ The buffer can contain either read-buffered or write-buffered data,
- ** depending on the value of io_operation /!\
- */
- char buffer[LBS_BUFFER_SIZE];
-};
-
-/*
-** These functions are defined in a header for optimization reasons:
-** each .c file that includes this header will get its own copy of the
-** function's code, thus easily make optimizations.
-**
-** ``static`` means each compilation unit (.c file) will have its own copy
-** of the function without them clashing.
-**
-** ``inline`` means the content of the function should be "copy pasted"
-** where it's called. It also tells the compiler not to complain when the
-** function isn't used.
-**
-** They're just like a macro, except the type of arguments is checked.
-*/
-
-static inline size_t stream_remaining_buffered(struct stream *stream)
-{
- return stream->buffered_size - stream->already_read;
-}
-
-static inline size_t stream_unused_buffer_space(struct stream *stream)
-{
- return sizeof(stream->buffer) - stream->buffered_size;
-}
-
-static inline bool stream_readable(struct stream *stream)
-{
- int access_mode = stream->flags & O_ACCMODE;
- if (access_mode == O_RDWR)
- return true;
- return access_mode == O_RDONLY;
-}
-
-static inline bool stream_writable(struct stream *stream)
-{
- int access_mode = stream->flags & O_ACCMODE;
- if (access_mode == O_RDWR)
- return true;
- return access_mode == O_WRONLY;
-}
-
-static inline int lbs_ferror(struct stream *stream)
-{
- return stream->error;
-}
-
-static inline void lbs_clearerr(struct stream *stream)
-{
- stream->error = 0;
-}
-
-static inline void lbs_setbufmode(struct stream *stream,
- enum stream_buffering mode)
-{
- stream->buffering_mode = mode;
-}
-
-struct stream *lbs_fopen(const char *path, const char *mode);
-struct stream *lbs_fdopen(int fd, const char *mode);
-int lbs_fflush(struct stream *stream);
-int lbs_fclose(struct stream *stream);
-int lbs_fputc(int c, struct stream *stream);
-int lbs_fgetc(struct stream *stream);
-
-#endif /* !LIBSTREAM_H */
diff --git a/rushs/evalexpr/tinylibstream/src/tinylibstream.c b/rushs/evalexpr/tinylibstream/src/tinylibstream.c
deleted file mode 100644
index dca1c01..0000000
--- a/rushs/evalexpr/tinylibstream/src/tinylibstream.c
+++ /dev/null
@@ -1,221 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-
-#include "../include/libstream.h"
-
-int get_flags(const char *mode)
-{
- int flags;
- if (strcmp(mode, "r") == 0)
- {
- flags = O_RDONLY;
- }
- else if (strcmp(mode, "r+") == 0)
- {
- flags = O_RDWR;
- }
- else if (strcmp(mode, "w") == 0)
- {
- flags = O_WRONLY | O_TRUNC | O_CREAT;
- }
- else
- {
- flags = O_RDWR | O_TRUNC | O_CREAT;
- }
-
- return flags;
-}
-
-struct stream *lbs_fopen(const char *path, const char *mode)
-{
- int fd = open(path, get_flags(mode));
-
- return lbs_fdopen(fd, mode);
-}
-
-struct stream *lbs_fdopen(int fd, const char *mode)
-{
- if (fd == -1)
- {
- return NULL;
- }
-
- struct stream *s = malloc(sizeof(struct stream));
- if (s == NULL)
- {
- return NULL;
- }
-
- s->flags = get_flags(mode);
- s->error = 0;
- s->fd = fd;
- if (isatty(fd))
- {
- s->buffering_mode = STREAM_LINE_BUFFERED;
- }
- else
- {
- s->buffering_mode = STREAM_BUFFERED;
- }
- s->buffered_size = 0;
- s->already_read = 0;
-
- return s;
-}
-
-int lbs_fflush(struct stream *stream)
-{
- if (stream == NULL || stream->buffered_size == 0)
- {
- return 0;
- }
-
- if (stream->io_operation == STREAM_READING)
- {
- if (!stream_readable(stream))
- {
- stream->error = 1;
- return LBS_EOF;
- }
- if (stream_remaining_buffered(stream) != 0
- && lseek(stream->fd, -stream_remaining_buffered(stream), SEEK_CUR)
- == -1)
- {
- stream->error = 1;
- return LBS_EOF;
- }
- stream->buffered_size = 0;
- stream->already_read = 0;
- }
- else
- {
- if (!stream_writable(stream))
- {
- stream->error = 1;
- return LBS_EOF;
- }
- ssize_t w;
- if ((w = write(stream->fd, stream->buffer, stream->buffered_size))
- == -1)
- {
- stream->error = 1;
- return LBS_EOF;
- }
- stream->buffered_size = 0;
- stream->already_read = 0;
- }
- return 0;
-}
-
-int lbs_fclose(struct stream *stream)
-{
- if (stream == NULL)
- {
- return 1;
- }
-
- lbs_fflush(stream);
- if (close(stream->fd) == -1)
- {
- return 1;
- }
-
- free(stream);
-
- return 0;
-}
-
-int lbs_fputc(int c, struct stream *stream)
-{
- if (!stream_writable(stream))
- {
- stream->error = 1;
- return -1;
- }
-
- if (stream->io_operation == STREAM_READING)
- {
- if (lbs_fflush(stream) != 0)
- {
- return -1;
- }
- stream->buffered_size = 0;
- stream->already_read = 0;
- }
- stream->io_operation = STREAM_WRITING;
-
- if (stream_unused_buffer_space(stream) == 0
- || stream->buffering_mode == STREAM_UNBUFFERED)
- {
- if (lbs_fflush(stream) != 0)
- {
- return -1;
- }
- }
-
- stream->buffer[stream->buffered_size] = c;
- stream->buffered_size++;
- if (stream_unused_buffer_space(stream) == 0
- || stream->buffering_mode == STREAM_UNBUFFERED
- || (stream->buffering_mode == STREAM_LINE_BUFFERED && c == '\n'))
- {
- if (lbs_fflush(stream) != 0)
- {
- return -1;
- }
- }
-
- return c;
-}
-
-int refill_buffer(struct stream *stream)
-{
- stream->already_read = 0;
- ssize_t r;
- if ((r = read(stream->fd, stream->buffer, LBS_BUFFER_SIZE)) == -1)
- {
- stream->error = 1;
- return -1;
- }
- if (r == 0)
- {
- return -1;
- }
- stream->buffered_size = r;
- return r;
-}
-
-int lbs_fgetc(struct stream *stream)
-{
- if (!stream_readable(stream))
- {
- stream->error = 1;
- return -1;
- }
- if (stream->io_operation == STREAM_WRITING)
- {
- if (lbs_fflush(stream) != 0)
- {
- stream->error = 1;
- return -1;
- }
- stream->already_read = 0;
- }
- stream->io_operation = STREAM_READING;
-
- if (stream_remaining_buffered(stream) == 0)
- {
- int r;
- if ((r = refill_buffer(stream)) == -1)
- {
- stream->error = 1;
- return -1;
- }
- }
-
- int res = stream->buffer[stream->already_read++];
-
- unsigned char c = res;
-
- return c;
-}
diff --git a/rushs/evalexpr/tinylibstream/stdin_buffering_test.c b/rushs/evalexpr/tinylibstream/stdin_buffering_test.c
deleted file mode 100644
index 6d3361b..0000000
--- a/rushs/evalexpr/tinylibstream/stdin_buffering_test.c
+++ /dev/null
@@ -1,70 +0,0 @@
-#define _GNU_SOURCE
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-struct slow_cookie
-{
- int fd;
-};
-
-static ssize_t slow_read(void *vcookie, char *buf, size_t count)
-{
- struct slow_cookie *cookie = vcookie;
- usleep(500000); // sleep for half of a second
-
- ssize_t res;
-
- while ((res = read(cookie->fd, buf, count)) < 0)
- if (errno != EINTR && errno != EAGAIN)
- break;
-
- return res;
-}
-
-static int slow_close(void *vcookie)
-{
- struct slow_cookie *cookie = vcookie;
- return close(cookie->fd);
-}
-
-cookie_io_functions_t slow_stdio = {
- .read = slow_read,
- .close = slow_close,
-};
-
-int main(void)
-{
- /* setup a custom stdin stream with a slow read function */
- struct slow_cookie cookie = {
- .fd = STDIN_FILENO,
- };
-
- FILE *input_stream = fopencookie(&cookie, "r", slow_stdio);
-
- /* change the buffer size to the one given by stdbuf.
- ** it doesn't work out of the box as stdbuf only does
- ** this for the already existing stdin stream.
- */
- char *buffer = NULL;
- char *buffer_size = getenv("_STDBUF_I");
- if (buffer_size)
- {
- size_t size = atoi(buffer_size);
- buffer = malloc(size);
- setvbuf(input_stream, buffer, _IOFBF, size);
- }
-
- /* forward all characters from stdin to stdout */
- int c;
- while ((c = fgetc(input_stream)) != EOF)
- {
- fputc(c, stdout);
- fflush(stdout);
- }
-
- fclose(input_stream);
- free(buffer);
- return 0;
-}
diff --git a/rushs/evalexpr/tinylibstream/stdout_buffering_test.c b/rushs/evalexpr/tinylibstream/stdout_buffering_test.c
deleted file mode 100644
index 45c0a83..0000000
--- a/rushs/evalexpr/tinylibstream/stdout_buffering_test.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#define _XOPEN_SOURCE 500
-#include <stdio.h>
-#include <unistd.h>
-
-int main(void)
-{
- const char test_string[] = "Robin\nloves\nBatman\n";
- for (size_t i = 0; test_string[i]; i++)
- {
- usleep(100000); // wait a tenth of a second
- putchar(test_string[i]);
- }
-}
diff --git a/rushs/evalexpr/traffic_lights/traffic_lights.c b/rushs/evalexpr/traffic_lights/traffic_lights.c
deleted file mode 100644
index 76ea94f..0000000
--- a/rushs/evalexpr/traffic_lights/traffic_lights.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "traffic_lights.h"
-
-void init(unsigned char *lights)
-{
- *lights <<= 4;
-}
-
-void turn_on(unsigned char *lights, unsigned char light_num)
-{
- *lights |= 1 << (light_num - 1);
-}
-
-void turn_off(unsigned char *lights, unsigned char light_num)
-{
- *lights &= ~(1 << (light_num - 1));
-}
-
-void next_step(unsigned char *lights)
-{
- *lights <<= 1;
- *lights += *lights >> 4;
-}
-
-void reverse(unsigned char *lights)
-{
- *lights = ~*lights;
-}
-
-void swap(unsigned char *lights_1, unsigned char *lights_2)
-{
- if (lights_1 == lights_2)
- {
- return;
- }
- *lights_1 = *lights_2 ^ *lights_1;
- *lights_2 = *lights_1 ^ *lights_2;
- *lights_1 = *lights_2 ^ *lights_1;
-}
diff --git a/rushs/evalexpr/traffic_lights/traffic_lights.h b/rushs/evalexpr/traffic_lights/traffic_lights.h
deleted file mode 100644
index 7c803ea..0000000
--- a/rushs/evalexpr/traffic_lights/traffic_lights.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef TRAFFIC_LIGHTS_H
-#define TRAFFIC_LIGHTS_H
-
-void init(unsigned char *lights);
-void turn_on(unsigned char *lights, unsigned char light_num);
-void turn_off(unsigned char *lights, unsigned char light_num);
-void next_step(unsigned char *lights);
-void reverse(unsigned char *lights);
-void swap(unsigned char *lights_1, unsigned char *lights_2);
-
-#endif /* !TRAFFIC_LIGHTS_H */
diff --git a/rushs/evalexpr/user_ids/get_ids.sh b/rushs/evalexpr/user_ids/get_ids.sh
deleted file mode 100644
index 2a1668b..0000000
--- a/rushs/evalexpr/user_ids/get_ids.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-cut --delimiter=: --fields=3 -s /etc/passwd | sort -rgu
diff --git a/rushs/evalexpr/using_special_variables/print.sh b/rushs/evalexpr/using_special_variables/print.sh
deleted file mode 100755
index c24bebd..0000000
--- a/rushs/evalexpr/using_special_variables/print.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-echo $#
-echo $*
-echo $1
-echo $2
-echo $3
-echo ${13}
-echo $0
diff --git a/rushs/evalexpr/variant/variant.c b/rushs/evalexpr/variant/variant.c
deleted file mode 100644
index eb2f8a8..0000000
--- a/rushs/evalexpr/variant/variant.c
+++ /dev/null
@@ -1,96 +0,0 @@
-#include "variant.h"
-
-#include <stdio.h>
-#include <string.h>
-
-void variant_display(const struct variant *e)
-{
- switch (e->type)
- {
- case (TYPE_INT):
- printf("%d\n", e->value.int_v);
- break;
- case (TYPE_FLOAT):
- printf("%f\n", e->value.float_v);
- break;
- case (TYPE_CHAR):
- printf("%c\n", e->value.char_v);
- break;
- default:
- printf("%s\n", e->value.str_v);
- break;
- }
-}
-
-bool variant_equal(const struct variant *left, const struct variant *right)
-{
- if (left == NULL || right == NULL)
- {
- return true;
- }
- switch (left->type)
- {
- case (TYPE_INT):
- if (right->type != TYPE_INT)
- {
- return false;
- }
- return left->value.int_v == right->value.int_v;
- case (TYPE_FLOAT):
- if (right->type != TYPE_FLOAT)
- {
- return false;
- }
- return left->value.float_v == right->value.float_v;
- case (TYPE_CHAR):
- if (right->type != TYPE_CHAR)
- {
- return false;
- }
- return left->value.char_v == right->value.char_v;
- default:
- if (right->type != TYPE_STRING)
- {
- return false;
- }
- return strcmp(left->value.str_v, right->value.str_v) == 0;
- }
-}
-
-int variant_find(const struct variant *array, size_t len, enum type type,
- union type_any value)
-{
- size_t i;
- struct variant cmp = { type, value };
- for (i = 0; i < len && variant_equal(array + i, &cmp) == false; i++)
- {
- continue;
- }
-
- if (i == len)
- {
- return -1;
- }
- return i;
-}
-
-float variant_sum(const struct variant *array, size_t len)
-{
- if (array == NULL)
- {
- return 0;
- }
- float sum = 0;
- for (size_t i = 0; i < len; i++)
- {
- if (array[i].type == TYPE_FLOAT)
- {
- sum += array[i].value.float_v;
- }
- else if (array[i].type == TYPE_INT)
- {
- sum += array[i].value.int_v;
- }
- }
- return sum;
-}
diff --git a/rushs/evalexpr/variant/variant.h b/rushs/evalexpr/variant/variant.h
deleted file mode 100644
index 9983bc1..0000000
--- a/rushs/evalexpr/variant/variant.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef VARIANT_H
-#define VARIANT_H
-
-#include <stdbool.h>
-#include <stddef.h>
-
-enum type
-{
- TYPE_INT,
- TYPE_FLOAT,
- TYPE_CHAR,
- TYPE_STRING
-};
-
-union type_any
-{
- int int_v;
- float float_v;
- char char_v;
- const char *str_v;
-};
-
-struct variant
-{
- enum type type;
- union type_any value;
-};
-
-void variant_display(const struct variant *e);
-bool variant_equal(const struct variant *left, const struct variant *right);
-int variant_find(const struct variant *array, size_t len, enum type type,
- union type_any value);
-float variant_sum(const struct variant *array, size_t len);
-
-#endif /* !VARIANT_H */
diff --git a/rushs/evalexpr/vector/Makefile b/rushs/evalexpr/vector/Makefile
deleted file mode 100644
index 744241f..0000000
--- a/rushs/evalexpr/vector/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-CC = gcc
-CFLAGS = -Wall -Werror -Wvla -Wextra -std=c99 -pedantic
-
-.PHONY: library clean
-
-library: vector.o
- ar csr libvector.a vector.o
-
-vector.o: vector.c
- $(CC) $(CFLAGS) -c -o vector.o vector.c
-
-clean:
- $(RM) libvector.a vector.o
diff --git a/rushs/evalexpr/vector/vector.c b/rushs/evalexpr/vector/vector.c
deleted file mode 100644
index cbd19aa..0000000
--- a/rushs/evalexpr/vector/vector.c
+++ /dev/null
@@ -1,152 +0,0 @@
-#include "vector.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-struct vector *vector_init(size_t n)
-{
- struct vector *res = malloc(sizeof(struct vector));
- if (res == NULL)
- {
- return NULL;
- }
-
- res->size = 0;
- res->capacity = n;
- res->data = malloc(n * sizeof(int));
- if (res->data == NULL)
- {
- return NULL;
- }
- return res;
-}
-
-void vector_destroy(struct vector *v)
-{
- if (v)
- {
- free(v->data);
- free(v);
- }
-}
-
-struct vector *vector_resize(struct vector *v, size_t n)
-{
- if (!v)
- {
- return NULL;
- }
- if (n == v->capacity)
- {
- return v;
- }
- if (v)
- {
- int *tmp = realloc(v->data, n * sizeof(int));
- if (tmp == NULL)
- {
- return NULL;
- }
- v->data = tmp;
-
- if (n < v->size)
- {
- v->size = n;
- }
- v->capacity = n;
- return v;
- }
- return NULL;
-}
-
-struct vector *vector_append(struct vector *v, int elt)
-{
- if (v == NULL)
- {
- return NULL;
- }
-
- if (v->size == v->capacity)
- {
- if (vector_resize(v, v->capacity * 2) == NULL)
- {
- return NULL;
- }
- }
- v->data[v->size] = elt;
- v->size++;
- return v;
-}
-
-void vector_print(const struct vector *v)
-{
- if (v == NULL || v->size == 0)
- {
- printf("\n");
- return;
- }
- for (size_t i = 0; i < v->size - 1; i++)
- {
- printf("%d,", v->data[i]);
- }
- printf("%d\n", v->data[v->size - 1]);
-}
-
-struct vector *vector_reset(struct vector *v, size_t n)
-{
- if (vector_resize(v, n) == NULL)
- {
- return NULL;
- }
-
- v->size = 0;
- return v;
-}
-
-struct vector *vector_insert(struct vector *v, size_t i, int elt)
-{
- if (v == NULL || i > v->size)
- return NULL;
- if (i == v->size)
- {
- return vector_append(v, elt);
- }
- if (v->size == v->capacity)
- {
- if (vector_resize(v, v->capacity * 2) == NULL)
- {
- return NULL;
- }
- }
- for (size_t j = v->size; j > i; j--)
- {
- v->data[j] = v->data[j - 1];
- }
- v->size++;
-
- v->data[i] = elt;
- return v;
-}
-
-struct vector *vector_remove(struct vector *v, size_t i)
-{
- if (v == NULL || v->size == 0 || i >= v->size)
- {
- return NULL;
- }
- for (size_t j = i; j < v->size - 1; j++)
- {
- v->data[j] = v->data[j + 1];
- }
-
- v->size--;
-
- if (v->size < v->capacity / 2)
- {
- if (vector_resize(v, v->capacity / 2) == NULL)
- {
- return NULL;
- }
- }
- return v;
-}
diff --git a/rushs/evalexpr/vector/vector.h b/rushs/evalexpr/vector/vector.h
deleted file mode 100644
index 5afada7..0000000
--- a/rushs/evalexpr/vector/vector.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef VECTOR_H
-#define VECTOR_H
-
-#include <stddef.h>
-
-struct vector
-{
- // The number of elements in the vector
- size_t size;
- // The maximum number of elements in the vector
- size_t capacity;
- // The elements themselves
- int *data;
-};
-
-/*
-** Initialize the vector with `n` capacity.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_init(size_t n);
-
-/*
-** Release the memory used by the vector.
-** Does nothing if `v` is `NULL`.
-*/
-void vector_destroy(struct vector *v);
-
-/*
-** Resize the vector to `n` capacity.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_resize(struct vector *v, size_t n);
-
-/*
-** Append an element to the end of the vector. Expand the vector if needed.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_append(struct vector *v, int elt);
-
-/*
-** Display the vector contents on `stdout`.
-** Displays `\n` if `v` is `NULL`.
-*/
-void vector_print(const struct vector *v);
-
-/*
-** Remove all the elements of the vector, and resize it to `n` capacity.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_reset(struct vector *v, size_t n);
-
-/*
-** Insert `n` at the index `i`. Expand the vector if needed.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_insert(struct vector *v, size_t i, int elt);
-
-/*
-** Remove the element at the index `i`.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_remove(struct vector *v, size_t i);
-
-#endif /* !VECTOR_H */
diff --git a/rushs/tinyprintf/80cols/80cols.sh b/rushs/tinyprintf/80cols/80cols.sh
deleted file mode 100755
index d66cf9b..0000000
--- a/rushs/tinyprintf/80cols/80cols.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 1 ] && exit 1
-[ -f $1 ] || exit 1
-
-while IFS='' read -r line; do
- var=$(printf '%s' "$line" | wc -m)
- [ "$var" -ge 80 ] && printf '%s\n' "$line"
-done < "$1"
-
-exit 0
diff --git a/rushs/tinyprintf/80cols_grep/80cols.grep b/rushs/tinyprintf/80cols_grep/80cols.grep
deleted file mode 100644
index 1fe0c1f..0000000
--- a/rushs/tinyprintf/80cols_grep/80cols.grep
+++ /dev/null
@@ -1 +0,0 @@
-.\{80,\}
diff --git a/rushs/evalexpr/tinyprintf/Makefile b/rushs/tinyprintf/Makefile
index 6a07d90..6a07d90 100644
--- a/rushs/evalexpr/tinyprintf/Makefile
+++ b/rushs/tinyprintf/Makefile
diff --git a/rushs/tinyprintf/a.out b/rushs/tinyprintf/a.out
deleted file mode 100755
index 33e84ed..0000000
--- a/rushs/tinyprintf/a.out
+++ /dev/null
Binary files differ
diff --git a/rushs/tinyprintf/add_int_ptr/add_int_ptr.c b/rushs/tinyprintf/add_int_ptr/add_int_ptr.c
deleted file mode 100644
index ad48639..0000000
--- a/rushs/tinyprintf/add_int_ptr/add_int_ptr.c
+++ /dev/null
@@ -1,7 +0,0 @@
-int *add_int_ptr(int *a, int *b)
-{
- if (!a || !b)
- return a;
- *a += *b;
- return a;
-}
diff --git a/rushs/tinyprintf/alphabet/alphabet.c b/rushs/tinyprintf/alphabet/alphabet.c
deleted file mode 100644
index 9496c66..0000000
--- a/rushs/tinyprintf/alphabet/alphabet.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdio.h>
-
-int main(void)
-{
- for (char i = 'a'; i < 'z'; i++)
- {
- putchar(i);
- putchar(' ');
- }
- putchar('z');
- putchar('\n');
- return 0;
-}
diff --git a/rushs/tinyprintf/alphanum/alphanum.sh b/rushs/tinyprintf/alphanum/alphanum.sh
deleted file mode 100755
index e4c5aee..0000000
--- a/rushs/tinyprintf/alphanum/alphanum.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-letters()
-{
- grepped=$(echo "$1" | grep -E "^[a-zA-Z]+$")
- [ "$1" = "$grepped" ] && return 0 || return 1
-}
-
-empty()
-{
- if echo "$1" | grep -qE '^[[:space:]]+$'; then
- return 0
- fi
- return 1
-}
-
-digit()
-{
- grepped=$(echo "$1" | grep -E "^[0-9]$")
- [ "$1" = "$grepped" ] && return 0 || return 1
-}
-
-number()
-{
- grepped=$(echo "$1" | grep -E "^[1-9][0-9]+$")
- [ "$1" = "$grepped" ] && return 0 || return 1
-}
-
-alph()
-{
- grepped=$(echo "$1" | grep -E "^[a-zA-Z0-9]+$")
- [ "$1" = "$grepped" ] && return 0 || return 1
-}
-
-while IFS='' read -r str; do
- if [ -z "$str" ]; then
- echo it is empty
- continue
- elif letters "$str"; then
- echo "it is a word"
- elif number "$str"; then
- echo "it is a number"
- elif digit "$str"; then
- echo "it is a digit"
- elif empty "$str"; then
- echo "it is empty"
- elif alph "$str"; then
- echo "it is an alphanum"
- else
- echo "it is too complicated"
- exit
- fi
-done
diff --git a/rushs/tinyprintf/array_max_min/array_max_min.c b/rushs/tinyprintf/array_max_min/array_max_min.c
deleted file mode 100644
index 8b2d3a5..0000000
--- a/rushs/tinyprintf/array_max_min/array_max_min.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <stddef.h>
-#include <stdio.h>
-
-void array_max_min(int tab[], size_t len, int *max, int *min)
-{
- if (tab && len)
- {
- *min = tab[0];
- *max = tab[0];
-
- for (size_t i = 0; i < len; i++)
- {
- if (tab[i] > *max)
- {
- *max = tab[i];
- }
- else if (tab[i] < *min)
- {
- *min = tab[i];
- }
- }
- }
-}
diff --git a/rushs/tinyprintf/ascii_carousel/rot_x.c b/rushs/tinyprintf/ascii_carousel/rot_x.c
deleted file mode 100644
index 667106d..0000000
--- a/rushs/tinyprintf/ascii_carousel/rot_x.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stddef.h>
-
-void rot_x(char *s, int x)
-{
- if (s == NULL)
- {
- return;
- }
-
- if (x < 0)
- {
- x = 26 + x;
- }
-
- for (size_t i = 0; s[i]; i++)
- {
- if (s[i] >= 'a' && s[i] <= 'z')
- {
- s[i] = ((s[i] - 'a') + x) % 26 + 'a';
- }
- else if (s[i] >= 'A' && s[i] <= 'Z')
- {
- s[i] = ((s[i] - 'A') + x) % 26 + 'A';
- }
- }
-}
diff --git a/rushs/tinyprintf/ascii_house/ascii_house.sh b/rushs/tinyprintf/ascii_house/ascii_house.sh
deleted file mode 100755
index 83d907e..0000000
--- a/rushs/tinyprintf/ascii_house/ascii_house.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-
-echo ' /\'
-echo ' / \'
-echo -n "/____\\ \`" && echo "'\`"
-echo -n "| | \`" && echo "'''\`"
-echo "| | \`|\`"
-echo '|_/\_|___|__'
diff --git a/rushs/tinyprintf/assignment_operator/assignment_operator.c b/rushs/tinyprintf/assignment_operator/assignment_operator.c
deleted file mode 100644
index cae560f..0000000
--- a/rushs/tinyprintf/assignment_operator/assignment_operator.c
+++ /dev/null
@@ -1,37 +0,0 @@
-void plus_equal(int *a, int *b)
-{
- if (!a || !b)
- {
- return;
- }
- *a = *a + *b;
-}
-
-void minus_equal(int *a, int *b)
-{
- if (!a || !b)
- {
- return;
- }
- *a = *a - *b;
-}
-
-void mult_equal(int *a, int *b)
-{
- if (!a || !b)
- {
- return;
- }
- *a = *a * *b;
-}
-
-int div_equal(int *a, int *b)
-{
- if (!a || !b || *b == 0)
- {
- return 0;
- }
- int res = *a % *b;
- *a = *a / *b;
- return res;
-}
diff --git a/rushs/tinyprintf/binary_search_ptr/bsearch.c b/rushs/tinyprintf/binary_search_ptr/bsearch.c
deleted file mode 100644
index bdc189c..0000000
--- a/rushs/tinyprintf/binary_search_ptr/bsearch.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "bsearch.h"
-
-#include <stddef.h>
-
-int *binary_search(int *begin, int *end, int elt)
-{
- if (begin == end)
- {
- return begin;
- }
- if (begin > end)
- {
- if (elt > *begin)
- {
- return begin + 1;
- }
- return begin;
- }
-
- size_t m = (end - begin) / 2;
-
- if (begin[m] == elt)
- {
- return begin + m;
- }
-
- if (begin[m] > elt)
- {
- return binary_search(begin, begin + m, elt);
- }
-
- if (m == 0)
- {
- m++;
- }
-
- return binary_search(begin + m, end, elt);
-}
diff --git a/rushs/tinyprintf/binary_search_ptr/bsearch.h b/rushs/tinyprintf/binary_search_ptr/bsearch.h
deleted file mode 100644
index e011744..0000000
--- a/rushs/tinyprintf/binary_search_ptr/bsearch.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef BSEARCH_H_
-#define BSEARCH_H_
-
-/*
-** Search `elt` in the memory range of [`begin` - `end`[.
-** `begin` is a pointer to the first element.
-** `end` is a pointer **AFTER** the last element.
-** The elements in the range [`begin` - `end`[ are sorted in ascending order.
-** If the range is empty, `begin` == `end`.
-** `begin` and `end` can't be `NULL`.
-** Returns a pointer to the element if found, or a pointer to the memory
-** location where the element could be inserted to keep the array sorted.
-*/
-int *binary_search(int *begin, int *end, int elt);
-
-#endif /* !BSEARCH_H_ */
diff --git a/rushs/tinyprintf/binary_tree_dynamic/Makefile b/rushs/tinyprintf/binary_tree_dynamic/Makefile
deleted file mode 100644
index 7fa9879..0000000
--- a/rushs/tinyprintf/binary_tree_dynamic/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-CC = gcc
-CFLAGS = -Wall -Werror -Wvla -Wextra -std=c99 -pedantic
-
-SRC = binary_tree.c binary_tree_print.c
-OBJ = $(SRC:.c=.o)
-
-.PHONY: library clean
-
-library: $(OBJ)
- ar csr libbinary_tree.a $(OBJ)
-
-$(OBJ): $(SRC)
-
-clean:
- $(RM) libbinary_tree.a $(OBJ)
diff --git a/rushs/tinyprintf/binary_tree_dynamic/binary_tree.c b/rushs/tinyprintf/binary_tree_dynamic/binary_tree.c
deleted file mode 100644
index 6d99e99..0000000
--- a/rushs/tinyprintf/binary_tree_dynamic/binary_tree.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "binary_tree.h"
-
-#include <stddef.h>
-#include <stdio.h>
-
-int size(const struct binary_tree *tree)
-{
- if (tree == NULL)
- return 0;
-
- return 1 + size(tree->left) + size(tree->right);
-}
-
-static int max(int a, int b)
-{
- if (a > b)
- return a;
- return b;
-}
-
-int height(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return -1;
- }
-
- return 1 + max(height(tree->left), height(tree->right));
-}
-
-int is_perfect(const struct binary_tree *tree)
-{
- if (tree == NULL)
- return 1;
- return height(tree->left) == height(tree->right) && is_perfect(tree->right)
- && is_perfect(tree->right);
-}
-
-int is_complete(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return 1;
- }
-
- int hg = height(tree->left);
- int hd = height(tree->right);
-
- if (hg - hd != 0 && hg - hd != 1)
- {
- return 0;
- }
-
- return is_complete(tree->left) && is_complete(tree->right);
-}
-
-int is_degenerate(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return 1;
- }
-
- if (tree->left && tree->right)
- {
- return 0;
- }
- return is_degenerate(tree->left) && is_degenerate(tree->right);
-}
-
-int is_full(const struct binary_tree *tree)
-{
- if (tree == NULL)
- return 1;
- if ((tree->left && !tree->right) || (!tree->left && tree->right))
- return 0;
- return is_full(tree->right) && is_full(tree->left);
-}
-
-static int is_bzt(const struct binary_tree *tree, int min, int max)
-{
- if (tree == NULL)
- return 1;
- if (tree->data > max || tree->data <= min)
- return 0;
- return is_bzt(tree->left, min, tree->data)
- && is_bzt(tree->right, tree->data, max);
-}
-
-int is_bst(const struct binary_tree *tree)
-{
- if (tree == NULL)
- return 1;
- return is_bzt(tree, -2147483647, 2147483647);
-}
diff --git a/rushs/tinyprintf/binary_tree_dynamic/binary_tree.h b/rushs/tinyprintf/binary_tree_dynamic/binary_tree.h
deleted file mode 100644
index a08e4ef..0000000
--- a/rushs/tinyprintf/binary_tree_dynamic/binary_tree.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef BINARY_TREE_H
-#define BINARY_TREE_H
-
-struct binary_tree
-{
- int data;
- struct binary_tree *left;
- struct binary_tree *right;
-};
-
-int size(const struct binary_tree *tree);
-int height(const struct binary_tree *tree);
-void dfs_print_prefix(const struct binary_tree *tree);
-void dfs_print_infix(const struct binary_tree *tree);
-void dfs_print_postfix(const struct binary_tree *tree);
-int is_perfect(const struct binary_tree *tree);
-int is_complete(const struct binary_tree *tree);
-int is_degenerate(const struct binary_tree *tree);
-int is_full(const struct binary_tree *tree);
-int is_bst(const struct binary_tree *tree);
-
-#endif /* !BINARY_TREE_H */
diff --git a/rushs/tinyprintf/binary_tree_dynamic/binary_tree_print.c b/rushs/tinyprintf/binary_tree_dynamic/binary_tree_print.c
deleted file mode 100644
index bce0f77..0000000
--- a/rushs/tinyprintf/binary_tree_dynamic/binary_tree_print.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <stddef.h>
-#include <stdio.h>
-
-#include "binary_tree.h"
-
-void dfs_print_prefix(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return;
- }
-
- printf("%d ", tree->data);
- dfs_print_prefix(tree->left);
- dfs_print_prefix(tree->right);
-}
-
-void dfs_print_infix(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return;
- }
-
- dfs_print_infix(tree->left);
- printf("%d ", tree->data);
- dfs_print_infix(tree->right);
-}
-
-void dfs_print_postfix(const struct binary_tree *tree)
-{
- if (tree == NULL)
- {
- return;
- }
-
- dfs_print_postfix(tree->left);
- dfs_print_postfix(tree->right);
- printf("%d ", tree->data);
-}
diff --git a/rushs/tinyprintf/bit_rotation/rol.c b/rushs/tinyprintf/bit_rotation/rol.c
deleted file mode 100644
index 151ebb5..0000000
--- a/rushs/tinyprintf/bit_rotation/rol.c
+++ /dev/null
@@ -1,5 +0,0 @@
-unsigned char rol(unsigned char value, unsigned char roll)
-{
- roll %= sizeof(unsigned char) * 8;
- return (value << roll) | (value >> (8 * sizeof(unsigned char) - roll));
-}
diff --git a/rushs/tinyprintf/bubble_sort/bubble_sort.c b/rushs/tinyprintf/bubble_sort/bubble_sort.c
deleted file mode 100644
index 13d2ba3..0000000
--- a/rushs/tinyprintf/bubble_sort/bubble_sort.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "bubble_sort.h"
-
-void bubble_sort(int array[], size_t size)
-{
- if (!array || size == 0)
- {
- return;
- }
-
- int mod;
- do
- {
- mod = 0;
- for (size_t i = 0; i < size - 1; i++)
- {
- if (array[i] > array[i + 1])
- {
- mod = 1;
- int tmp = array[i];
- array[i] = array[i + 1];
- array[i + 1] = tmp;
- }
- }
- } while (mod);
-}
diff --git a/rushs/tinyprintf/bubble_sort/bubble_sort.h b/rushs/tinyprintf/bubble_sort/bubble_sort.h
deleted file mode 100644
index a33d531..0000000
--- a/rushs/tinyprintf/bubble_sort/bubble_sort.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef BUBBLE_SORT_H
-#define BUBBLE_SORT_H
-
-#include <stddef.h>
-
-void bubble_sort(int array[], size_t size);
-
-#endif /* !BUBBLE_SORT_H */
diff --git a/rushs/tinyprintf/check_alphabet/check_alphabet.c b/rushs/tinyprintf/check_alphabet/check_alphabet.c
deleted file mode 100644
index fc540b4..0000000
--- a/rushs/tinyprintf/check_alphabet/check_alphabet.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "check_alphabet.h"
-
-#include <stddef.h>
-
-int check_alphabet(const char *str, const char *alphabet)
-{
- if (alphabet == NULL || *alphabet == '\0')
- {
- return 1;
- }
-
- for (int i = 0; alphabet[i]; i++)
- {
- int j;
- for (j = 0; str[j] && str[j] != alphabet[i]; j++)
- {
- continue;
- }
- if (str[j] == '\0')
- {
- return 0;
- }
- }
- return 1;
-}
diff --git a/rushs/tinyprintf/check_alphabet/check_alphabet.h b/rushs/tinyprintf/check_alphabet/check_alphabet.h
deleted file mode 100644
index 667a20f..0000000
--- a/rushs/tinyprintf/check_alphabet/check_alphabet.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef CHECK_ALPHABET_H
-#define CHECK_ALPHABET_H
-
-int check_alphabet(const char *str, const char *alphabet);
-
-#endif /* !CHECK_ALPHABET_H */
diff --git a/rushs/tinyprintf/clang-format/.clang-format b/rushs/tinyprintf/clang-format/.clang-format
deleted file mode 100644
index 7ed8115..0000000
--- a/rushs/tinyprintf/clang-format/.clang-format
+++ /dev/null
@@ -1,79 +0,0 @@
-AccessModifierOffset: -4
-AlignAfterOpenBracket: Align
-AlignConsecutiveAssignments: false
-AlignConsecutiveDeclarations: false
-AlignEscapedNewlines: Right
-AlignOperands: false
-AlignTrailingComments: false
-AllowAllParametersOfDeclarationOnNextLine: false
-AllowShortBlocksOnASingleLine: false
-AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
-AllowShortIfStatementsOnASingleLine: false
-AlwaysBreakAfterReturnType: None
-AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: Yes
-BinPackArguments: true
-BinPackParameters: true
-BreakBeforeBraces: Custom
-BraceWrapping:
- AfterEnum: true
- AfterClass: true
- AfterControlStatement: true
- AfterFunction: true
- AfterNamespace: true
- AfterStruct: true
- AfterUnion: true
- AfterExternBlock: true
- BeforeCatch: true
- BeforeElse: true
- IndentBraces: false
- SplitEmptyFunction: false
- SplitEmptyRecord: false
- SplitEmptyNamespace: false
-BreakBeforeBinaryOperators: NonAssignment
-BreakBeforeTernaryOperators: true
-BreakConstructorInitializers: BeforeComma
-BreakInheritanceList: BeforeComma
-BreakStringLiterals: true
-ColumnLimit: 80
-CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
-ConstructorInitializerIndentWidth: 4
-Cpp11BracedListStyle: false
-DerivePointerAlignment: false
-FixNamespaceComments: true
-ForEachMacros: ['ILIST_FOREACH', 'ILIST_FOREACH_ENTRY']
-IncludeBlocks: Regroup
-IncludeCategories:
- - Regex: '<.*>'
- Priority: 1
- - Regex: '.*'
- Priority: 2
-IndentCaseLabels: false
-IndentPPDirectives: AfterHash
-IndentWidth: 4
-IndentWrappedFunctionNames: false
-KeepEmptyLinesAtTheStartOfBlocks: false
-Language: Cpp
-NamespaceIndentation: All
-PointerAlignment: Right
-ReflowComments: true
-SortIncludes: true
-SortUsingDeclarations: false
-SpaceAfterCStyleCast: false
-SpaceAfterTemplateKeyword: true
-SpaceBeforeAssignmentOperators: true
-SpaceBeforeCpp11BracedList: false
-SpaceBeforeCtorInitializerColon: true
-SpaceBeforeParens: ControlStatements
-SpaceBeforeRangeBasedForLoopColon: true
-SpaceInEmptyParentheses: false
-SpacesBeforeTrailingComments: 1
-SpacesInAngles: false
-SpacesInCStyleCastParentheses: false
-SpacesInContainerLiterals: false
-SpacesInParentheses: false
-SpacesInSquareBrackets: false
-TabWidth: 4
-UseTab: Never
diff --git a/rushs/tinyprintf/clang-format/zaza.c b/rushs/tinyprintf/clang-format/zaza.c
deleted file mode 100644
index a6eec9a..0000000
--- a/rushs/tinyprintf/clang-format/zaza.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#define ZAZA_SIZE 4
-
-static char get_zaza_char(size_t id)
-{
- const int zaza[ZAZA_SIZE] = {
- 10 * 10 + 2 * 10 + 2 * 10 / 10,
- 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
-
- * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 10 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- - (1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1
- + 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1),
- 122,
- (38943 * 43 - 84393 / 34583
-
- ) % 10
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
- + 1 + 1 + 1 + 1 + 1
- };
- switch (id * 2 + 4 - 2 + id * 4 - 2 + -5 * id)
-
- {
- case (0):
- return (zaza[0]);
- case (1000 - 100 - 4 * 100 + 10 * 100 - 14 * 100 - (10 * 10 - 1)):
- return (zaza[1]);
- case (1 << 11 >> 3 << 5 >> 2 << 1 << 1 << 1 >> 1 >> 1 >> 1 << 5 >> 4 << 1
- >> 1 >> 2 >> 9):
- return zaza[2];
- case (3 ^ 100) - (100 ^ 100) - (99 - 99) - (98 - 98) - (97 - 97) - (96 - 96)
- - (95 - 95) - (94 - 94) - (93 - 93) - (92 - 92) - (91 - 91) - (90 - 90)
- - (89 - 89) - (88 - 88) - (87 - 87) - (86 - 86) - (85 - 85) - (84 - 84)
- - (83 - 83) - (82 - 82) - (81 - 81) - (80 - 80) - (79 - 79) - (78 - 78)
- - (77 - 77) - (76 - 76) - (75 - 75) - (74 - 74) - (73 - 73) - (72 - 72)
- - (71 - 71) - (70 - 70) -
-
- (69 - 69) - (68 - 68) - (67 - 67) - (66 - 66) - (65 - 65) - (64 - 64)
- - (63 - 63) - (62 - 62) - (61 - 61) - (60 - 60) - (59 - 59) - (58 - 58)
- - (57 - 57) - (56 - 56) - (55 - 55) - (54 - 54) - (53 - 53) - (52 - 52)
- - (51 - 51) - 100 - (50 - 50) - (49 - 49) - (48 - 48) - (47 - 47)
- - (46 - 46) - (45 - 45) - (44 - 44) - (43 - 43) - (42 - 42) - (41 - 41)
- - (40 - 40) - (39 - 39) - (38 - 38) - (37 - 37)
-
- - (36 - 36) - (35 - 35) - (34 - 34) - (33 - 33) - (32 - 32) - (31 - 31)
- - (30 - 30) - (29 - 29) - (28 - 28) - (27 - 27) - (26 - 26) - (25 - 25)
- - (24 - 24) - (23 - 23) - (22 - 22) - (21 - 21) - (20 - 20) - (19 - 19)
- - (18 - 18) - (17 - 17) - (16 - 16) - (15 - 15) - (14 - 14) - (13 - 13)
- - (12 - 12) - (11 - 11) - (10 - 10) - (9 - 9) - (8 - 8) - (7 - 7)
- - (6 - 6) - (5 - 5) - (4 - 4) - (3 - 3) - (2 - 2) - (1 - 1):
- return (zaza[3]);
- default:
- return (0);
- }
-}
-int main(void)
-{
- for (size_t i = 0; i < ZAZA_SIZE; i += (i % 2 == 2 - 2) ? 1 % 2 : 1 % 2)
- {
- putchar(get_zaza_char(i));
- }
- putchar('\n');
- return (0);
-}
diff --git a/rushs/tinyprintf/create_files/create_files.sh b/rushs/tinyprintf/create_files/create_files.sh
deleted file mode 100755
index 28dba00..0000000
--- a/rushs/tinyprintf/create_files/create_files.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-touch ' '
-chmod 644 ' '
-
-touch '\'
-chmod 644 '\'
-
-touch -- --
-chmod 644 -- --
-
-touch '|'
-chmod 644 '|'
-
-touch '"'
-chmod 644 '"'
-
-touch "'"
-chmod 644 "'"
-
-touch -- --\$i*\'\"\\
-chmod 644 -- --\$i*\'\"\\
-
-touch '# Exams are fun!'
-chmod 644 '# Exams are fun!'
-
-touch ";\`kill -9 0\`"
-chmod 644 ";\`kill -9 0\`"
-
-path="1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34/35/36/37/38/39/40/41/42/43/44/45/46/47/48/49/50"
-
-mkdir -p "$path"
-touch $path/farfaraway
-chmod 644 $path/farfaraway
diff --git a/rushs/tinyprintf/cut_csv/test.csv b/rushs/tinyprintf/cut_csv/test.csv
deleted file mode 100644
index d88282b..0000000
--- a/rushs/tinyprintf/cut_csv/test.csv
+++ /dev/null
@@ -1,15 +0,0 @@
-James;Lebron;LABron;Lakers;
-Davis;Anthony;Unibrow;Pelicans;
-Mitchell;Donovan;Spida;Jazz;
-Harden;James;TheBeard;Rockets;
-Cousins;DeMarcus;Boogie;Wariors;
-Embiid;Joel;TheProcess;76Sixers;
-Bryant;Kobe;BlackMamba;Lakers;
-Jordan;Michael;AirJordan;Bulls;
-Johnson;Earvin;Magic;Lakers;
-Howard;Dwight;Superman;Wizards;
-Westbrook;Russel;MrTripleDouble;Thunder;
-Durant;Kevin;KD;Wariors;
-George;Paul;PG-13;Thunder;
-Leonard;Kawhi;TheKlaw;Raptors;
-Irving;Kyrie;UncleDrew;Celtics;
diff --git a/rushs/tinyprintf/cut_csv/with_cut.sh b/rushs/tinyprintf/cut_csv/with_cut.sh
deleted file mode 100755
index 9618f00..0000000
--- a/rushs/tinyprintf/cut_csv/with_cut.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 2 ] && exit 1
-
-if ! [ -f "$1" ]; then
- exit 1
-fi
-
-if ! [ "$2" -eq "$2" ] 2> /dev/null; then
- exit 1
-fi
-
-[ "$2" -lt 0 ] && exit 1
-
-if [ "$2" -gt "$(wc -l < "$1")" ]; then
- exit 1
-fi
-
-line=$(head --lines="$2" "$1" 2> /dev/null | tail -n 1 | cut -d ';' -f 2-3 || exit 1)
-c1=$(echo "$line" | cut -d ';' -f 1)
-c2=$(echo "$line" | cut -d ';' -f 2)
-
-echo "$c1 is $c2"
diff --git a/rushs/tinyprintf/cut_csv/with_sed.sh b/rushs/tinyprintf/cut_csv/with_sed.sh
deleted file mode 100755
index fb5e1f8..0000000
--- a/rushs/tinyprintf/cut_csv/with_sed.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 2 ] && exit 1
-
-if ! [ -f "$1" ]; then
- exit 1
-fi
-
-if ! [ "$2" -eq "$2" ] 2>/dev/null; then
- exit 1
-fi
-
-[ "$2" -lt 0 ] && exit 1
-
-if [ "$2" -gt $(wc -l < "$1") ]; then
- exit 1
-fi
-
-i=1
-
-while IFS= read -r line; do
- [ "$i" -eq "$2" ] && echo "$line" | sed 's/^.*;\(.*\);\(.*\);.*;$/\1 is \2/'
- i=$(($i + 1))
-done < "$1"
diff --git a/rushs/tinyprintf/digit/digit.c b/rushs/tinyprintf/digit/digit.c
deleted file mode 100644
index 5646b13..0000000
--- a/rushs/tinyprintf/digit/digit.c
+++ /dev/null
@@ -1,13 +0,0 @@
-unsigned int digit(int n, int k)
-{
- if (n <= 0 || k <= 0)
- {
- return 0;
- }
-
- for (int i = 0; i < k - 1; i++)
- {
- n /= 10;
- }
- return n % 10;
-}
diff --git a/rushs/tinyprintf/display_square/display_square.c b/rushs/tinyprintf/display_square/display_square.c
deleted file mode 100644
index 9e834d7..0000000
--- a/rushs/tinyprintf/display_square/display_square.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdio.h>
-
-void display_square(int width)
-{
- if (width <= 0)
- {
- return;
- }
-
- if (width % 2 == 0)
- {
- width++;
- }
-
- if (width == 1)
- {
- putchar('*');
- putchar('\n');
- return;
- }
-
- for (int i = 0; i < width; i++)
- {
- putchar('*');
- }
- putchar('\n');
-
- for (int i = 0; i < ((width - 3) / 2); i++)
- {
- putchar('*');
- for (int j = 0; j < width - 2; j++)
- {
- putchar(' ');
- }
- putchar('*');
- putchar('\n');
- }
-
- for (int i = 0; i < width; i++)
- {
- putchar('*');
- }
- putchar('\n');
-}
diff --git a/rushs/tinyprintf/dlist/Makefile b/rushs/tinyprintf/dlist/Makefile
deleted file mode 100644
index 1251967..0000000
--- a/rushs/tinyprintf/dlist/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-CC = gcc
-CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
-
-SRC = dlist-1.c dlist-2.c dlist-3.c dlist-4.c
-OBJ = $(SRC:.c=.o)
-
-.PHONY: library clean
-
-library: $(OBJ)
- ar csr libdlist.a $(OBJ)
-
-clean: $(OBJ)
- $(RM) *.a $(OBJ)
-
-$(OBJ): $(SRC)
diff --git a/rushs/tinyprintf/dlist/dlist-1.c b/rushs/tinyprintf/dlist/dlist-1.c
deleted file mode 100644
index 443ebca..0000000
--- a/rushs/tinyprintf/dlist/dlist-1.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dlist.h"
-
-struct dlist *dlist_init(void)
-{
- struct dlist *res = malloc(sizeof(struct dlist));
- if (res == NULL)
- return NULL;
-
- res->size = 0;
- res->head = NULL;
- res->tail = NULL;
- return res;
-}
-
-int dlist_push_front(struct dlist *list, int element)
-{
- if (element < 0)
- return 0;
- struct dlist_item *new = malloc(sizeof(struct dlist_item));
- if (new == NULL)
- return 0;
-
- new->data = element;
- new->next = list->head;
- new->prev = NULL;
-
- if (list->size == 0)
- list->tail = new;
- else
- list->head->prev = new;
-
- list->head = new;
- list->size++;
-
- return 1;
-}
-
-void dlist_print(const struct dlist *list)
-{
- if (list->size == 0)
- return;
-
- for (struct dlist_item *i = list->head; i != list->tail; i = i->next)
- {
- printf("%d\n", i->data);
- }
- printf("%d\n", list->tail->data);
-}
-
-int dlist_push_back(struct dlist *list, int element)
-{
- if (element < 0)
- return 0;
- struct dlist_item *new = malloc(sizeof(struct dlist_item));
- if (new == NULL)
- return 0;
-
- new->data = element;
- new->prev = list->tail;
- new->next = NULL;
-
- if (list->size == 0)
- list->head = new;
- else
- list->tail->next = new;
- list->tail = new;
- list->size++;
-
- return 1;
-}
-
-size_t dlist_size(const struct dlist *list)
-{
- return list->size;
-}
diff --git a/rushs/tinyprintf/dlist/dlist-2.c b/rushs/tinyprintf/dlist/dlist-2.c
deleted file mode 100644
index 5ccdaa3..0000000
--- a/rushs/tinyprintf/dlist/dlist-2.c
+++ /dev/null
@@ -1,113 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dlist.h"
-
-int dlist_get(const struct dlist *list, size_t index)
-{
- if (index >= list->size)
- return -1;
-
- struct dlist_item *i;
- for (i = list->head; index; index--, i = i->next)
- {
- continue;
- }
-
- return i->data;
-}
-
-int dlist_insert_at(struct dlist *list, int element, size_t index)
-{
- if (index > list->size || element < 0)
- return 0;
- else if (index == list->size)
- dlist_push_back(list, element);
- else if (index == 0)
- dlist_push_front(list, element);
- else
- {
- struct dlist_item *new = malloc(sizeof(struct dlist_item));
- if (new == NULL)
- return 0;
- new->data = element;
-
- struct dlist_item *i;
- for (i = list->head; index - 1; index--, i = i->next)
- continue;
- new->next = i->next;
- i->next->prev = new;
- i->next = new;
- new->prev = i;
- list->size++;
- }
- return 1;
-}
-
-int dlist_find(const struct dlist *list, int element)
-{
- int index = 0;
- struct dlist_item *i;
- for (i = list->head; i && i->data != element; index++, i = i->next)
- continue;
- if (!i)
- return -1;
- return index;
-}
-
-int dlist_remove_at(struct dlist *list, size_t index)
-{
- if (index >= list->size)
- return -1;
- int res;
- struct dlist_item *item;
- if (list->size == 1)
- {
- item = list->head;
- res = list->head->data;
- list->head = NULL;
- list->tail = NULL;
- }
- else if (index == 0)
- {
- item = list->head;
- res = item->data;
- item->next->prev = NULL;
- list->head = item->next;
- }
- else if (index == list->size - 1)
- {
- item = list->tail;
- res = item->data;
- item->prev->next = NULL;
- list->tail = item->prev;
- }
- else
- {
- for (item = list->head; index; index--, item = item->next)
- continue;
-
- res = item->data;
- item->prev->next = item->next;
- item->next->prev = item->prev;
- }
-
- free(item);
- list->size--;
- return res;
-}
-
-void dlist_clear(struct dlist *list)
-{
- if (list->size == 0)
- return;
- for (struct dlist_item *i = list->head; i;)
- {
- struct dlist_item *tmp = i->next;
- free(i);
- i = tmp;
- }
- list->size = 0;
- list->head = NULL;
- list->tail = NULL;
-}
diff --git a/rushs/tinyprintf/dlist/dlist-3.c b/rushs/tinyprintf/dlist/dlist-3.c
deleted file mode 100644
index 22b4b52..0000000
--- a/rushs/tinyprintf/dlist/dlist-3.c
+++ /dev/null
@@ -1,83 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dlist.h"
-
-void dlist_map_square(struct dlist *list)
-{
- for (struct dlist_item *i = list->head; i; i = i->next)
- {
- i->data *= i->data;
- }
-}
-
-void dlist_reverse(struct dlist *list)
-{
- struct dlist_item *tmp;
- for (struct dlist_item *i = list->head; i; i = i->prev)
- {
- tmp = i->next;
- i->next = i->prev;
- i->prev = tmp;
- }
- tmp = list->tail;
- list->tail = list->head;
- list->head = tmp;
-}
-
-struct dlist *dlist_split_at(struct dlist *list, size_t index)
-{
- if (list->size == 0)
- return dlist_init();
- if (index >= list->size)
- {
- return NULL;
- }
-
- struct dlist *new = dlist_init();
- if (new == NULL)
- return NULL;
- new->size = list->size - index;
- list->size = index;
-
- struct dlist_item *i;
- for (i = list->head; index; index--, i = i->next)
- {
- continue;
- }
-
- new->head = i;
- new->tail = list->tail;
- list->tail = i->prev;
- if (i->prev)
- {
- i->prev->next = NULL;
- }
- else
- {
- list->head = NULL;
- }
- i->prev = NULL;
- return new;
-}
-
-void dlist_concat(struct dlist *list1, struct dlist *list2)
-{
- if (list2->head == NULL)
- return;
- if (list1->tail == NULL)
- {
- list1->head = list2->head;
- list1->tail = list2->tail;
- list1->size = list2->size;
- return;
- }
-
- list1->tail->next = list2->head;
- list2->head->prev = list1->tail;
- list1->tail = list2->tail;
- list1->size += list2->size;
- list2->size = 0;
- list2->head = NULL;
- list2->tail = NULL;
-}
diff --git a/rushs/tinyprintf/dlist/dlist-4.c b/rushs/tinyprintf/dlist/dlist-4.c
deleted file mode 100644
index 9ed7aaa..0000000
--- a/rushs/tinyprintf/dlist/dlist-4.c
+++ /dev/null
@@ -1,97 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dlist.h"
-
-size_t max(size_t a, size_t b)
-{
- if (a >= b)
- {
- return a;
- }
- return b;
-}
-
-size_t min(size_t a, size_t b)
-{
- if (a <= b)
- {
- return a;
- }
- return b;
-}
-
-size_t min_3(size_t a, size_t b, size_t c)
-{
- if (a <= b)
- {
- if (a <= c)
- {
- return a;
- }
- return c;
- }
- else
- {
- if (b <= c)
- {
- return b;
- }
- return c;
- }
-}
-
-size_t my_strlen(const int *s)
-{
- size_t i;
- for (i = 0; s[i] != -1; i++)
- {
- continue;
- }
- return i;
-}
-
-size_t levenshtein(const int *s1, const int *s2)
-{
- size_t l1 = my_strlen(s1);
- size_t l2 = my_strlen(s2);
- if (min(l1, l2) == 0)
- {
- return max(l1, l2);
- }
-
- if (s1[0] == s2[0])
- {
- return levenshtein(s1 + 1, s2 + 1);
- }
-
- size_t lev1 = levenshtein(s1 + 1, s2);
- size_t lev2 = levenshtein(s1, s2 + 1);
- size_t lev3 = levenshtein(s1 + 1, s2 + 1);
-
- return 1 + min_3(lev1, lev2, lev3);
-}
-
-int *to_str(const struct dlist *l)
-{
- int *res = malloc((l->size + 1) * sizeof(int));
- res[l->size] = -1;
- size_t j = 0;
- for (struct dlist_item *i = l->head; i; i = i->next, j++)
- {
- res[j] = i->data;
- }
- return res;
-}
-
-unsigned int dlist_levenshtein(const struct dlist *list1,
- const struct dlist *list2)
-{
- int *l1 = to_str(list1);
- int *l2 = to_str(list2);
-
- unsigned int res = levenshtein(l1, l2);
- free(l1);
- free(l2);
- return res;
-}
diff --git a/rushs/tinyprintf/dlist/dlist.h b/rushs/tinyprintf/dlist/dlist.h
deleted file mode 100644
index 97cde1a..0000000
--- a/rushs/tinyprintf/dlist/dlist.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef DLIST_H
-#define DLIST_H
-
-#include <stddef.h>
-
-struct dlist_item
-{
- int data;
- struct dlist_item *next;
- struct dlist_item *prev;
-};
-
-struct dlist
-{
- size_t size;
- struct dlist_item *head;
- struct dlist_item *tail;
-};
-
-// Threshold 1
-struct dlist *dlist_init(void);
-int dlist_push_front(struct dlist *list, int element);
-void dlist_print(const struct dlist *list);
-int dlist_push_back(struct dlist *list, int element);
-size_t dlist_size(const struct dlist *list);
-
-// Threshold 2
-int dlist_get(const struct dlist *list, size_t index);
-int dlist_insert_at(struct dlist *list, int element, size_t index);
-int dlist_find(const struct dlist *list, int element);
-int dlist_remove_at(struct dlist *list, size_t index);
-void dlist_clear(struct dlist *list);
-
-// Threshold 3
-void dlist_map_square(struct dlist *list);
-void dlist_reverse(struct dlist *list);
-struct dlist *dlist_split_at(struct dlist *list, size_t index);
-void dlist_concat(struct dlist *list1, struct dlist *list2);
-
-// Threshold 4
-unsigned int dlist_levenshtein(const struct dlist *list1,
- const struct dlist *list2);
-
-#endif /* !DLIST_H */
diff --git a/rushs/tinyprintf/element_count/element_count.c b/rushs/tinyprintf/element_count/element_count.c
deleted file mode 100644
index cec47ae..0000000
--- a/rushs/tinyprintf/element_count/element_count.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "element_count.h"
-
-size_t element_count(int *begin, int *end)
-{
- if (!begin || !end || begin >= end)
- {
- return 0;
- }
- return end - begin;
-}
diff --git a/rushs/tinyprintf/element_count/element_count.h b/rushs/tinyprintf/element_count/element_count.h
deleted file mode 100644
index 57412ed..0000000
--- a/rushs/tinyprintf/element_count/element_count.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef ELEMENT_COUNT_H
-#define ELEMENT_COUNT_H
-
-#include <stddef.h>
-
-size_t element_count(int *begin, int *end);
-
-#endif /* !ELEMENT_COUNT_H */
diff --git a/rushs/tinyprintf/evalexpr/Makefile b/rushs/tinyprintf/evalexpr/Makefile
deleted file mode 100644
index 280f19c..0000000
--- a/rushs/tinyprintf/evalexpr/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-CC = gcc
-CFLAGS = -Wall -Werror -Wextra -pedantic -std=c99 -Wvla
-AFLAGS = -fsanitize=address
-
-SRC=src/stack.c src/evalrpn.c src/shunting_yard.c src/fifo_access.c src/fifo_setup_destroy.c src/evalexpr.c
-SRC_TEST=tests/unit_tests.c
-#OBJ=src/stack.o src/evalrpn.o
-OBJ=$(SRC:.c=.o)
-#OBJ_TEST=$(SRC_TEST:.c=.o)
-
-all: $(OBJ)
- $(CC) -o evalexpr $(OBJ)
-
-$(OBJ): $(SRC)
-
-check: #$(OBJ) $(OBJ_TEST)
-# $(CC) $(CFLAGS) -o evaltest $(OBJ) $(OBJ_TEST) -lcriterion
- tests/tests.sh
-
-.PHONY: clean
-
-clean:
- rm $(OBJ) evalexpr
diff --git a/rushs/tinyprintf/evalexpr/src/evalexpr.c b/rushs/tinyprintf/evalexpr/src/evalexpr.c
deleted file mode 100644
index 5012355..0000000
--- a/rushs/tinyprintf/evalexpr/src/evalexpr.c
+++ /dev/null
@@ -1,93 +0,0 @@
-#include "evalexpr.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define BUFFER_SIZE 10
-
-char *get_input(void)
-{
- size_t r;
- char buf[BUFFER_SIZE];
- size_t size = 0;
- char *expr = malloc(size * sizeof(char) + 1);
- if (expr == NULL)
- return NULL;
- expr[0] = '\0';
- do
- {
- r = fread(buf, sizeof(char), BUFFER_SIZE - 1, stdin);
- if (r != 0)
- {
- buf[r] = '\0';
- size += r;
- char *tmp = realloc(expr, size * sizeof(char) + 1);
- if (tmp == NULL)
- {
- free(expr);
- return NULL;
- }
- expr = tmp;
- strcat(expr, buf);
- }
- } while (r != 0);
- if (size == 0)
- {
- free(expr);
- return NULL;
- }
- if (expr[size - 1] == '\n')
- expr[size - 1] = '\0';
- return expr;
-}
-
-void cleanup(char *expr, char *rpn)
-{
- free(expr);
- free(rpn);
-}
-
-int main(int argc, char **argv)
-{
- if ((argc == 2 && strcmp(argv[1], "-rpn") != 0) || (argc > 2))
- return 4;
- char *expr = get_input();
- if (expr == NULL)
- return 4;
- if (argc == 1)
- {
- char *rpn;
- int e = shunting_yard(expr, &rpn);
- if (e != 0)
- return e;
- // call shunting yard
- int retval;
- e = evalrpn(rpn, &retval);
- if (e != 0)
- {
- cleanup(expr, rpn);
- return e;
- }
- // FREE RPN
- printf("%d\n", retval);
- cleanup(expr, rpn);
- // return
- return 0;
- }
-
- if (argc == 2 && strcmp(argv[1], "-rpn") == 0)
- {
- // call rpn eval
- int retval;
- int e = evalrpn(expr, &retval);
- printf("%d\n", retval);
- // return
- free(expr);
- if (e != 0)
- return e;
- return 0;
- }
-
- return 4;
-}
diff --git a/rushs/tinyprintf/evalexpr/src/evalexpr.h b/rushs/tinyprintf/evalexpr/src/evalexpr.h
deleted file mode 100644
index d440ae1..0000000
--- a/rushs/tinyprintf/evalexpr/src/evalexpr.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef EVALEXPR_H
-#define EVALEXPR_H
-
-#include <stddef.h>
-
-#include "fifo.h"
-#include "stack.h"
-#include "stack_struct.h"
-
-enum token_type
-{
- NUMBER = 0,
- SUB = 1,
- ADD = 1,
- MOD = 2,
- DIV = 2,
- MUL = 2,
- EXP = 3,
- UN_PLUS = 4,
- UN_MINUS = 4,
- PAR_LEFT = 5,
- PAR_RIGHT = 5,
- WRONG_TOKEN = -1,
-};
-
-struct token
-{
- enum token_type type;
- int value;
-};
-
-// evalrpn
-int parse_number(const char *expr, size_t *offset);
-int get_operands(struct stack **s, int *op1, int *op2);
-int my_pow(int a, int b);
-int evalrpn(const char *expr, int *retval);
-
-// shunting yard
-int opcmp(struct token *op1, struct token *op2);
-enum token_type get_type(char op);
-int shunting_yard(const char *expr, char **rpn);
-
-#endif /* ! EVALEXPR_H */
diff --git a/rushs/tinyprintf/evalexpr/src/evalrpn.c b/rushs/tinyprintf/evalexpr/src/evalrpn.c
deleted file mode 100644
index db493eb..0000000
--- a/rushs/tinyprintf/evalexpr/src/evalrpn.c
+++ /dev/null
@@ -1,145 +0,0 @@
-#include <ctype.h>
-
-#include "evalexpr.h"
-
-int parse_number(const char *expr, size_t *offset)
-{
- for (*offset = 0;
- expr[*offset] && expr[*offset] >= '0' && expr[*offset] <= '9';
- (*offset)++)
- {
- continue;
- }
- (*offset)--;
-
- int res = 0;
- int pow = 1;
- for (size_t n = 0; n <= *offset; n++, pow *= 10)
- {
- res += (expr[*offset - n] - '0') * pow;
- }
-
- return res;
-}
-
-int get_operands(struct stack **s, int *op1, int *op2)
-{
- if (*s == NULL)
- {
- return 2;
- }
- *op1 = stack_peek(*s);
- *s = stack_pop(*s);
- if (*s == NULL)
- {
- return 2;
- }
- *op2 = stack_peek(*s);
- *s = stack_pop(*s);
- return 0;
-}
-
-// Computes a to the bth
-int my_pow(int a, int b)
-{
- if (b == 0)
- {
- return 1;
- }
- if (a == 0)
- {
- return 0;
- }
-
- int res = 1;
- int c = b / 2;
- while (c != 0)
- {
- res *= a * a;
- c /= 2;
- }
- if (b % 2 != 0)
- res *= a;
- return res;
-}
-
-int dispatch(const char c, struct stack **s, int op1, int op2)
-{
- switch (c)
- {
- case '*':
- *s = stack_push(*s, op1 * op2);
- break;
- case '+':
- *s = stack_push(*s, op1 + op2);
- break;
- case '-':
- *s = stack_push(*s, op2 - op1);
- break;
- case '/':
- if (op1 == 0)
- {
- return 3;
- }
- *s = stack_push(*s, op2 / op1);
- break;
- case '%':
- if (op1 == 0)
- {
- return 3;
- }
- *s = stack_push(*s, op2 % op1);
- break;
- case '^':
- if (op1 < 0)
- {
- return 3;
- }
- *s = stack_push(*s, my_pow(op2, op1));
- break;
- default:
- return 1;
- }
- return 0;
-}
-
-int evalrpn(const char *expr, int *retval)
-{
- struct stack *s = NULL;
-
- for (size_t i = 0; expr[i]; i++)
- {
- if (expr[i] >= '0' && expr[i] <= '9')
- {
- size_t offset;
- int val = parse_number(expr + i, &offset);
- s = stack_push(s, val);
- i += offset;
- }
- else if (isspace(expr[i]))
- continue;
- else
- {
- int op1;
- int op2;
- if (get_operands(&s, &op1, &op2) == 2)
- {
- return 2;
- }
-
- int d = dispatch(expr[i], &s, op1, op2);
- if (d != 0)
- {
- return d;
- }
- }
- }
-
- if (s == NULL)
- {
- return 0;
- }
- *retval = stack_peek(s);
- s = stack_pop(s);
- return (!s) ? 0 : 2;
-}
diff --git a/rushs/tinyprintf/evalexpr/src/fifo.h b/rushs/tinyprintf/evalexpr/src/fifo.h
deleted file mode 100644
index b330eac..0000000
--- a/rushs/tinyprintf/evalexpr/src/fifo.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef FIFO_H
-#define FIFO_H
-
-#include <stddef.h>
-
-#include "evalexpr.h"
-
-struct list
-{
- struct token *data;
- struct list *next;
-};
-
-struct fifo
-{
- struct list *head;
- struct list *tail;
- size_t size;
-};
-
-struct fifo *fifo_init(void);
-size_t fifo_size(struct fifo *fifo);
-void fifo_push(struct fifo *fifo, struct token *elt);
-struct token *fifo_head(struct fifo *fifo);
-void fifo_pop(struct fifo *fifo);
-void fifo_clear(struct fifo *fifo);
-void fifo_destroy(struct fifo *fifo);
-
-#endif /* !FIFO_H */
diff --git a/rushs/tinyprintf/evalexpr/src/fifo_access.c b/rushs/tinyprintf/evalexpr/src/fifo_access.c
deleted file mode 100644
index 1986a09..0000000
--- a/rushs/tinyprintf/evalexpr/src/fifo_access.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "fifo.h"
-
-size_t fifo_size(struct fifo *fifo)
-{
- return fifo->size;
-}
-
-void fifo_push(struct fifo *fifo, struct token *elt)
-{
- struct list *new = malloc(sizeof(struct list));
- if (new == NULL)
- {
- return;
- }
- new->data = elt;
-
- if (fifo_size(fifo) == 0)
- {
- fifo->head = new;
- }
- new->next = NULL;
- if (fifo_size(fifo) != 0)
- {
- fifo->tail->next = new;
- }
- fifo->tail = new;
-
- fifo->size++;
-}
-
-struct token *fifo_head(struct fifo *fifo)
-{
- return fifo->head->data;
-}
-
-void fifo_pop(struct fifo *fifo)
-{
- if (fifo_size(fifo) == 0)
- {
- return;
- }
- if (fifo_size(fifo) == 1)
- {
- free(fifo->head->data);
- free(fifo->head);
- fifo->head = NULL;
- fifo->tail = NULL;
- fifo->size = 0;
- return;
- }
-
- struct list *tmp = fifo->head->next;
- free(fifo->head->data);
- free(fifo->head);
- fifo->head = tmp;
-
- fifo->size--;
-}
diff --git a/rushs/tinyprintf/evalexpr/src/fifo_setup_destroy.c b/rushs/tinyprintf/evalexpr/src/fifo_setup_destroy.c
deleted file mode 100644
index 0f99ad0..0000000
--- a/rushs/tinyprintf/evalexpr/src/fifo_setup_destroy.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdlib.h>
-
-#include "fifo.h"
-
-struct fifo *fifo_init(void)
-{
- struct fifo *f = malloc(sizeof(struct fifo));
- if (f == NULL)
- {
- return NULL;
- }
-
- f->size = 0;
- f->head = NULL;
- f->tail = NULL;
-
- return f;
-}
-
-void fifo_clear(struct fifo *fifo)
-{
- for (struct list *l = fifo->head; l != fifo->tail;)
- {
- struct list *tmp = l->next;
- free(l->data);
- free(l);
- l = tmp;
- }
- if (fifo->tail)
- {
- free(fifo->tail->data);
- free(fifo->tail);
- }
-
- fifo->head = NULL;
- fifo->tail = NULL;
- fifo->size = 0;
-}
-
-void fifo_destroy(struct fifo *fifo)
-{
- fifo_clear(fifo);
- free(fifo);
-}
diff --git a/rushs/tinyprintf/evalexpr/src/shunting_yard.c b/rushs/tinyprintf/evalexpr/src/shunting_yard.c
deleted file mode 100644
index 2db5fc8..0000000
--- a/rushs/tinyprintf/evalexpr/src/shunting_yard.c
+++ /dev/null
@@ -1,199 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "evalexpr.h"
-
-enum assoc
-{
- NONE,
- RIGHT,
- LEFT,
-};
-
-int opcmp(struct token *op1, struct token *op2)
-{
- return op1->type - op2->type;
-}
-
-enum assoc get_assoc(struct token *op)
-{
- if (op->type == EXP)
- {
- return RIGHT;
- }
- return LEFT;
-}
-
-enum token_type get_type(char op)
-{
- switch (op)
- {
- case '*':
- return MUL;
- case '/':
- return DIV;
- case '-':
- return SUB;
- case '+':
- return ADD;
- case '%':
- return MOD;
- case '^':
- return EXP;
- case '(':
- return PAR_LEFT;
- case ')':
- return PAR_RIGHT;
- default:
- return WRONG_TOKEN;
- }
-}
-
-char *fifo_to_expr(struct fifo *output, size_t size_offset)
-{
- char *res = malloc((2 * fifo_size(output) + size_offset) * sizeof(char));
- if (!res)
- {
- fifo_destroy(output);
- return NULL;
- }
- res[2 * fifo_size(output) + size_offset - 1] = '\0';
- size_t i = 0;
- while (fifo_size(output) > 0)
- {
- if (fifo_head(output)->type == NUMBER)
- {
- i += sprintf(res + i, "%d", fifo_head(output)->value) - 1;
- }
- else
- {
- res[i] = fifo_head(output)->value;
- }
- fifo_pop(output);
- i++;
- if (fifo_size(output) != 0)
- {
- res[i] = ' ';
- i++;
- }
- }
- fifo_destroy(output);
- return res;
-}
-
-int handle_rpar(struct tstack **opstack, struct fifo *output, struct token **t)
-{
- while (*opstack)
- {
- struct token *o2 = tstack_peek(*opstack);
- if (o2->value == '(')
- {
- free(o2);
- break;
- }
- *opstack = tstack_pop(*opstack);
- fifo_push(output, o2);
- }
- if (*opstack == NULL)
- {
- free(*t);
- fifo_destroy(output);
- return 2;
- }
- free(*t);
- *opstack = tstack_pop(*opstack);
- return 0;
-}
-
-int empty_opstack(struct tstack **opstack, struct fifo *output)
-{
- while (*opstack)
- {
- struct token *t = tstack_peek(*opstack);
- if (t->value == '(' || t->value == ')')
- {
- fifo_destroy(output);
- return 1;
- }
- *opstack = tstack_pop(*opstack);
- fifo_push(output, t);
- }
- return 0;
-}
-
-void pop_ops(struct tstack **opstack, struct fifo *output, struct token *t)
-{
- while (*opstack)
- {
- struct token *o2 = tstack_peek(*opstack);
- if (!(o2->value != '('
- && (opcmp(t, o2) < 0
- || (opcmp(t, o2) == 0 && get_assoc(t) == LEFT))))
- {
- break;
- }
-
- *opstack = tstack_pop(*opstack);
- fifo_push(output, o2);
- }
-}
-
-void handle_numbers(struct fifo *output, size_t *i, int *size_offset,
- const char *expr)
-{
- size_t offset;
- int val = parse_number(expr + *i, &offset);
- struct token *t = malloc(sizeof(struct token));
- t->type = NUMBER;
- t->value = val;
- fifo_push(output, t);
- *i += offset;
- *size_offset += offset;
-}
-
-int shunting_yard(const char *expr, char **rpn)
-{
- struct fifo *output = fifo_init();
- struct tstack *opstack = NULL;
- int size_offset = 0;
- for (size_t i = 0; expr[i]; i++)
- {
- if (expr[i] >= '0' && expr[i] <= '9')
- {
- handle_numbers(output, &i, &size_offset, expr);
- }
- else if (expr[i] != ' ')
- {
- struct token *t = malloc(sizeof(struct token));
- t->value = expr[i];
- if ((t->type = get_type(expr[i])) == WRONG_TOKEN)
- {
- free(t);
- return 1;
- }
- if (t->value == '(')
- {
- opstack = tstack_push(opstack, t);
- continue;
- }
- else if (t->value == ')')
- {
- if (handle_rpar(&opstack, output, &t) != 0)
- return 2;
- continue;
- }
- pop_ops(&opstack, output, t);
- opstack = tstack_push(opstack, t);
- }
- }
-
- if (empty_opstack(&opstack, output) != 0)
- {
- return 1;
- }
- *rpn = fifo_to_expr(output, size_offset);
- if (!*rpn)
- return 4;
-
- return 0;
-}
diff --git a/rushs/tinyprintf/evalexpr/src/stack.c b/rushs/tinyprintf/evalexpr/src/stack.c
deleted file mode 100644
index 14f659e..0000000
--- a/rushs/tinyprintf/evalexpr/src/stack.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "stack.h"
-
-#include <stdlib.h>
-
-struct stack *stack_push(struct stack *s, int e)
-{
- struct stack *new = malloc(sizeof(struct stack));
- new->data = e;
- new->next = NULL;
-
- new->next = s;
- return new;
-}
-
-struct stack *stack_pop(struct stack *s)
-{
- if (s == NULL)
- {
- return NULL;
- }
-
- struct stack *res = s->next;
- free(s);
- return res;
-}
-
-int stack_peek(struct stack *s)
-{
- return s->data;
-}
-
-struct tstack *tstack_push(struct tstack *s, struct token *e)
-{
- struct tstack *new = malloc(sizeof(struct tstack));
- new->token = e;
- new->next = NULL;
-
- new->next = s;
- return new;
-}
-
-struct tstack *tstack_pop(struct tstack *s)
-{
- if (s == NULL)
- {
- return NULL;
- }
-
- struct tstack *res = s->next;
- free(s);
- return res;
-}
-
-struct token *tstack_peek(struct tstack *s)
-{
- return s->token;
-}
diff --git a/rushs/tinyprintf/evalexpr/src/stack.h b/rushs/tinyprintf/evalexpr/src/stack.h
deleted file mode 100644
index d08e465..0000000
--- a/rushs/tinyprintf/evalexpr/src/stack.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef STACK_H
-#define STACK_H
-
-#include "evalexpr.h"
-#include "stack_struct.h"
-
-struct tstack
-{
- struct token *token;
- struct tstack *next;
-};
-
-struct stack *stack_push(struct stack *s, int e);
-struct stack *stack_pop(struct stack *s);
-int stack_peek(struct stack *s);
-
-struct tstack *tstack_push(struct tstack *s, struct token *e);
-struct tstack *tstack_pop(struct tstack *s);
-struct token *tstack_peek(struct tstack *s);
-#endif /* !STACK_H */
diff --git a/rushs/tinyprintf/evalexpr/src/stack_struct.h b/rushs/tinyprintf/evalexpr/src/stack_struct.h
deleted file mode 100644
index 105cd5d..0000000
--- a/rushs/tinyprintf/evalexpr/src/stack_struct.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef STACK_STRUCT_H
-#define STACK_STRUCT_H
-
-struct stack
-{
- int data;
- struct stack *next;
-};
-
-#endif /* ! STACK_STRUCT_H */
diff --git a/rushs/tinyprintf/evalexpr/tests/tests.sh b/rushs/tinyprintf/evalexpr/tests/tests.sh
deleted file mode 100755
index 920f09b..0000000
--- a/rushs/tinyprintf/evalexpr/tests/tests.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-
-REF_OUT="ref.out"
-TEST_OUT="test.out"
-
-testrpn()
-{
- echo "$2" > "$REF_OUT"
- echo "Evaluating '$1' in RPN notation..."
- echo "$1" | ./evalexpr -rpn > "$TEST_OUT"
- diff "$REF_OUT" "$TEST_OUT" && echo "Success"
-}
-
-testeval()
-{
- echo "$1" | bc 2> /dev/null > "$REF_OUT"
- echo "Evaluating '$1' in standard notation..."
- echo "$1" | ./evalexpr > "$TEST_OUT"
- diff "$REF_OUT" "$TEST_OUT" && echo "Success"
-}
-
-testerror()
-{
- echo "Testing error code '$2'..."
- echo "$1" | ./evalexpr
- error="$(echo $?)"
- [ "$2" -eq "$error" ] && echo "Succesful failure" || echo "Wrong error $error"
-}
-
-clean()
-{
- rm "$REF_OUT" "$TEST_OUT"
-}
-
-# RPN
-
-echo "Tests for RPN:"
-echo "======"
-
-testrpn "1 1 +" 2
-testrpn "5 2 2 ^ 3 + *" 35
-testrpn "10 6 9 3 + 0 11 - * / * 17 + 5 +" 22
-testrpn "3 4 5 * 3 + -" "-20"
-testrpn "3 2 % 9 3 1 2 + * / -" 0
-
-echo
-echo "============================================="
-echo
-
-# Standard
-
-echo "Tests for standard notation:"
-echo "======"
-
-testeval "1 + 1"
-testeval " 1 + 1 +1 "
-testeval "2 * 2"
-testeval "5 * (2 + 4)"
-testeval "5 * (2 % 4)"
-testeval " 5 *(2 ^4) "
-testeval " 5 *(2 ^4 "
-
-echo
-echo "============================================="
-echo
-
-# Errors
-
-echo "Error tests:"
-echo "======"
-
-testerror "" 0
-testerror "a+1" 1
-testerror "1%0" 3
-
-echo "Testing error code '4'..."
-./evalexpr --toto 2> /dev/null
-echo $?
-
-# Cleanup
-
-clean
diff --git a/rushs/tinyprintf/evalexpr/tests/unit_tests.c b/rushs/tinyprintf/evalexpr/tests/unit_tests.c
deleted file mode 100644
index ed445a0..0000000
--- a/rushs/tinyprintf/evalexpr/tests/unit_tests.c
+++ /dev/null
@@ -1,208 +0,0 @@
-#include <criterion/criterion.h>
-#include <criterion/assert.h>
-#include <stddef.h>
-#include <string.h>
-
-#include "../src/evalexpr.h"
-
-TestSuite(parse_number);
-
-Test(parse_number, parse_42)
-{
- size_t o;
- int actual = parse_number("42", &o);
- cr_expect(actual == 42, "Attendu : %d, renvoyé : %d", 42, actual);
- cr_expect(o == 1, "Décalage attendu : %d, renvoyé : %zu", 1, o);
-}
-
-Test(parse_number, parse_4)
-{
- size_t o;
- int actual = parse_number("4", &o);
- cr_expect(actual == 4, "Attendu : %d, renvoyé : %d", 4, actual);
- cr_expect(o == 0, "Décalage attendu : %d, renvoyé : %zu", 0, o);
-}
-
-TestSuite(my_pow);
-
-Test(my_pow, my_pow00)
-{
- int actual = my_pow(0, 0);
- cr_expect(actual == 1, "Attendu : %d, renvoyé : %d", 1, actual);
-}
-
-Test(my_pow, my_pown0)
-{
- int actual = my_pow(50, 0);
- cr_expect(actual == 1, "Attendu : %d, renvoyé : %d", 1, actual);
-}
-Test(my_pow, my_pow0n)
-{
- int actual = my_pow(0, 42);
- cr_expect(actual == 0, "Attendu : %d, renvoyé : %d", 0, actual);
-}
-Test(my_pow, my_powab)
-{
- int actual = my_pow(3,3);
- cr_expect(actual == 27, "Attendu : %d, renvoyé : %d", 27, actual);
-}
-Test(my_pow, my_powab_2)
-{
- int actual = my_pow(4, 2);
- cr_expect(actual == 16, "Attendu : %d, renvoyé : %d", 16, actual);
-}
-Test(my_pow, my_powab_3)
-{
- int actual = my_pow(10, 3);
- cr_expect(actual == 1000, "Attendu : %d, renvoyé : %d", 1000, actual);
-}
-Test(my_pow, my_pow1n)
-{
- int actual = my_pow(1, 50);
- cr_expect(actual == 1, "Attendu : %d, renvoyé : %d", 1, actual);
-}
-
-TestSuite(RPN);
-
-Test(RPN, evalrpn_easiest)
-{
- const char test[] = "1 1 +";
- int expected = 0;
- int retval;
- int res = 2;
- int actual = evalrpn(test, &retval);
- cr_expect(actual == expected, "%s => Retour attendu : %d, renvoyé : %d", test, expected, actual);
- cr_expect(retval == res, "%s => Résultat attendu : %d, reçu : %d", test, res, retval);
-}
-Test(RPN, evalrpn_35)
-{
- const char test[] = "5 2 2 ^ 3 + *";
- int expected = 0;
- int retval;
- int res = 35;
- int actual = evalrpn(test, &retval);
- cr_expect(actual == expected, "%s => Retour attendu : %d, renvoyé : %d", test, expected, actual);
- cr_expect(retval == res, "%s => Résultat attendu : %d, reçu : %d", test, res, retval);
-}
-Test(RPN, evalrpn_22)
-{
- const char test[] = "10 6 9 3 + 0 11 - * / * 17 + 5 +";
- int expected = 0;
- int retval;
- int res = 22;
- int actual = evalrpn(test, &retval);
- cr_expect(actual == expected, "%s => Retour attendu : %d, renvoyé : %d", test, expected, actual);
- cr_expect(retval == res, "%s => Résultat attendu : %d, reçu : %d", test, res, retval);
-}
-Test(RPN, evalrpn_minus20)
-{
- const char test[] = "3 4 5 * 3 + -";
- int expected = 0;
- int retval;
- int res = -20;
- int actual = evalrpn(test, &retval);
- cr_expect(actual == expected, "%s => Retour attendu : %d, renvoyé : %d", test, expected, actual);
- cr_expect(retval == res, "%s => Résultat attendu : %d, reçu : %d", test, res, retval);
-}
-Test(RPN, evalrpn_zero)
-{
- const char test[] = "3 2 % 9 3 1 2 + * / -";
- int expected = 0;
- int retval;
- int res = 0;
- int actual = evalrpn(test, &retval);
- cr_expect(actual == expected, "%s => Retour attendu : %d, renvoyé : %d", test, expected, actual);
- cr_expect(retval == res, "%s => Résultat attendu : %d, reçu : %d", test, res, retval);
-}
-
-TestSuite(Precedence);
-
-Test(Precedence, parenthesis_above_all)
-{
- struct token pleft = { PAR_LEFT, '(' };
- struct token pright = { PAR_RIGHT, ')' };
- struct token unplus = { UN_PLUS, '+' };
- struct token exp = { EXP, '^' };
- struct token mul = { MUL, '*' };
- struct token minus = { SUB, '-' };
- int eq = opcmp(&pleft, &pright);
- int sup = opcmp(&pleft, &unplus);
- int inf = opcmp(&unplus, &pright);
- int parftw = opcmp(&pleft, &exp);
- int par4ever = opcmp(&pright, &mul);
- int paragain = opcmp(&pright, &minus);
- cr_expect(eq == 0, "Wrong order (equal)");
- cr_expect(sup > 0, "Wrong order (>)");
- cr_expect(inf < 0, "Wrong order (<)");
- cr_expect(parftw > 0, "Wrong order (>)");
- cr_expect(par4ever > 0, "Wrong order (>)");
- cr_expect(paragain > 0, "Wrong order (>)");
-}
-
-Test(Precedence, other_precedence_tests)
-{
- struct token exp = { EXP, '^' };
- struct token mul = { MUL, '*' };
- struct token unplus = { UN_PLUS, '+' };
- struct token minus = { SUB, '-' };
- struct token plus = { ADD, '+' };
- int eq = opcmp(&minus, &plus);
- int sup = opcmp(&exp, &mul);
- int inf = opcmp(&plus, &unplus);
-
- cr_expect(eq == 0, "Wrong order (equal)");
- cr_expect(sup > 0, "Wrong order (>)");
- cr_expect(inf < 0, "Wrong order (<)");
-}
-
-TestSuite(ShuntingTests);
-
-Test(ShuntingTests, shunt_simplest)
-{
- char *rpn;
- const char *expr = "1 + 1";
- int actual = shunting_yard(expr, &rpn);
- cr_expect(actual == 0, "Expected shunting_yard return value %d, got %d", 0, actual);
- cr_expect(strcmp(rpn, "1 1 +") == 0, "Expected '1 1 +', got %s", rpn);
- free(rpn);
-}
-
-Test(ShuntingTests, shunt_nico)
-{
- char *rpn;
- const char *expr = "1 + 1 + 1";
- int actual = shunting_yard(expr, &rpn);
- cr_expect(actual == 0, "Expected shunting_yard return value %d, got %d", 0, actual);
- cr_expect(strcmp(rpn, "1 1 + 1 +") == 0, "Expected '1 1 + 1 +', got %s", rpn);
- free(rpn);
-}
-
-Test(ShuntingTests, shunt_harderdaddy)
-{
- char *rpn;
- const char *expr = "5*(2^2+3)";
- int actual = shunting_yard(expr, &rpn);
- cr_expect(actual == 0, "Expected shunting_yard return value %d, got %d", 0, actual);
- cr_expect(strcmp(rpn, "5 2 2 ^ 3 + *") == 0, "Expected '5 2 2 ^ 3 + *', got %s", rpn);
- free(rpn);
-}
-
-Test(ShuntingTests, shunt_numbers)
-{
- char *rpn;
- const char *expr = "42 + 50";
- int actual = shunting_yard(expr, &rpn);
- cr_expect(actual == 0, "Expected shunting_yard return value %d, got %d", 0, actual);
- cr_expect(strcmp(rpn, "42 50 +") == 0, "Expected '42 50 +', got %s", rpn);
- free(rpn);
-}
-
-Test(ShuntingTests, shunt_mod)
-{
- char *rpn;
- const char *expr = "42 % 50";
- int actual = shunting_yard(expr, &rpn);
- cr_expect(actual == 0, "Expected shunting_yard return value %d, got %d", 0, actual);
- cr_expect(strcmp(rpn, "42 50 %") == 0, "Expected '42 50 +', got %s", rpn);
- free(rpn);
-}
diff --git a/rushs/tinyprintf/fact/fact.c b/rushs/tinyprintf/fact/fact.c
deleted file mode 100644
index 1440c94..0000000
--- a/rushs/tinyprintf/fact/fact.c
+++ /dev/null
@@ -1,8 +0,0 @@
-unsigned long fact(unsigned n)
-{
- if (n == 0)
- {
- return 1;
- }
- return n * fact(n - 1);
-}
diff --git a/rushs/tinyprintf/facto/facto.sh b/rushs/tinyprintf/facto/facto.sh
deleted file mode 100755
index 350973a..0000000
--- a/rushs/tinyprintf/facto/facto.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 1 ] && exit 1
-i=$1
-res=1
-while [ "$i" -gt 0 ]; do
- res=$(($res * $i))
- i=$(($i - 1))
-done
-echo "$res"
diff --git a/rushs/tinyprintf/fibo/fibo.c b/rushs/tinyprintf/fibo/fibo.c
deleted file mode 100644
index 99c0d79..0000000
--- a/rushs/tinyprintf/fibo/fibo.c
+++ /dev/null
@@ -1,8 +0,0 @@
-unsigned long fibonacci(unsigned long n)
-{
- if (n == 0 || n == 1)
- {
- return n;
- }
- return fibonacci(n - 1) + fibonacci(n - 2);
-}
diff --git a/rushs/tinyprintf/fibo_iter/fibo_iter.c b/rushs/tinyprintf/fibo_iter/fibo_iter.c
deleted file mode 100644
index 36ebf46..0000000
--- a/rushs/tinyprintf/fibo_iter/fibo_iter.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <stdio.h>
-
-unsigned long fibo_iter(unsigned long n)
-{
- if (n == 0)
- {
- return 0;
- }
- unsigned long prev = 1;
- unsigned long pprev = 0;
- unsigned long i;
-
- for (i = 1; i < n; i++)
- {
- unsigned long next = pprev + prev;
- pprev = prev;
- prev = next;
- }
-
- return prev;
-}
diff --git a/rushs/tinyprintf/fifo/Makefile b/rushs/tinyprintf/fifo/Makefile
deleted file mode 100644
index e5c9374..0000000
--- a/rushs/tinyprintf/fifo/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-CC=gcc
-CFLAGS=-std=c99 -Wall -Wextra -Wvla -Werror -pedantic
-
-.PHONY: library clean
-
-library: fifo_access.o fifo_setup_destroy.o
- ar csr libfifo.a $^
-
-fifo_access.o: fifo_access.c
- $(CC) $(CFLAGS) -c -o fifo_access.o fifo_access.c
-
-fifo_setup_destroy.o: fifo_setup_destroy.c
- $(CC) $(CFLAGS) -c -o fifo_setup_destroy.o fifo_setup_destroy.c
-
-clean:
- rm *.o libfifo.a
diff --git a/rushs/tinyprintf/fifo/fifo.h b/rushs/tinyprintf/fifo/fifo.h
deleted file mode 100644
index c4b0a6f..0000000
--- a/rushs/tinyprintf/fifo/fifo.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef FIFO_H
-#define FIFO_H
-
-#include <stddef.h>
-
-struct list
-{
- int data;
- struct list *next;
-};
-
-struct fifo
-{
- struct list *head;
- struct list *tail;
- size_t size;
-};
-
-struct fifo *fifo_init(void);
-size_t fifo_size(struct fifo *fifo);
-void fifo_push(struct fifo *fifo, int elt);
-int fifo_head(struct fifo *fifo);
-void fifo_pop(struct fifo *fifo);
-void fifo_clear(struct fifo *fifo);
-void fifo_destroy(struct fifo *fifo);
-void fifo_print(const struct fifo *fifo);
-
-#endif /* !FIFO_H */
diff --git a/rushs/tinyprintf/fifo/fifo_access.c b/rushs/tinyprintf/fifo/fifo_access.c
deleted file mode 100644
index 5d31586..0000000
--- a/rushs/tinyprintf/fifo/fifo_access.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "fifo.h"
-
-size_t fifo_size(struct fifo *fifo)
-{
- return fifo->size;
-}
-
-void fifo_push(struct fifo *fifo, int elt)
-{
- struct list *new = malloc(sizeof(struct list));
- if (new == NULL)
- {
- return;
- }
- new->data = elt;
-
- if (fifo_size(fifo) == 0)
- {
- fifo->head = new;
- }
- new->next = NULL;
- if (fifo_size(fifo) != 0)
- {
- fifo->tail->next = new;
- }
- fifo->tail = new;
-
- fifo->size++;
-}
-
-int fifo_head(struct fifo *fifo)
-{
- return fifo->head->data;
-}
-
-void fifo_pop(struct fifo *fifo)
-{
- if (fifo_size(fifo) == 0)
- {
- return;
- }
- if (fifo_size(fifo) == 1)
- {
- free(fifo->head);
- fifo->head = NULL;
- fifo->tail = NULL;
- return;
- }
-
- struct list *tmp = fifo->head->next;
- free(fifo->head);
- fifo->head = tmp;
-
- fifo->size--;
-}
-
-void fifo_print(const struct fifo *fifo)
-{
- for (struct list *l = fifo->head; l; l = l->next)
- {
- printf("%d\n", l->data);
- }
-}
diff --git a/rushs/tinyprintf/fifo/fifo_setup_destroy.c b/rushs/tinyprintf/fifo/fifo_setup_destroy.c
deleted file mode 100644
index 80820e1..0000000
--- a/rushs/tinyprintf/fifo/fifo_setup_destroy.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdlib.h>
-
-#include "fifo.h"
-
-struct fifo *fifo_init(void)
-{
- struct fifo *f = malloc(sizeof(struct fifo));
- if (f == NULL)
- {
- return NULL;
- }
-
- f->size = 0;
- f->head = NULL;
- f->tail = NULL;
-
- return f;
-}
-
-void fifo_clear(struct fifo *fifo)
-{
- for (struct list *l = fifo->head; l != fifo->tail;)
- {
- struct list *tmp = l->next;
- free(l);
- l = tmp;
- }
- free(fifo->tail);
-
- fifo->head = NULL;
- fifo->tail = NULL;
- fifo->size = 0;
-}
-
-void fifo_destroy(struct fifo *fifo)
-{
- fifo_clear(fifo);
- free(fifo);
-}
diff --git a/rushs/tinyprintf/find_ascii/find_ascii.sh b/rushs/tinyprintf/find_ascii/find_ascii.sh
deleted file mode 100755
index db31722..0000000
--- a/rushs/tinyprintf/find_ascii/find_ascii.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-for filename in $(ls "$1"); do
- echo $1/$filename | file -f - | grep ASCII
-done
diff --git a/rushs/tinyprintf/freq_analysis/freq_analysis.c b/rushs/tinyprintf/freq_analysis/freq_analysis.c
deleted file mode 100644
index c60d7a6..0000000
--- a/rushs/tinyprintf/freq_analysis/freq_analysis.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <stdio.h>
-
-int find_rank(int h[26], int min)
-{
- int res = 0;
- for (int i = 0; i < 26; i++)
- {
- res += h[i] > h[min] || (h[i] == h[min] && i < min);
- }
- return res;
-}
-
-void freq_analysis(const char text[], const char table[])
-{
- int h[26] = { 0 };
- for (int i = 0; text[i]; i++)
- {
- h[text[i] - 'A']++;
- }
-
- for (int j = 0; j < 26; j++)
- {
- if (h[j] != 0)
- {
- printf("%c %c\n", j + 'A', table[find_rank(h, j)]);
- }
- }
-}
diff --git a/rushs/tinyprintf/functional_programming/foldl.c b/rushs/tinyprintf/functional_programming/foldl.c
deleted file mode 100644
index ac222a7..0000000
--- a/rushs/tinyprintf/functional_programming/foldl.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "functional_programming.h"
-
-int foldl(int *array, size_t len, int (*func)(int, int))
-{
- int acc = 0;
- for (size_t i = 0; i < len; i++)
- {
- acc = (*func)(acc, array[i]);
- }
- return acc;
-}
diff --git a/rushs/tinyprintf/functional_programming/foldr.c b/rushs/tinyprintf/functional_programming/foldr.c
deleted file mode 100644
index c232410..0000000
--- a/rushs/tinyprintf/functional_programming/foldr.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "functional_programming.h"
-
-int foldr(int *array, size_t len, int (*func)(int, int))
-{
- if (len == 1)
- {
- return (*func)(array[0], 0);
- }
- return (*func)(array[0], foldr(array + 1, len - 1, func));
-}
diff --git a/rushs/tinyprintf/functional_programming/functional_programming.h b/rushs/tinyprintf/functional_programming/functional_programming.h
deleted file mode 100644
index 429b13c..0000000
--- a/rushs/tinyprintf/functional_programming/functional_programming.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef FUNCTIONAL_PROGRAMMING_H
-#define FUNCTIONAL_PROGRAMMING_H
-
-#include <stddef.h>
-
-void map(int *array, size_t len, void (*func)(int *));
-int foldr(int *array, size_t len, int (*func)(int, int));
-int foldl(int *array, size_t len, int (*func)(int, int));
-
-#endif /* !FUNCTIONAL_PROGRAMMING_H */
diff --git a/rushs/tinyprintf/functional_programming/map.c b/rushs/tinyprintf/functional_programming/map.c
deleted file mode 100644
index 311c39c..0000000
--- a/rushs/tinyprintf/functional_programming/map.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "functional_programming.h"
-
-void map(int *array, size_t len, void (*func)(int *))
-{
- for (size_t i = 0; i < len; i++)
- {
- (*func)(array + i);
- }
-}
diff --git a/rushs/tinyprintf/generate_files/generate_files.sh b/rushs/tinyprintf/generate_files/generate_files.sh
deleted file mode 100755
index cf2ba0a..0000000
--- a/rushs/tinyprintf/generate_files/generate_files.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-FILENAME="default"
-NUMBER="1"
-EXTENSION="txt"
-
-while [ $# -gt 0 ]; do
- case "$1" in
- '-f' | '--filename')
- shift
- FILENAME="$1"
- shift
- ;;
- '-n' | '--number')
- shift
- NUMBER="$1"
- shift
- ;;
- '-e' | '--extension')
- shift
- EXTENSION="$1"
- shift
- ;;
- *)
- exit 1
- ;;
- esac
-done
-
-for i in $(seq 1 $NUMBER); do
- touch -- "$FILENAME-$i.$EXTENSION"
-done
diff --git a/rushs/tinyprintf/generic_void_list/list.c b/rushs/tinyprintf/generic_void_list/list.c
deleted file mode 100644
index 20ecfa8..0000000
--- a/rushs/tinyprintf/generic_void_list/list.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "list.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-struct list *list_prepend(struct list *list, const void *value,
- size_t data_size)
-{
- struct list *new = malloc(sizeof(struct list));
- new->next = list;
- new->data = malloc(sizeof(void *));
- memcpy(new->data, value, data_size);
- return new;
-}
-
-size_t list_length(struct list *list)
-{
- size_t res = 0;
- while (list)
- {
- res++;
- list = list->next;
- }
- return res;
-}
-
-void list_destroy(struct list *list)
-{
- while (list)
- {
- struct list *tmp = list->next;
- free(list->data);
- free(list);
- list = tmp;
- }
-}
diff --git a/rushs/tinyprintf/generic_void_list/list.h b/rushs/tinyprintf/generic_void_list/list.h
deleted file mode 100644
index a1bc035..0000000
--- a/rushs/tinyprintf/generic_void_list/list.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef LIST_H
-#define LIST_H
-
-#include <stddef.h>
-
-struct list
-{
- void *data;
- struct list *next;
-};
-
-/*
-** Insert a node containing `value` at the beginning of the list.
-** Return `NULL` if an error occurred.
-*/
-struct list *list_prepend(struct list *list, const void *value,
- size_t data_size);
-
-/*
-** Return the length of the list.
-** Return `0` if the list is empty.
-*/
-size_t list_length(struct list *list);
-
-/*
-** Release the memory used by the list.
-** Does nothing if `list` is `NULL`.
-*/
-void list_destroy(struct list *list);
-
-#endif /* !LIST_H */
diff --git a/rushs/tinyprintf/glob_easy/glob_easy.sh b/rushs/tinyprintf/glob_easy/glob_easy.sh
deleted file mode 100755
index b6ae028..0000000
--- a/rushs/tinyprintf/glob_easy/glob_easy.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo $1/*.[A-Za-z][A-Za-z]
diff --git a/rushs/tinyprintf/glob_remove_shell/glob_remove_shell.sh b/rushs/tinyprintf/glob_remove_shell/glob_remove_shell.sh
deleted file mode 100755
index c2e7ff7..0000000
--- a/rushs/tinyprintf/glob_remove_shell/glob_remove_shell.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-fmt=*.${1:-"txt"}
-
-for file in $(echo "$fmt"); do
- [ -e "$file" ] && rm "$file" || exit 1
-done
diff --git a/rushs/tinyprintf/grade/grade.c b/rushs/tinyprintf/grade/grade.c
deleted file mode 100644
index caecc82..0000000
--- a/rushs/tinyprintf/grade/grade.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <stdio.h>
-
-void grade(char g)
-{
- switch (g)
- {
- case 'A':
- puts("Excellent");
- break;
- case 'B':
- puts("Good");
- break;
- case 'C':
- puts("Not so bad");
- break;
- case 'D':
- puts("Could be worse");
- break;
- case 'E':
- puts("Maybe next time");
- break;
- case 'F':
- puts("No comment");
- break;
- default:
- puts("Call a wild ACU");
- break;
- }
-}
diff --git a/rushs/tinyprintf/greatest_divisor/greatest_divisor.c b/rushs/tinyprintf/greatest_divisor/greatest_divisor.c
deleted file mode 100644
index 4c8efef..0000000
--- a/rushs/tinyprintf/greatest_divisor/greatest_divisor.c
+++ /dev/null
@@ -1,15 +0,0 @@
-unsigned int greatest_divisor(unsigned int n)
-{
- if (n == 0 || n == 1)
- {
- return 1;
- }
-
- int i;
- for (i = n / 2; i > 0 && n % i; i--)
- {
- continue;
- }
-
- return i;
-}
diff --git a/rushs/tinyprintf/hacker_news/input.html b/rushs/tinyprintf/hacker_news/input.html
deleted file mode 100644
index 54d338d..0000000
--- a/rushs/tinyprintf/hacker_news/input.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<html op="news" class=" lddwcbt idc0_332" lang="en"><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta name="referrer" content="origin"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" type="text/css" href="02_files/news.css">
- <link rel="shortcut icon" href="https://news.ycombinator.com/favicon.ico">
- <link rel="alternate" type="application/rss+xml" title="RSS" href="https://news.ycombinator.com/rss">
- <title>Hacker News</title></head><body><center><table id="hnmain" width="85%" cellspacing="0" cellpadding="0" border="0" bgcolor="#f6f6ef">
- <tbody><tr><td bgcolor="#ff6600"><table style="padding:2px" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td style="width:18px;padding-right:4px"><a href="https://news.ycombinator.com/"><img src="02_files/y18.gif" style="border:1px white solid;" width="18" height="18"></a></td>
- <td style="line-height:12pt; height:10px;"><span class="pagetop"><b class="hnname"><a href="https://news.ycombinator.com/news">Hacker News</a></b>
- <a href="https://news.ycombinator.com/newest">new</a> | <a href="https://news.ycombinator.com/front">past</a> | <a href="https://news.ycombinator.com/newcomments">comments</a> | <a href="https://news.ycombinator.com/ask">ask</a> | <a href="https://news.ycombinator.com/show">show</a> | <a href="https://news.ycombinator.com/jobs">jobs</a> | <a href="https://news.ycombinator.com/submit">submit</a> </span></td><td style="text-align:right;padding-right:4px;"><span class="pagetop">
- <a href="https://news.ycombinator.com/login?goto=news%3Fp%3D2">login</a>
- </span></td>
- </tr></tbody></table></td></tr>
-<tr id="pagespace" title="" style="height:10px"></tr><tr><td><table class="itemlist" cellspacing="0" cellpadding="0" border="0">
- <tbody><tr class="athing" id="28943869">
- <td class="title" valign="top" align="right"><span class="rank">31.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943869" href="https://news.ycombinator.com/vote?id=28943869&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://apnews.com/article/technology-business-arts-and-entertainment-be48d7582fdd5604664fff33ed81ca80" class="titlelink">Sinclair Broadcast Group identifies data breach</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=apnews.com"><span class="sitestr">apnews.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943869">8 points</span> by <a href="https://news.ycombinator.com/user?id=xojoc" class="hnuser">xojoc</a> <span class="age" title="2021-10-21T13:12:05"><a href="https://news.ycombinator.com/item?id=28943869">1 hour ago</a></span> <span id="unv_28943869"></span> | <a href="https://news.ycombinator.com/hide?id=28943869&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943869">1&nbsp;comment</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28926775">
- <td class="title" valign="top" align="right"><span class="rank">32.</span></td> <td class="votelinks" valign="top"><center><a id="up_28926775" href="https://news.ycombinator.com/vote?id=28926775&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.earlevel.com/main/2002/08/31/a-gentle-introduction-to-the-fft/" class="titlelink">A gentle introduction to the FFT (2002)</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=earlevel.com"><span class="sitestr">earlevel.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28926775">71 points</span> by <a href="https://news.ycombinator.com/user?id=tigerlily" class="hnuser">tigerlily</a> <span class="age" title="2021-10-20T04:31:20"><a href="https://news.ycombinator.com/item?id=28926775">12 hours ago</a></span> <span id="unv_28926775"></span> | <a href="https://news.ycombinator.com/hide?id=28926775&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28926775">14&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28930157">
- <td class="title" valign="top" align="right"><span class="rank">33.</span></td> <td class="votelinks" valign="top"><center><a id="up_28930157" href="https://news.ycombinator.com/vote?id=28930157&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://thebrowser.com/notes/jon-ingold/" class="titlelink">Jon Ingold on translating archeology into video games</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=thebrowser.com"><span class="sitestr">thebrowser.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28930157">36 points</span> by <a href="https://news.ycombinator.com/user?id=nupitalnumber" class="hnuser">nupitalnumber</a> <span class="age" title="2021-10-20T13:04:53"><a href="https://news.ycombinator.com/item?id=28930157">9 hours ago</a></span> <span id="unv_28930157"></span> | <a href="https://news.ycombinator.com/hide?id=28930157&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28930157">4&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28943611">
- <td class="title" valign="top" align="right"><span class="rank">34.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943611" href="https://news.ycombinator.com/vote?id=28943611&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://news.ycombinator.com/item?id=28943611" class="titlelink">Ask HN: How to Sell a Website</a></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943611">7 points</span> by <a href="https://news.ycombinator.com/user?id=legrisch" class="hnuser">legrisch</a> <span class="age" title="2021-10-21T12:45:35"><a href="https://news.ycombinator.com/item?id=28943611">1 hour ago</a></span> <span id="unv_28943611"></span> | <a href="https://news.ycombinator.com/hide?id=28943611&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943611">3&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28933391">
- <td class="title" valign="top" align="right"><span class="rank">35.</span></td> <td class="votelinks" valign="top"><center><a id="up_28933391" href="https://news.ycombinator.com/vote?id=28933391&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://iconmap.io/blog" class="titlelink">We analyzed 425k favicons</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=iconmap.io"><span class="sitestr">iconmap.io</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28933391">493 points</span> by <a href="https://news.ycombinator.com/user?id=gurgeous" class="hnuser">gurgeous</a> <span class="age" title="2021-10-20T17:29:03"><a href="https://news.ycombinator.com/item?id=28933391">20 hours ago</a></span> <span id="unv_28933391"></span> | <a href="https://news.ycombinator.com/hide?id=28933391&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28933391">119&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28938551">
- <td class="title" valign="top" align="right"><span class="rank">36.</span></td> <td class="votelinks" valign="top"><center><a id="up_28938551" href="https://news.ycombinator.com/vote?id=28938551&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.science.org/content/article/machu-picchu-was-built-over-major-fault-zones-now-researchers-think-they-know-why" class="titlelink">Machu Picchu was built over major fault zones (2019)</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=science.org"><span class="sitestr">science.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28938551">98 points</span> by <a href="https://news.ycombinator.com/user?id=Anon84" class="hnuser">Anon84</a> <span class="age" title="2021-10-21T00:07:54"><a href="https://news.ycombinator.com/item?id=28938551">14 hours ago</a></span> <span id="unv_28938551"></span> | <a href="https://news.ycombinator.com/hide?id=28938551&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28938551">41&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940507">
- <td class="title" valign="top" align="right"><span class="rank">37.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940507" href="https://news.ycombinator.com/vote?id=28940507&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://brave.com/wp-content/uploads/2021/03/goggles.pdf" class="titlelink">Goggles: Democracy dies in darkness, and so does the Web [pdf]</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=brave.com"><span class="sitestr">brave.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940507">114 points</span> by <a href="https://news.ycombinator.com/user?id=InvaderFizz" class="hnuser">InvaderFizz</a> <span class="age" title="2021-10-21T05:03:56"><a href="https://news.ycombinator.com/item?id=28940507">9 hours ago</a></span> <span id="unv_28940507"></span> | <a href="https://news.ycombinator.com/hide?id=28940507&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940507">119&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28933663">
- <td class="title" valign="top" align="right"><span class="rank">38.</span></td> <td class="votelinks" valign="top"><center><a id="up_28933663" href="https://news.ycombinator.com/vote?id=28933663&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://browser.geekbench.com/v5/cpu/10496766" class="titlelink">Apple M1 Max Geekbench Score</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=geekbench.com"><span class="sitestr">geekbench.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28933663">467 points</span> by <a href="https://news.ycombinator.com/user?id=mv9" class="hnuser">mv9</a> <span class="age" title="2021-10-20T17:50:17"><a href="https://news.ycombinator.com/item?id=28933663">20 hours ago</a></span> <span id="unv_28933663"></span> | <a href="https://news.ycombinator.com/hide?id=28933663&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28933663">771&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28933981">
- <td class="title" valign="top" align="right"><span class="rank">39.</span></td> <td class="votelinks" valign="top"><center><a id="up_28933981" href="https://news.ycombinator.com/vote?id=28933981&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.commerce.gov/news/press-releases/2021/10/commerce-tightens-export-controls-items-used-surveillance-private" class="titlelink">U.S. tightens export controls on items used in surveillance of private citizens</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=commerce.gov"><span class="sitestr">commerce.gov</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28933981">275 points</span> by <a href="https://news.ycombinator.com/user?id=transpute" class="hnuser">transpute</a> <span class="age" title="2021-10-20T18:14:33"><a href="https://news.ycombinator.com/item?id=28933981">20 hours ago</a></span> <span id="unv_28933981"></span> | <a href="https://news.ycombinator.com/hide?id=28933981&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28933981">161&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28943645">
- <td class="title" valign="top" align="right"><span class="rank">40.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943645" href="https://news.ycombinator.com/vote?id=28943645&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.wsj.com/articles/wework-set-to-go-public-via-spac-deal-two-years-after-failed-ipo-11634808600" class="titlelink" rel="nofollow">WeWork is trying to go public – again</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=wsj.com"><span class="sitestr">wsj.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943645">8 points</span> by <a href="https://news.ycombinator.com/user?id=collegeburner" class="hnuser">collegeburner</a> <span class="age" title="2021-10-21T12:49:02"><a href="https://news.ycombinator.com/item?id=28943645">1 hour ago</a></span> <span id="unv_28943645"></span> | <a href="https://news.ycombinator.com/hide?id=28943645&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943645">2&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28934624">
- <td class="title" valign="top" align="right"><span class="rank">41.</span></td> <td class="votelinks" valign="top"><center><a id="up_28934624" href="https://news.ycombinator.com/vote?id=28934624&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.copetti.org/writings/consoles/playstation-3/" class="titlelink">Playstation 3 Architecture</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=copetti.org"><span class="sitestr">copetti.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28934624">362 points</span> by <a href="https://news.ycombinator.com/user?id=bangonkeyboard" class="hnuser">bangonkeyboard</a> <span class="age" title="2021-10-20T18:56:53"><a href="https://news.ycombinator.com/item?id=28934624">19 hours ago</a></span> <span id="unv_28934624"></span> | <a href="https://news.ycombinator.com/hide?id=28934624&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28934624">81&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28929639">
- <td class="title" valign="top" align="right"><span class="rank">42.</span></td> <td class="votelinks" valign="top"><center><a id="up_28929639" href="https://news.ycombinator.com/vote?id=28929639&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://owlpal.substack.com/p/about-that-time-i-had-an-outburst" class="titlelink">About that time I had an outburst during the Y Combinator Interview</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=owlpal.substack.com"><span class="sitestr">owlpal.substack.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28929639">498 points</span> by <a href="https://news.ycombinator.com/user?id=curiousowl" class="hnuser">curiousowl</a> <span class="age" title="2021-10-20T12:03:25"><a href="https://news.ycombinator.com/item?id=28929639">1 day ago</a></span> <span id="unv_28929639"></span> | <a href="https://news.ycombinator.com/hide?id=28929639&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28929639">242&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28938378">
- <td class="title" valign="top" align="right"><span class="rank">43.</span></td> <td class="votelinks" valign="top"><center><a id="up_28938378" href="https://news.ycombinator.com/vote?id=28938378&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.guernicamag.com/one-mans-pest/" class="titlelink" rel="nofollow">One Man's Pest</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=guernicamag.com"><span class="sitestr">guernicamag.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28938378">8 points</span> by <a href="https://news.ycombinator.com/user?id=yimby" class="hnuser">yimby</a> <span class="age" title="2021-10-20T23:47:13"><a href="https://news.ycombinator.com/item?id=28938378">6 hours ago</a></span> <span id="unv_28938378"></span> | <a href="https://news.ycombinator.com/hide?id=28938378&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28938378">discuss</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28926582">
- <td class="title" valign="top" align="right"><span class="rank">44.</span></td> <td class="votelinks" valign="top"><center><a id="up_28926582" href="https://news.ycombinator.com/vote?id=28926582&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://brave.com/search-and-web-discovery/" class="titlelink">Brave Search replaces Google as default search engine in the Brave browser</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=brave.com"><span class="sitestr">brave.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28926582">723 points</span> by <a href="https://news.ycombinator.com/user?id=skellertor" class="hnuser">skellertor</a> <span class="age" title="2021-10-20T03:56:51"><a href="https://news.ycombinator.com/item?id=28926582">1 day ago</a></span> <span id="unv_28926582"></span> | <a href="https://news.ycombinator.com/hide?id=28926582&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28926582">528&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28943866">
- <td class="title" valign="top" align="right"><span class="rank">45.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943866" href="https://news.ycombinator.com/vote?id=28943866&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://twitter.com//rashiq/status/1319346264992026624" class="titlelink" rel="nofollow">I reverse engineered mcdonald's internal API</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=twitter.com/rashiq"><span class="sitestr">twitter.com/rashiq</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943866">3 points</span> by <a href="https://news.ycombinator.com/user?id=graderjs" class="hnuser">graderjs</a> <span class="age" title="2021-10-21T13:11:46"><a href="https://news.ycombinator.com/item?id=28943866">1 hour ago</a></span> <span id="unv_28943866"></span> | <a href="https://news.ycombinator.com/hide?id=28943866&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943866">discuss</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28936324">
- <td class="title" valign="top" align="right"><span class="rank">46.</span></td> <td class="votelinks" valign="top"><center><a id="up_28936324" href="https://news.ycombinator.com/vote?id=28936324&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.science.org/doi/10.1126/scisignal.abc4764" class="titlelink">Injury response to DNA damage in live tumor cells promotes antitumor immunity</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=science.org"><span class="sitestr">science.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28936324">109 points</span> by <a href="https://news.ycombinator.com/user?id=bcaulfield" class="hnuser">bcaulfield</a> <span class="age" title="2021-10-20T20:48:40"><a href="https://news.ycombinator.com/item?id=28936324">17 hours ago</a></span> <span id="unv_28936324"></span> | <a href="https://news.ycombinator.com/hide?id=28936324&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28936324">5&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940197">
- <td class="title" valign="top" align="right"><span class="rank">47.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940197" href="https://news.ycombinator.com/vote?id=28940197&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.cowin.gov.in/" class="titlelink">India Counting Down to 1B Doses</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=cowin.gov.in"><span class="sitestr">cowin.gov.in</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940197">105 points</span> by <a href="https://news.ycombinator.com/user?id=neelkadia" class="hnuser">neelkadia</a> <span class="age" title="2021-10-21T04:17:41"><a href="https://news.ycombinator.com/item?id=28940197">10 hours ago</a></span> <span id="unv_28940197"></span> | <a href="https://news.ycombinator.com/hide?id=28940197&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940197">78&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28943066">
- <td class="title" valign="top" align="right"><span class="rank">48.</span></td> <td class="votelinks" valign="top"><center><a id="up_28943066" href="https://news.ycombinator.com/vote?id=28943066&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://slate.com/technology/2021/10/tether-crypto-danger-ben-mckenzie.html" class="titlelink" rel="nofollow">Time to get worried about Tether, the “stablecoin” at center of cryptocurrency</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=slate.com"><span class="sitestr">slate.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28943066">6 points</span> by <a href="https://news.ycombinator.com/user?id=RickJWagner" class="hnuser">RickJWagner</a> <span class="age" title="2021-10-21T11:45:09"><a href="https://news.ycombinator.com/item?id=28943066">2 hours ago</a></span> <span id="unv_28943066"></span> | <a href="https://news.ycombinator.com/hide?id=28943066&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28943066">5&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940258">
- <td class="title" valign="top" align="right"><span class="rank">49.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940258" href="https://news.ycombinator.com/vote?id=28940258&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.alifewithoutlimits.com.au/the-history-of-surveying/" class="titlelink">The History of Surveying</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=alifewithoutlimits.com.au"><span class="sitestr">alifewithoutlimits.com.au</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940258">20 points</span> by <a href="https://news.ycombinator.com/user?id=barbazoo" class="hnuser">barbazoo</a> <span class="age" title="2021-10-21T04:27:11"><a href="https://news.ycombinator.com/item?id=28940258">9 hours ago</a></span> <span id="unv_28940258"></span> | <a href="https://news.ycombinator.com/hide?id=28940258&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940258">9&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28921244">
- <td class="title" valign="top" align="right"><span class="rank">50.</span></td> <td class="votelinks" valign="top"><center><a id="up_28921244" href="https://news.ycombinator.com/vote?id=28921244&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.npr.org/2021/10/19/1047303559/fda-hearing-aid-prescription-over-the-counter" class="titlelink">The FDA wants you to be able to buy a hearing aid without a prescription</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=npr.org"><span class="sitestr">npr.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28921244">722 points</span> by <a href="https://news.ycombinator.com/user?id=cf100clunk" class="hnuser">cf100clunk</a> <span class="age" title="2021-10-19T17:58:42"><a href="https://news.ycombinator.com/item?id=28921244">1 day ago</a></span> <span id="unv_28921244"></span> | <a href="https://news.ycombinator.com/hide?id=28921244&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28921244">441&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28942594">
- <td class="title" valign="top" align="right"><span class="rank">51.</span></td> <td class="votelinks" valign="top"><center><a id="up_28942594" href="https://news.ycombinator.com/vote?id=28942594&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.pcgamer.com/windows-11-pcs-can-hobble-gaming-performance/" class="titlelink">Windows 11 will hobble gaming performance by default on some prebuilt PCs</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=pcgamer.com"><span class="sitestr">pcgamer.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28942594">13 points</span> by <a href="https://news.ycombinator.com/user?id=DeathArrow" class="hnuser">DeathArrow</a> <span class="age" title="2021-10-21T10:33:39"><a href="https://news.ycombinator.com/item?id=28942594">3 hours ago</a></span> <span id="unv_28942594"></span> | <a href="https://news.ycombinator.com/hide?id=28942594&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28942594">3&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940705">
- <td class="title" valign="top" align="right"><span class="rank">52.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940705" href="https://news.ycombinator.com/vote?id=28940705&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.gimp.org/news/2021/10/20/gimp-2-99-8-released/" class="titlelink">Development version: GIMP 2.99.8 Released</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=gimp.org"><span class="sitestr">gimp.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940705">19 points</span> by <a href="https://news.ycombinator.com/user?id=pauloxnet" class="hnuser">pauloxnet</a> <span class="age" title="2021-10-21T05:33:20"><a href="https://news.ycombinator.com/item?id=28940705">8 hours ago</a></span> <span id="unv_28940705"></span> | <a href="https://news.ycombinator.com/hide?id=28940705&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940705">2&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28903383">
- <td class="title" valign="top" align="right"><span class="rank">53.</span></td> <td class="votelinks" valign="top"><center><a id="up_28903383" href="https://news.ycombinator.com/vote?id=28903383&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://mikolaj-kaminski.com/jetbrains-rider-docker-compose-unicodedecodeerror-issue-fix/" class="titlelink">I couldn't debug the code because of my name</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=mikolaj-kaminski.com"><span class="sitestr">mikolaj-kaminski.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28903383">247 points</span> by <a href="https://news.ycombinator.com/user?id=mikasjp" class="hnuser">mikasjp</a> <span class="age" title="2021-10-18T08:40:39"><a href="https://news.ycombinator.com/item?id=28903383">23 hours ago</a></span> <span id="unv_28903383"></span> | <a href="https://news.ycombinator.com/hide?id=28903383&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28903383">268&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28937484">
- <td class="title" valign="top" align="right"><span class="rank">54.</span></td> <td class="votelinks" valign="top"><center><a id="up_28937484" href="https://news.ycombinator.com/vote?id=28937484&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://calbryant.uk/blog/10-ways-to-get-the-best-out-of-openscad/" class="titlelink">Getting the best out of OpenSCAD</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=calbryant.uk"><span class="sitestr">calbryant.uk</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28937484">109 points</span> by <a href="https://news.ycombinator.com/user?id=naggie" class="hnuser">naggie</a> <span class="age" title="2021-10-20T22:13:20"><a href="https://news.ycombinator.com/item?id=28937484">16 hours ago</a></span> <span id="unv_28937484"></span> | <a href="https://news.ycombinator.com/hide?id=28937484&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28937484">52&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28921083">
- <td class="title" valign="top" align="right"><span class="rank">55.</span></td> <td class="votelinks" valign="top"><center><a id="up_28921083" href="https://news.ycombinator.com/vote?id=28921083&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://spectrum.ieee.org/recycled-batteries-good-as-newly-mined" class="titlelink">Study: Recycled Lithium Batteries as Good as Newly Mined</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=ieee.org"><span class="sitestr">ieee.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28921083">623 points</span> by <a href="https://news.ycombinator.com/user?id=mpweiher" class="hnuser">mpweiher</a> <span class="age" title="2021-10-19T17:45:07"><a href="https://news.ycombinator.com/item?id=28921083">1 day ago</a></span> <span id="unv_28921083"></span> | <a href="https://news.ycombinator.com/hide?id=28921083&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28921083">179&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28934715">
- <td class="title" valign="top" align="right"><span class="rank">56.</span></td> <td class="votelinks" valign="top"><center><a id="up_28934715" href="https://news.ycombinator.com/vote?id=28934715&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://americasfuture.org/eliminating-gifted-programs-wont-make-education-fair/" class="titlelink">Eliminating gifted programs won’t make education fair</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=americasfuture.org"><span class="sitestr">americasfuture.org</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28934715">180 points</span> by <a href="https://news.ycombinator.com/user?id=paulpauper" class="hnuser">paulpauper</a> <span class="age" title="2021-10-20T19:03:44"><a href="https://news.ycombinator.com/item?id=28934715">19 hours ago</a></span> <span id="unv_28934715"></span> | <a href="https://news.ycombinator.com/hide?id=28934715&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28934715">400&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28939407">
- <td class="title" valign="top" align="right"><span class="rank">57.</span></td> <td class="votelinks" valign="top"><center><a id="up_28939407" href="https://news.ycombinator.com/vote?id=28939407&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://github.com/ToshioCP/Gtk4-tutorial/blob/main/Readme.md" class="titlelink">Gtk4 Tutorial</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=github.com/toshiocp"><span class="sitestr">github.com/toshiocp</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28939407">53 points</span> by <a href="https://news.ycombinator.com/user?id=marcodiego" class="hnuser">marcodiego</a> <span class="age" title="2021-10-21T01:59:18"><a href="https://news.ycombinator.com/item?id=28939407">12 hours ago</a></span> <span id="unv_28939407"></span> | <a href="https://news.ycombinator.com/hide?id=28939407&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28939407">73&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28940334">
- <td class="title" valign="top" align="right"><span class="rank">58.</span></td> <td class="votelinks" valign="top"><center><a id="up_28940334" href="https://news.ycombinator.com/vote?id=28940334&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://obua.com/publications/cosmo-id/3/" class="titlelink" rel="nofollow">Cosmopolitan Identifiers</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=obua.com"><span class="sitestr">obua.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28940334">10 points</span> by <a href="https://news.ycombinator.com/user?id=BeefySwain" class="hnuser">BeefySwain</a> <span class="age" title="2021-10-21T04:39:41"><a href="https://news.ycombinator.com/item?id=28940334">9 hours ago</a></span> <span id="unv_28940334"></span> | <a href="https://news.ycombinator.com/hide?id=28940334&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28940334">2&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28929840">
- <td class="title" valign="top" align="right"><span class="rank">59.</span></td> <td class="votelinks" valign="top"><center><a id="up_28929840" href="https://news.ycombinator.com/vote?id=28929840&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://madned.substack.com/p/a-talk-with-computer-gaming-pioneer" class="titlelink">A talk with Walter Bright about Empire</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=madned.substack.com"><span class="sitestr">madned.substack.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28929840">218 points</span> by <a href="https://news.ycombinator.com/user?id=mad_ned" class="hnuser">mad_ned</a> <span class="age" title="2021-10-20T12:29:16"><a href="https://news.ycombinator.com/item?id=28929840">1 day ago</a></span> <span id="unv_28929840"></span> | <a href="https://news.ycombinator.com/hide?id=28929840&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28929840">86&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="athing" id="28934833">
- <td class="title" valign="top" align="right"><span class="rank">60.</span></td> <td class="votelinks" valign="top"><center><a id="up_28934833" href="https://news.ycombinator.com/vote?id=28934833&amp;how=up&amp;goto=news%3Fp%3D2"><div class="votearrow" title="upvote"></div></a></center></td><td class="title"><a href="https://www.youtube.com/watch?v=NjrYk546uBA" class="titlelink">Bioelektryczność – Polish Robotics (1968) [video]</a><span class="sitebit comhead"> (<a href="https://news.ycombinator.com/from?site=youtube.com"><span class="sitestr">youtube.com</span></a>)</span></td></tr><tr><td colspan="2"></td><td class="subtext">
- <span class="score" id="score_28934833">123 points</span> by <a href="https://news.ycombinator.com/user?id=danielEM" class="hnuser">danielEM</a> <span class="age" title="2021-10-20T19:11:59"><a href="https://news.ycombinator.com/item?id=28934833">19 hours ago</a></span> <span id="unv_28934833"></span> | <a href="https://news.ycombinator.com/hide?id=28934833&amp;goto=news%3Fp%3D2">hide</a> | <a href="https://news.ycombinator.com/item?id=28934833">27&nbsp;comments</a> </td></tr>
- <tr class="spacer" style="height:5px"></tr>
- <tr class="morespace" style="height:10px"></tr><tr><td colspan="2"></td><td class="title"><a href="https://news.ycombinator.com/news?p=3" class="morelink" rel="next">More</a></td></tr>
- </tbody></table>
-</td></tr>
-<tr><td><img src="02_files/s.gif" width="0" height="10"><table width="100%" cellspacing="0" cellpadding="1"><tbody><tr><td bgcolor="#ff6600"></td></tr></tbody></table><br><center><span class="yclinks"><a href="https://news.ycombinator.com/newsguidelines.html">Guidelines</a>
- | <a href="https://news.ycombinator.com/newsfaq.html">FAQ</a>
- | <a href="https://news.ycombinator.com/lists">Lists</a>
- | <a href="https://github.com/HackerNews/API">API</a>
- | <a href="https://news.ycombinator.com/security.html">Security</a>
- | <a href="http://www.ycombinator.com/legal/">Legal</a>
- | <a href="http://www.ycombinator.com/apply/">Apply to YC</a>
- | <a href="mailto:hn@ycombinator.com">Contact</a></span><br><br><form method="get" action="//hn.algolia.com/">Search:
- <input type="text" name="q" size="17" autocorrect="off" spellcheck="false" autocapitalize="none" autocomplete="false"></form>
- </center></td></tr>
- </tbody></table></center><script type="text/javascript" src="02_files/hn.js"></script>
-</body></html> \ No newline at end of file
diff --git a/rushs/tinyprintf/hacker_news/news.sed b/rushs/tinyprintf/hacker_news/news.sed
deleted file mode 100644
index 91b76d6..0000000
--- a/rushs/tinyprintf/hacker_news/news.sed
+++ /dev/null
@@ -1 +0,0 @@
-s/^.*"\(https\?:\/\/.*\)" class="titlelink"\( rel="nofollow"\)\?>\([^<]*\).*$/**\3**\n\1\n/p
diff --git a/rushs/tinyprintf/hacker_news/output.txt b/rushs/tinyprintf/hacker_news/output.txt
deleted file mode 100644
index 68cc714..0000000
--- a/rushs/tinyprintf/hacker_news/output.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-**Sinclair Broadcast Group identifies data breach**
-https://apnews.com/article/technology-business-arts-and-entertainment-be48d7582fdd5604664fff33ed81ca80
-
-**A gentle introduction to the FFT (2002)**
-https://www.earlevel.com/main/2002/08/31/a-gentle-introduction-to-the-fft/
-
-**Jon Ingold on translating archeology into video games**
-https://thebrowser.com/notes/jon-ingold/
-
-**Ask HN: How to Sell a Website**
-https://news.ycombinator.com/item?id=28943611
-
-**We analyzed 425k favicons**
-https://iconmap.io/blog
-
-**Machu Picchu was built over major fault zones (2019)**
-https://www.science.org/content/article/machu-picchu-was-built-over-major-fault-zones-now-researchers-think-they-know-why
-
-**Goggles: Democracy dies in darkness, and so does the Web [pdf]**
-https://brave.com/wp-content/uploads/2021/03/goggles.pdf
-
-**Apple M1 Max Geekbench Score**
-https://browser.geekbench.com/v5/cpu/10496766
-
-**U.S. tightens export controls on items used in surveillance of private citizens**
-https://www.commerce.gov/news/press-releases/2021/10/commerce-tightens-export-controls-items-used-surveillance-private
-
-**WeWork is trying to go public – again**
-https://www.wsj.com/articles/wework-set-to-go-public-via-spac-deal-two-years-after-failed-ipo-11634808600
-
-**Playstation 3 Architecture**
-https://www.copetti.org/writings/consoles/playstation-3/
-
-**About that time I had an outburst during the Y Combinator Interview**
-https://owlpal.substack.com/p/about-that-time-i-had-an-outburst
-
-**One Man's Pest**
-https://www.guernicamag.com/one-mans-pest/
-
-**Brave Search replaces Google as default search engine in the Brave browser**
-https://brave.com/search-and-web-discovery/
-
-**I reverse engineered mcdonald's internal API**
-https://twitter.com//rashiq/status/1319346264992026624
-
-**Injury response to DNA damage in live tumor cells promotes antitumor immunity**
-https://www.science.org/doi/10.1126/scisignal.abc4764
-
-**India Counting Down to 1B Doses**
-https://www.cowin.gov.in/
-
-**Time to get worried about Tether, the “stablecoin” at center of cryptocurrency**
-https://slate.com/technology/2021/10/tether-crypto-danger-ben-mckenzie.html
-
-**The History of Surveying**
-https://www.alifewithoutlimits.com.au/the-history-of-surveying/
-
-**The FDA wants you to be able to buy a hearing aid without a prescription**
-https://www.npr.org/2021/10/19/1047303559/fda-hearing-aid-prescription-over-the-counter
-
-**Windows 11 will hobble gaming performance by default on some prebuilt PCs**
-https://www.pcgamer.com/windows-11-pcs-can-hobble-gaming-performance/
-
-**Development version: GIMP 2.99.8 Released**
-https://www.gimp.org/news/2021/10/20/gimp-2-99-8-released/
-
-**I couldn't debug the code because of my name**
-https://mikolaj-kaminski.com/jetbrains-rider-docker-compose-unicodedecodeerror-issue-fix/
-
-**Getting the best out of OpenSCAD**
-https://calbryant.uk/blog/10-ways-to-get-the-best-out-of-openscad/
-
-**Study: Recycled Lithium Batteries as Good as Newly Mined**
-https://spectrum.ieee.org/recycled-batteries-good-as-newly-mined
-
-**Eliminating gifted programs won’t make education fair**
-https://americasfuture.org/eliminating-gifted-programs-wont-make-education-fair/
-
-**Gtk4 Tutorial**
-https://github.com/ToshioCP/Gtk4-tutorial/blob/main/Readme.md
-
-**Cosmopolitan Identifiers**
-https://obua.com/publications/cosmo-id/3/
-
-**A talk with Walter Bright about Empire**
-https://madned.substack.com/p/a-talk-with-computer-gaming-pioneer
-
-**Bioelektryczność – Polish Robotics (1968) [video]**
-https://www.youtube.com/watch?v=NjrYk546uBA
-
diff --git a/rushs/tinyprintf/handling_complex/complex.c b/rushs/tinyprintf/handling_complex/complex.c
deleted file mode 100644
index 79a10be..0000000
--- a/rushs/tinyprintf/handling_complex/complex.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "complex.h"
-
-#include <stdio.h>
-
-void print_complex(struct complex a)
-{
- printf("complex(%.2f ", a.real);
-
- if (a.img < 0)
- {
- printf("- %.2fi", -a.img);
- }
- else
- {
- printf("+ %.2fi", a.img);
- }
- printf(")\n");
-}
-
-struct complex neg_complex(struct complex a)
-{
- struct complex z = { -a.real, -a.img };
- return z;
-}
-
-struct complex add_complex(struct complex a, struct complex b)
-{
- struct complex z = { a.real + b.real, a.img + b.img };
- return z;
-}
-
-struct complex sub_complex(struct complex a, struct complex b)
-{
- return add_complex(a, neg_complex(b));
-}
-
-struct complex mul_complex(struct complex a, struct complex b)
-{
- struct complex z = { a.real * b.real - a.img * b.img,
- a.real * b.img + a.img * b.real };
- return z;
-}
-
-struct complex div_complex(struct complex a, struct complex b)
-{
- struct complex z = {
- (a.real * b.real + a.img * b.img) / (b.real * b.real + b.img * b.img),
- (a.img * b.real - a.real * b.img) / (b.real * b.real + b.img * b.img)
- };
- return z;
-}
diff --git a/rushs/tinyprintf/handling_complex/complex.h b/rushs/tinyprintf/handling_complex/complex.h
deleted file mode 100644
index c562810..0000000
--- a/rushs/tinyprintf/handling_complex/complex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef COMPLEX_H
-#define COMPLEX_H
-
-struct complex
-{
- float real;
- float img;
-};
-
-// Print
-void print_complex(struct complex a);
-
-// Operations
-struct complex neg_complex(struct complex a);
-struct complex add_complex(struct complex a, struct complex b);
-struct complex sub_complex(struct complex a, struct complex b);
-struct complex mul_complex(struct complex a, struct complex b);
-struct complex div_complex(struct complex a, struct complex b);
-
-#endif /* !COMPLEX_H */
diff --git a/rushs/tinyprintf/hanoi/hanoi.c b/rushs/tinyprintf/hanoi/hanoi.c
deleted file mode 100644
index 6ac2b71..0000000
--- a/rushs/tinyprintf/hanoi/hanoi.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <stdio.h>
-
-void move(unsigned src, unsigned spare, unsigned dst, unsigned n)
-{
- if (n == 0)
- {
- return;
- }
-
- move(src, dst, spare, n - 1);
-
- printf("%u->%u\n", src, dst);
-
- move(spare, src, dst, n - 1);
-}
-
-void hanoi(unsigned n)
-{
- if (n == 0)
- {
- return;
- }
-
- move(1, 2, 3, n);
-}
-
-int main(void)
-{
- hanoi(3);
- return 0;
-}
diff --git a/rushs/tinyprintf/hash_map/hash.c b/rushs/tinyprintf/hash_map/hash.c
deleted file mode 100644
index 434616f..0000000
--- a/rushs/tinyprintf/hash_map/hash.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stddef.h>
-
-size_t hash(const char *key)
-{
- size_t i = 0;
- size_t hash = 0;
-
- for (i = 0; key[i] != '\0'; ++i)
- hash += key[i];
- hash += i;
-
- return hash;
-}
diff --git a/rushs/tinyprintf/hash_map/hash_map.c b/rushs/tinyprintf/hash_map/hash_map.c
deleted file mode 100644
index 4690e8b..0000000
--- a/rushs/tinyprintf/hash_map/hash_map.c
+++ /dev/null
@@ -1,177 +0,0 @@
-#include "hash_map.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-struct hash_map *hash_map_init(size_t size)
-{
- struct hash_map *new;
- if ((new = malloc(sizeof(struct hash_map))) == NULL)
- {
- return NULL;
- }
- if ((new->data = malloc(size * sizeof(struct pair_list *))) == NULL)
- {
- return NULL;
- }
- new->size = size;
-
- for (size_t i = 0; i < size; i++)
- {
- new->data[i] = NULL;
- }
-
- return new;
-}
-
-bool hash_map_insert(struct hash_map *hash_map, const char *key, char *value,
- bool *updated)
-{
- if (hash_map == NULL || updated == NULL || hash_map->size == 0)
- {
- return false;
- }
- *updated = false;
-
- size_t h = hash(key);
- if (h >= hash_map->size)
- {
- h %= hash_map->size;
- }
-
- struct pair_list *new = malloc(sizeof(struct pair_list));
- if (new == NULL)
- {
- return false;
- }
-
- for (struct pair_list *p = hash_map->data[h]; p; p = p->next)
- {
- if (strcmp(p->key, key) == 0)
- {
- p->value = value;
- *updated = true;
- free(new);
- return true;
- }
- }
-
- new->next = hash_map->data[h];
- new->key = key;
- new->value = value;
- hash_map->data[h] = new;
- return true;
-}
-
-void hash_map_free(struct hash_map *hash_map)
-{
- if (hash_map == NULL)
- {
- return;
- }
-
- if (hash_map->data == NULL)
- {
- free(hash_map);
- return;
- }
-
- for (size_t i = 0; i < hash_map->size; i++)
- {
- while (hash_map->data[i])
- {
- struct pair_list *tmp = hash_map->data[i]->next;
- free(hash_map->data[i]);
- hash_map->data[i] = tmp;
- }
- }
-
- free(hash_map->data);
- free(hash_map);
-}
-
-void hash_map_dump(struct hash_map *hash_map)
-{
- if (hash_map == NULL || hash_map->data == NULL)
- {
- return;
- }
-
- for (size_t i = 0; i < hash_map->size; i++)
- {
- if (hash_map->data[i] != NULL)
- {
- printf("%s: %s", hash_map->data[i]->key, hash_map->data[i]->value);
- for (struct pair_list *p = hash_map->data[i]->next; p; p = p->next)
- {
- printf(", %s: %s", p->key, p->value);
- }
- printf("\n");
- }
- }
-}
-
-const char *hash_map_get(const struct hash_map *hash_map, const char *key)
-{
- if (hash_map == NULL || hash_map->data == NULL || hash_map->size == 0)
- {
- return NULL;
- }
-
- size_t h = hash(key);
- if (h >= hash_map->size)
- {
- h %= hash_map->size;
- }
- struct pair_list *p;
- for (p = hash_map->data[h]; p && strcmp(p->key, key) != 0; p = p->next)
- {
- continue;
- }
-
- if (p)
- {
- return p->value;
- }
- return NULL;
-}
-
-bool hash_map_remove(struct hash_map *hash_map, const char *key)
-{
- if (hash_map == NULL || hash_map->data == NULL || hash_map->size == 0)
- {
- return false;
- }
-
- size_t h = hash(key);
- if (h >= hash_map->size)
- {
- h %= hash_map->size;
- }
- if (hash_map->data[h] == NULL)
- {
- return false;
- }
-
- if (strcmp(hash_map->data[h]->key, key) == 0)
- {
- struct pair_list *tmp = hash_map->data[h]->next;
- free(hash_map->data[h]);
- hash_map->data[h] = tmp;
- return true;
- }
-
- struct pair_list *p;
- for (p = hash_map->data[h]; p->next; p = p->next)
- {
- if (strcmp(p->next->key, key) == 0)
- {
- struct pair_list *tmp = p->next->next;
- free(p->next);
- p->next = tmp;
- return true;
- }
- }
- return false;
-}
diff --git a/rushs/tinyprintf/hash_map/hash_map.h b/rushs/tinyprintf/hash_map/hash_map.h
deleted file mode 100644
index c731eab..0000000
--- a/rushs/tinyprintf/hash_map/hash_map.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef HASH_MAP_H
-#define HASH_MAP_H
-
-#include <stdbool.h>
-#include <stddef.h>
-
-struct pair_list
-{
- const char *key;
- char *value;
- struct pair_list *next;
-};
-
-struct hash_map
-{
- struct pair_list **data;
- size_t size;
-};
-
-size_t hash(const char *str);
-struct hash_map *hash_map_init(size_t size);
-bool hash_map_insert(struct hash_map *hash_map, const char *key, char *value,
- bool *updated);
-void hash_map_free(struct hash_map *hash_map);
-void hash_map_dump(struct hash_map *hash_map);
-const char *hash_map_get(const struct hash_map *hash_map, const char *key);
-bool hash_map_remove(struct hash_map *hash_map, const char *key);
-
-#endif /* ! HASH_MAP_H */
diff --git a/rushs/tinyprintf/heap/Makefile b/rushs/tinyprintf/heap/Makefile
deleted file mode 100644
index 2ed972b..0000000
--- a/rushs/tinyprintf/heap/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-CC = gcc
-CFLAGS = -Wall -Werror -Wvla -Wextra -std=c99 -pedantic
-SRC = add.c del.c print.c pop.c create.c
-OBJ = $(SRC:.c=.o)
-
-.PHONY: library clean
-
-library: $(OBJ)
- ar csr libheap.a $(OBJ)
-
-$(OBJ): $(SRC)
-
-clean:
- $(RM) libheap.a $(OBJ)
diff --git a/rushs/tinyprintf/heap/add.c b/rushs/tinyprintf/heap/add.c
deleted file mode 100644
index 78a4db8..0000000
--- a/rushs/tinyprintf/heap/add.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdlib.h>
-
-#include "heap.h"
-
-void heapify(int arr[], int n, int i)
-{
- if (i == 0)
- return;
- int parent = (i - 1) / 2;
- if (parent >= 0)
- {
- if (arr[i] > arr[parent])
- {
- int tmp = arr[i];
- arr[i] = arr[parent];
- arr[parent] = tmp;
- heapify(arr, n, parent);
- }
- }
-}
-
-void add(struct heap *heap, int val)
-{
- if (heap->size == heap->capacity)
- {
- heap->array = realloc(heap->array, heap->capacity * 2 * sizeof(int));
- if (heap->array == NULL)
- {
- free(heap);
- return;
- }
- heap->capacity *= 2;
- }
-
- heap->array[heap->size] = val;
- heap->size++;
-
- heapify(heap->array, heap->size, heap->size - 1);
-}
diff --git a/rushs/tinyprintf/heap/create.c b/rushs/tinyprintf/heap/create.c
deleted file mode 100644
index f0675ad..0000000
--- a/rushs/tinyprintf/heap/create.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdlib.h>
-
-#include "heap.h"
-
-struct heap *create_heap(void)
-{
- struct heap *res = malloc(sizeof(struct heap));
- if (res == NULL)
- return NULL;
- res->size = 0;
- res->capacity = 8;
- res->array = malloc(8 * sizeof(int));
- if (res->array == NULL)
- {
- free(res);
- return NULL;
- }
- return res;
-}
diff --git a/rushs/tinyprintf/heap/del.c b/rushs/tinyprintf/heap/del.c
deleted file mode 100644
index 4d2ae35..0000000
--- a/rushs/tinyprintf/heap/del.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <stdlib.h>
-
-#include "heap.h"
-
-void delete_heap(struct heap *heap)
-{
- free(heap->array);
- free(heap);
-}
diff --git a/rushs/tinyprintf/heap/heap.h b/rushs/tinyprintf/heap/heap.h
deleted file mode 100644
index 085f436..0000000
--- a/rushs/tinyprintf/heap/heap.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef HEAP_H
-#define HEAP_H
-
-// size_t
-#include <stddef.h>
-
-struct heap
-{
- size_t size;
- size_t capacity;
- int *array;
-};
-
-struct heap *create_heap(void);
-void add(struct heap *heap, int val);
-int pop(struct heap *heap);
-void delete_heap(struct heap *heap);
-void print_heap(const struct heap *heap);
-
-#endif /* !HEAP_H */
diff --git a/rushs/tinyprintf/heap/pop.c b/rushs/tinyprintf/heap/pop.c
deleted file mode 100644
index 55e063f..0000000
--- a/rushs/tinyprintf/heap/pop.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <assert.h>
-#include <stdlib.h>
-
-#include "heap.h"
-
-void heapify2(struct heap *h, size_t i)
-{
- size_t max = i;
- if (2 * i + 1 < h->size && h->array[2 * i + 1] > h->array[max])
- max = 2 * i + 1;
- if (2 * i + 2 < h->size && h->array[2 * i + 2] > h->array[max])
- max = 2 * i + 2;
- if (max != i)
- {
- int tmp = h->array[i];
- h->array[i] = h->array[max];
- h->array[max] = tmp;
- heapify2(h, max);
- }
-}
-
-int pop(struct heap *heap)
-{
- assert(heap->size != 0);
- if (heap->size == 1)
- {
- heap->size--;
- return heap->array[0];
- }
- else
- {
- int res = heap->array[0];
- heap->array[0] = heap->array[heap->size - 1];
- heap->size--;
- heapify2(heap, 0);
- if (heap->size < heap->capacity / 2 && heap->capacity > 8)
- {
- heap->array =
- realloc(heap->array, (heap->capacity / 2) * sizeof(int));
- if (heap->array == NULL)
- {
- free(heap);
- return -1;
- }
- heap->capacity /= 2;
- }
- return res;
- }
-}
diff --git a/rushs/tinyprintf/heap/print.c b/rushs/tinyprintf/heap/print.c
deleted file mode 100644
index f5bbe95..0000000
--- a/rushs/tinyprintf/heap/print.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "heap.h"
-
-void print_rec(const struct heap *h, size_t i, int root)
-{
- if (i >= h->size)
- return;
- if (!root)
- printf(" ");
- else
- root = 0;
- printf("%d", h->array[i]);
- if (i == h->size - 1)
- {
- return;
- }
- print_rec(h, i * 2 + 1, root);
- print_rec(h, i * 2 + 2, root);
-}
-
-void print_heap(const struct heap *heap)
-{
- print_rec(heap, 0, 1);
- printf("\n");
-}
diff --git a/rushs/tinyprintf/hello_friends/hello.c b/rushs/tinyprintf/hello_friends/hello.c
deleted file mode 100644
index 63df2f1..0000000
--- a/rushs/tinyprintf/hello_friends/hello.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdio.h>
-
-int main(int argc, char **argv)
-{
- if (argc == 1)
- printf("Hello World!\n");
- else
- for (int i = 1; i < argc; i++)
- {
- printf("Hello %s!\n", argv[i]);
- }
- return 0;
-}
diff --git a/rushs/tinyprintf/hello_world/hello.c b/rushs/tinyprintf/hello_world/hello.c
deleted file mode 100644
index 0681c18..0000000
--- a/rushs/tinyprintf/hello_world/hello.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int main(void)
-{
- puts("Hello World!");
- return 0;
-}
diff --git a/rushs/tinyprintf/hello_world_shebang/hello.sh b/rushs/tinyprintf/hello_world_shebang/hello.sh
deleted file mode 100755
index 8dc4f64..0000000
--- a/rushs/tinyprintf/hello_world_shebang/hello.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "Hello World!"
diff --git a/rushs/tinyprintf/hill_array/hill_array.c b/rushs/tinyprintf/hill_array/hill_array.c
deleted file mode 100644
index 14d3a85..0000000
--- a/rushs/tinyprintf/hill_array/hill_array.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "hill_array.h"
-
-int top_of_the_hill(int tab[], size_t len)
-{
- if (len == 0)
- {
- return -1;
- }
-
- int top = 0;
- size_t i = 0;
-
- while (i + 1 < len && tab[i] <= tab[i + 1])
- {
- if (tab[i] < 0 || tab[i + 1] < 0)
- {
- return -1;
- }
- if (tab[i] != tab[i + 1])
- {
- top = i + 1;
- }
- i++;
- }
-
- while (i + 1 < len && tab[i] >= tab[i + 1])
- {
- if (tab[i] < 0 || tab[i + 1] < 0)
- {
- return -1;
- }
- i++;
- }
-
- if (i + 1 == len)
- {
- return top;
- }
- else
- {
- return -1;
- }
-}
diff --git a/rushs/tinyprintf/hill_array/hill_array.h b/rushs/tinyprintf/hill_array/hill_array.h
deleted file mode 100644
index 3152c19..0000000
--- a/rushs/tinyprintf/hill_array/hill_array.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef HILL_ARRAY_H
-#define HILL_ARRAY_H
-
-#include <stddef.h>
-
-int top_of_the_hill(int tab[], size_t len);
-
-#endif /* !HILL_ARRAY_H */
diff --git a/rushs/tinyprintf/insertion_sort/insertion_sort.c b/rushs/tinyprintf/insertion_sort/insertion_sort.c
deleted file mode 100644
index 2edd195..0000000
--- a/rushs/tinyprintf/insertion_sort/insertion_sort.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "insertion_sort.h"
-
-#include <stddef.h>
-
-void insertion_sort(void **array, f_cmp comp)
-{
- if (array == NULL || *array == NULL)
- {
- return;
- }
- for (int i = 1; array[i]; i++)
- {
- for (int j = i; j > 0 && comp(array[j - 1], array[j]) > 0; j--)
- {
- void *tmp = array[j];
- array[j] = array[j - 1];
- array[j - 1] = tmp;
- }
- }
-}
diff --git a/rushs/tinyprintf/insertion_sort/insertion_sort.h b/rushs/tinyprintf/insertion_sort/insertion_sort.h
deleted file mode 100644
index a7ba674..0000000
--- a/rushs/tinyprintf/insertion_sort/insertion_sort.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef INSERTION_SORT_H
-#define INSERTION_SORT_H
-
-typedef int (*f_cmp)(const void *, const void *);
-
-void insertion_sort(void **array, f_cmp comp);
-
-#endif /* ! INSERTION_SORT_H */
diff --git a/rushs/tinyprintf/inside/inside.sh b/rushs/tinyprintf/inside/inside.sh
deleted file mode 100755
index c6872fa..0000000
--- a/rushs/tinyprintf/inside/inside.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-if [ $# -ne 1 ]; then
- echo Sorry, expected 1 argument but $# were passed
- exit 1
-fi
-
-if [ -f $1 ]; then
- cat $1
- exit 0
-else
- echo "$1:
- is not a valid file"
- exit 2
-fi
diff --git a/rushs/tinyprintf/inside_noif/inside_noif.sh b/rushs/tinyprintf/inside_noif/inside_noif.sh
deleted file mode 100755
index d4ed8c9..0000000
--- a/rushs/tinyprintf/inside_noif/inside_noif.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-[ $# -ne 1 ] && echo Sorry, expected 1 argument but $# were passed && exit 1
-
-[ -f $1 ] && cat $1 && exit 0 || echo "$1:
- is not a valid file" && exit 2
diff --git a/rushs/tinyprintf/int_palindrome/int_palindrome.c b/rushs/tinyprintf/int_palindrome/int_palindrome.c
deleted file mode 100644
index 6d6847f..0000000
--- a/rushs/tinyprintf/int_palindrome/int_palindrome.c
+++ /dev/null
@@ -1,18 +0,0 @@
-int int_palindrome(int n)
-{
- if (n < 0)
- {
- return 0;
- }
-
- int reversed = 0;
- int m = n;
-
- while (m > 0)
- {
- reversed = reversed * 10 + m % 10;
- m /= 10;
- }
-
- return n == reversed;
-}
diff --git a/rushs/tinyprintf/int_sqrt/int_sqrt.c b/rushs/tinyprintf/int_sqrt/int_sqrt.c
deleted file mode 100644
index 4b2e5db..0000000
--- a/rushs/tinyprintf/int_sqrt/int_sqrt.c
+++ /dev/null
@@ -1,20 +0,0 @@
-int int_sqrt(int n)
-{
- if (n < 0)
- {
- return -1;
- }
-
- if (n == 0 || n == 1)
- {
- return n;
- }
-
- int i;
- for (i = 1; i * i < n; i++)
- {
- continue;
- }
-
- return i - (i * i != n);
-}
diff --git a/rushs/tinyprintf/io_count_words/count_words.c b/rushs/tinyprintf/io_count_words/count_words.c
deleted file mode 100644
index 8b8c9a5..0000000
--- a/rushs/tinyprintf/io_count_words/count_words.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <stdio.h>
-
-int count_words(const char *file_in)
-{
- if (file_in == NULL)
- {
- return -1;
- }
-
- FILE *f = fopen(file_in, "r");
- if (f == NULL)
- {
- return -1;
- }
-
- int word = 0;
- int count = 0;
- int c;
- while ((c = fgetc(f)) != EOF)
- {
- if ((c == ' ' || c == '\n' || c == '\t') && word == 1)
- {
- word = 0;
- }
- if (c != ' ' && c != '\n' && c != '\t' && word == 0)
- {
- word = 1;
- count++;
- }
- }
-
- return count;
-}
diff --git a/rushs/tinyprintf/io_merge_files/merge_files.c b/rushs/tinyprintf/io_merge_files/merge_files.c
deleted file mode 100644
index 26ac9cf..0000000
--- a/rushs/tinyprintf/io_merge_files/merge_files.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#define _POSIX_C_SOURCE 200809L
-
-#include <stdio.h>
-
-int merge_files(const char *file_1, const char *file_2)
-{
- FILE *a = fopen(file_1, "a");
- if (a == NULL)
- {
- return -1;
- }
- FILE *r = fopen(file_2, "r");
- if (r == NULL)
- {
- return -1;
- }
-
- int c;
- while ((c = fgetc(r)) != EOF)
- {
- if (fputc(c, a) == EOF)
- {
- return -1;
- }
- }
-
- fclose(a);
- fclose(r);
-
- return 0;
-}
diff --git a/rushs/tinyprintf/io_replace_line/replace_line.c b/rushs/tinyprintf/io_replace_line/replace_line.c
deleted file mode 100644
index 7fd0e2a..0000000
--- a/rushs/tinyprintf/io_replace_line/replace_line.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#define _POSIX_C_SOURCE 200809L
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int replace_line(const char *file_in, const char *file_out, const char *content,
- int n)
-{
- FILE *a = fopen(file_out, "w");
- if (a == NULL)
- {
- return -1;
- }
- FILE *r = fopen(file_in, "r");
- if (r == NULL)
- {
- return -1;
- }
-
- char *buf = NULL;
- ssize_t e;
- int l = 0;
- size_t count = 0;
- while ((e = getline(&buf, &count, r)) != 0 && e != -1)
- {
- if (l == n)
- {
- if (fputs(content, a) == EOF)
- {
- free(buf);
- return -1;
- }
- }
- else
- {
- if (fputs(buf, a) == EOF)
- {
- free(buf);
- return -1;
- }
- }
- l++;
- }
-
- fclose(a);
- fclose(r);
- free(buf);
-
- return 0;
-}
diff --git a/rushs/tinyprintf/levenshtein/levenshtein.c b/rushs/tinyprintf/levenshtein/levenshtein.c
deleted file mode 100644
index 4da9397..0000000
--- a/rushs/tinyprintf/levenshtein/levenshtein.c
+++ /dev/null
@@ -1,72 +0,0 @@
-#include "levenshtein.h"
-
-#include <stdio.h>
-
-size_t max(size_t a, size_t b)
-{
- if (a >= b)
- {
- return a;
- }
- return b;
-}
-
-size_t min(size_t a, size_t b)
-{
- if (a <= b)
- {
- return a;
- }
- return b;
-}
-
-size_t min_3(size_t a, size_t b, size_t c)
-{
- if (a <= b)
- {
- if (a <= c)
- {
- return a;
- }
- return c;
- }
- else
- {
- if (b <= c)
- {
- return b;
- }
- return c;
- }
-}
-
-size_t my_strlen(const char *s)
-{
- size_t i;
- for (i = 0; s[i]; i++)
- {
- continue;
- }
- return i;
-}
-
-size_t levenshtein(const char *s1, const char *s2)
-{
- size_t l1 = my_strlen(s1);
- size_t l2 = my_strlen(s2);
- if (min(l1, l2) == 0)
- {
- return max(l1, l2);
- }
-
- if (s1[0] == s2[0])
- {
- return levenshtein(s1 + 1, s2 + 1);
- }
-
- size_t lev1 = levenshtein(s1 + 1, s2);
- size_t lev2 = levenshtein(s1, s2 + 1);
- size_t lev3 = levenshtein(s1 + 1, s2 + 1);
-
- return 1 + min_3(lev1, lev2, lev3);
-}
diff --git a/rushs/tinyprintf/levenshtein/levenshtein.h b/rushs/tinyprintf/levenshtein/levenshtein.h
deleted file mode 100644
index 70a5a7b..0000000
--- a/rushs/tinyprintf/levenshtein/levenshtein.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef LEVENSHTEIN_H
-#define LEVENSHTEIN_H
-
-#include <stddef.h>
-
-size_t levenshtein(const char *s1, const char *s2);
-
-#endif /* !LEVENSHTEIN_H */
diff --git a/rushs/tinyprintf/main.c b/rushs/tinyprintf/main.c
deleted file mode 100644
index 4062426..0000000
--- a/rushs/tinyprintf/main.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-//#include "traffic_lights/traffic_lights.h"
-unsigned char rol(unsigned char value, unsigned char roll);
-
-int main(void)
-{
- unsigned char l1 = 0b01010101;
- unsigned char l2 = 3;
-
- printf("l1: %b", rol(l1, l2));
-
- return 0;
-}
diff --git a/rushs/tinyprintf/my_abs/my_abs.c b/rushs/tinyprintf/my_abs/my_abs.c
deleted file mode 100644
index fc89d2f..0000000
--- a/rushs/tinyprintf/my_abs/my_abs.c
+++ /dev/null
@@ -1,11 +0,0 @@
-int my_abs(int n)
-{
- if (n < 0)
- {
- return -n;
- }
- else
- {
- return n;
- }
-}
diff --git a/rushs/tinyprintf/my_atoi/my_atoi.c b/rushs/tinyprintf/my_atoi/my_atoi.c
deleted file mode 100644
index ca185a5..0000000
--- a/rushs/tinyprintf/my_atoi/my_atoi.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include "my_atoi.h"
-
-int my_atoi(const char *str)
-{
- int res = 0;
-
- // str error check
- if (str == NULL || *str == '0')
- {
- return 0;
- }
-
- // trim whitespaces
- for (; *str && *str == ' '; str++)
- {
- continue;
- }
-
- // move to end of str
- size_t l;
- for (l = 0; str[l]; l++)
- {
- continue;
- }
- l--;
-
- // prepare for calculations
- int factor = 1;
-
- // actual conversion of up to the second element of str (potential sign)
- for (; l > 0; l--)
- {
- char val = str[l];
- if (val < '0' || val > '9')
- {
- return 0;
- }
- val -= '0';
- res += val * factor;
-
- factor *= 10;
- }
-
- // l should be 0 by now
- if (str[l] == '-')
- {
- return -res;
- }
- else if (str[l] != '+')
- {
- int val = str[l];
- if (val < '0' || val > '9')
- {
- return 0;
- }
- val -= '0';
- return res + val * factor;
- }
-
- return res;
-}
diff --git a/rushs/tinyprintf/my_atoi/my_atoi.h b/rushs/tinyprintf/my_atoi/my_atoi.h
deleted file mode 100644
index b520d09..0000000
--- a/rushs/tinyprintf/my_atoi/my_atoi.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_ATOI_H
-#define MY_ATOI_H
-
-#include <stddef.h>
-
-int my_atoi(const char *str);
-
-#endif /* ! MY_ATOI_H */
diff --git a/rushs/tinyprintf/my_atoi_base/my_atoi_base.c b/rushs/tinyprintf/my_atoi_base/my_atoi_base.c
deleted file mode 100644
index 46b4560..0000000
--- a/rushs/tinyprintf/my_atoi_base/my_atoi_base.c
+++ /dev/null
@@ -1,86 +0,0 @@
-#include "my_atoi_base.h"
-
-int val_in_base(char c, const char *base)
-{
- size_t i;
- for (i = 0; base[i] && base[i] != c; i++)
- {
- continue;
- }
-
- if (base[i])
- {
- return i;
- }
-
- return -1;
-}
-
-int base_size(const char *base)
-{
- int res;
- for (res = 0; base[res]; res++)
- {
- continue;
- }
- return res;
-}
-
-int my_atoi_base(const char *str, const char *base)
-{
- int res = 0;
-
- // str error check
- if (str == NULL || *str == '0')
- {
- return 0;
- }
-
- // trim whitespaces
- for (; *str && *str == ' '; str++)
- {
- continue;
- }
-
- // move to end of str
- size_t l;
- for (l = 0; str[l]; l++)
- {
- continue;
- }
- l--;
-
- // prepare for calculations
- int b = base_size(base);
- int factor = 1;
-
- // actual conversion of up to the second element of str (potential sign)
- for (; l > 0; l--)
- {
- int val = val_in_base(str[l], base);
- if (val == -1)
- {
- return 0;
- }
- res += val * factor;
-
- factor *= b;
- }
-
- // l should be 0 by now
- if (str[l] == '-')
- {
- return -res;
- }
- else if (str[l] != '+')
- {
- int val = val_in_base(str[l], base);
- if (val == -1)
- {
- return 0;
- }
- return res + val * factor;
- }
-
- return res;
-}
diff --git a/rushs/tinyprintf/my_atoi_base/my_atoi_base.h b/rushs/tinyprintf/my_atoi_base/my_atoi_base.h
deleted file mode 100644
index 296ae23..0000000
--- a/rushs/tinyprintf/my_atoi_base/my_atoi_base.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_ATOI_BASE_H
-#define MY_ATOI_BASE_H
-
-#include <stddef.h>
-
-int my_atoi_base(const char *str, const char *base);
-
-#endif /* ! MY_ATOI_BASE_H */
diff --git a/rushs/tinyprintf/my_bc/my_bc.sh b/rushs/tinyprintf/my_bc/my_bc.sh
deleted file mode 100755
index f675838..0000000
--- a/rushs/tinyprintf/my_bc/my_bc.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-[ -n "$1" ] && echo "$(($1))" && exit 0
-
-while IFS='' read -r line; do
- [ -z "$line" ] && exit 0 || echo "$(($line))"
-done
diff --git a/rushs/tinyprintf/my_c_tail/main.c b/rushs/tinyprintf/my_c_tail/main.c
deleted file mode 100644
index ba33337..0000000
--- a/rushs/tinyprintf/my_c_tail/main.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdlib.h>
-
-#include "my_c_tail.h"
-
-int main(int argc, char *argv[])
-{
- if (argc > 1)
- stdintail(atoi(argv[1]));
- return 0;
-}
diff --git a/rushs/tinyprintf/my_c_tail/my_c_tail.c b/rushs/tinyprintf/my_c_tail/my_c_tail.c
deleted file mode 100644
index 790240c..0000000
--- a/rushs/tinyprintf/my_c_tail/my_c_tail.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "my_c_tail.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-
-void stdintail(unsigned int n)
-{
- char **lines = calloc(2000, sizeof(char *));
- lines[0] = malloc(350 * sizeof(char));
- size_t m = 0;
- char c;
- size_t i = 0;
- while (read(STDIN_FILENO, &c, 1))
- {
- if (c == '\n')
- {
- lines[m][i] = '\0';
- lines[++m] = malloc(350 * sizeof(char));
- i = 0;
- }
- else
- {
- lines[m][i++] = c;
- }
- }
-
- size_t j;
- if (m > n)
- {
- for (size_t i = 0; i < m - n; i++)
- free(lines[i]);
- j = m - n;
- }
- else
- j = 0;
-
- for (; j < m; j++)
- {
- for (size_t i = 0; lines[j][i]; i++)
- write(STDOUT_FILENO, &(lines[j][i]), 1);
- write(STDOUT_FILENO, "\n", 1);
- free(lines[j]);
- }
- free(lines[m]);
- free(lines);
-}
diff --git a/rushs/tinyprintf/my_c_tail/my_c_tail.h b/rushs/tinyprintf/my_c_tail/my_c_tail.h
deleted file mode 100644
index 172c844..0000000
--- a/rushs/tinyprintf/my_c_tail/my_c_tail.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_C_TAIL_H
-#define MY_C_TAIL_H
-
-void stdintail(unsigned int n);
-
-#endif // MY_C_TAIL_H
diff --git a/rushs/tinyprintf/my_calloc/my_calloc.c b/rushs/tinyprintf/my_calloc/my_calloc.c
deleted file mode 100644
index 5a2f7f2..0000000
--- a/rushs/tinyprintf/my_calloc/my_calloc.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdlib.h>
-
-void *my_calloc(size_t n, size_t size)
-{
- char *res = malloc(n * size);
- for (size_t i = 0; i < n * size; i++)
- {
- res[i] = 0;
- }
- return res;
-}
diff --git a/rushs/tinyprintf/my_calloc/my_calloc.h b/rushs/tinyprintf/my_calloc/my_calloc.h
deleted file mode 100644
index 44bf9a2..0000000
--- a/rushs/tinyprintf/my_calloc/my_calloc.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_CALLOC_H
-#define MY_CALLOC_H
-
-#include <stdlib.h>
-
-void *my_calloc(size_t n, size_t size);
-
-#endif /* ! MY_CALLOC_H */
diff --git a/rushs/tinyprintf/my_file/my_file.sh b/rushs/tinyprintf/my_file/my_file.sh
deleted file mode 100755
index 93c0c20..0000000
--- a/rushs/tinyprintf/my_file/my_file.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-for arg; do
- if [ -f "$arg" ]; then
- echo $arg: file
- elif [ -d "$arg" ]; then
- echo $arg: directory
- else
- echo $arg: unknown
- fi
-done
diff --git a/rushs/tinyprintf/my_first_variable/create.sh b/rushs/tinyprintf/my_first_variable/create.sh
deleted file mode 100755
index d9264db..0000000
--- a/rushs/tinyprintf/my_first_variable/create.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-my_local_frais="Javotte"
-
-echo My frais is $my_local_frais
diff --git a/rushs/tinyprintf/my_first_variable/edit.sh b/rushs/tinyprintf/my_first_variable/edit.sh
deleted file mode 100755
index e47e0c3..0000000
--- a/rushs/tinyprintf/my_first_variable/edit.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-my_local_frais="Javotte"
-
-echo My frais is $my_local_frais
-
-my_local_frais="Pulpa"
-
-echo My frais is now $my_local_frais
diff --git a/rushs/tinyprintf/my_first_variable/use.sh b/rushs/tinyprintf/my_first_variable/use.sh
deleted file mode 100755
index f9d462e..0000000
--- a/rushs/tinyprintf/my_first_variable/use.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "My frais is $MY_ENV_FRAIS"
diff --git a/rushs/tinyprintf/my_itoa/my_itoa.c b/rushs/tinyprintf/my_itoa/my_itoa.c
deleted file mode 100644
index cbb6f73..0000000
--- a/rushs/tinyprintf/my_itoa/my_itoa.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "my_itoa.h"
-
-char *my_itoa(int value, char *s)
-{
- if (value == 0)
- {
- s[0] = '0';
- s[1] = '\0';
- return s;
- }
- char *head = s;
- if (value < 0)
- {
- s[0] = '-';
- s++;
- value = -value;
- }
-
- // count numbers
- int t = value;
- int n = 0;
- while (t > 0)
- {
- t /= 10;
- n++;
- }
-
- // n = number count
- s[n] = '\0';
- n--;
- for (; n >= 0; n--)
- {
- s[n] = value % 10 + '0';
- value /= 10;
- }
-
- return head;
-}
diff --git a/rushs/tinyprintf/my_itoa/my_itoa.h b/rushs/tinyprintf/my_itoa/my_itoa.h
deleted file mode 100644
index 8e84c72..0000000
--- a/rushs/tinyprintf/my_itoa/my_itoa.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_ITOA_H
-#define MY_ITOA_H
-
-char *my_itoa(int value, char *s);
-
-#endif /* ! MY_ITOA_H */
diff --git a/rushs/tinyprintf/my_itoa_base/my_itoa_base.c b/rushs/tinyprintf/my_itoa_base/my_itoa_base.c
deleted file mode 100644
index 29b3042..0000000
--- a/rushs/tinyprintf/my_itoa_base/my_itoa_base.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "my_itoa_base.h"
-
-int base_count(const char *base)
-{
- int i;
- for (i = 0; base[i]; i++)
- {
- continue;
- }
- return i;
-}
-
-char *my_itoa_base(int n, char *s, const char *base)
-{
- if (n == 0)
- {
- s[0] = base[0];
- s[1] = '\0';
- return s;
- }
- char *head = s;
- if (n < 0)
- {
- s[0] = '-';
- s++;
- n = -n;
- }
-
- // count numbers
- int t = n;
- int m = 0;
- int b = base_count(base);
- while (t > 0)
- {
- t /= b;
- m++;
- }
-
- // n = number count
- s[m] = '\0';
- m--;
- for (; m >= 0; m--)
- {
- s[m] = base[n % b];
- n /= b;
- }
-
- return head;
-}
diff --git a/rushs/tinyprintf/my_itoa_base/my_itoa_base.h b/rushs/tinyprintf/my_itoa_base/my_itoa_base.h
deleted file mode 100644
index 0be6314..0000000
--- a/rushs/tinyprintf/my_itoa_base/my_itoa_base.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_ITOA_BASE_H
-#define MY_ITOA_BASE_H
-
-char *my_itoa_base(int n, char *s, const char *base);
-
-#endif /* ! MY_ITOA_BASE_H */
diff --git a/rushs/tinyprintf/my_memcmp/my_memcmp.c b/rushs/tinyprintf/my_memcmp/my_memcmp.c
deleted file mode 100644
index d498360..0000000
--- a/rushs/tinyprintf/my_memcmp/my_memcmp.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "my_memcmp.h"
-
-int my_memcmp(const void *s1, const void *s2, size_t num)
-{
- if (num == 0)
- {
- return 0;
- }
- const unsigned char *a = s1;
- const unsigned char *b = s2;
-
- for (; num - 1 && *a == *b; a++, b++, num--)
- {
- continue;
- }
-
- return *a - *b;
-}
diff --git a/rushs/tinyprintf/my_memcmp/my_memcmp.h b/rushs/tinyprintf/my_memcmp/my_memcmp.h
deleted file mode 100644
index d17cbe6..0000000
--- a/rushs/tinyprintf/my_memcmp/my_memcmp.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_MEMCMP_H
-#define MY_MEMCMP_H
-
-#include <stddef.h>
-
-int my_memcmp(const void *s1, const void *s2, size_t num);
-
-#endif /* !MY_MEMCMP_H */
diff --git a/rushs/tinyprintf/my_memcpy/my_memcpy.c b/rushs/tinyprintf/my_memcpy/my_memcpy.c
deleted file mode 100644
index a6a48d4..0000000
--- a/rushs/tinyprintf/my_memcpy/my_memcpy.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "my_memcpy.h"
-
-void *my_memcpy(void *dest, const void *source, size_t num)
-{
- char *d = dest;
- const char *s = source;
- if (dest > source) // reverse array
- {
- size_t l = num;
- for (; l > 0; l--)
- {
- d[l - 1] = s[l - 1];
- }
- }
- else
- {
- for (size_t i = 0; i < num; i++)
- {
- d[i] = s[i];
- }
- }
- return dest;
-}
-
-int main(void)
-{
- return 0;
-}
diff --git a/rushs/tinyprintf/my_memcpy/my_memcpy.h b/rushs/tinyprintf/my_memcpy/my_memcpy.h
deleted file mode 100644
index bc1b926..0000000
--- a/rushs/tinyprintf/my_memcpy/my_memcpy.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_MEMCPY_H
-#define MY_MEMCPY_H
-
-#include <stddef.h>
-
-void *my_memcpy(void *dest, const void *source, size_t num);
-
-#endif /* ! MY_MEMCPY_H */
diff --git a/rushs/tinyprintf/my_memmove/my_memmove.c b/rushs/tinyprintf/my_memmove/my_memmove.c
deleted file mode 100644
index bb360a5..0000000
--- a/rushs/tinyprintf/my_memmove/my_memmove.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "my_memmove.h"
-
-void *my_memmove(void *dest, const void *src, size_t n)
-{
- char *d = dest;
- const char *s = src;
- if (dest > src) // reverse array
- {
- size_t l = n;
- for (; l > 0; l--)
- {
- d[l - 1] = s[l - 1];
- }
- }
- else
- {
- for (size_t i = 0; i < n; i++)
- {
- d[i] = s[i];
- }
- }
- return dest;
-}
diff --git a/rushs/tinyprintf/my_memmove/my_memmove.h b/rushs/tinyprintf/my_memmove/my_memmove.h
deleted file mode 100644
index cb253b7..0000000
--- a/rushs/tinyprintf/my_memmove/my_memmove.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_MEMMOVE_H
-#define MY_MEMMOVE_H
-
-#include <stddef.h>
-
-void *my_memmove(void *dest, const void *src, size_t n);
-
-#endif /* ! MY_MEMMOVE_H */
diff --git a/rushs/tinyprintf/my_memset/my_memset.c b/rushs/tinyprintf/my_memset/my_memset.c
deleted file mode 100644
index 243a5ac..0000000
--- a/rushs/tinyprintf/my_memset/my_memset.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "my_memset.h"
-
-void *my_memset(void *s, int c, size_t n)
-{
- unsigned char *t = s;
- for (size_t i = 0; i < n; i++)
- {
- t[i] = c;
- }
-
- return t;
-}
diff --git a/rushs/tinyprintf/my_memset/my_memset.h b/rushs/tinyprintf/my_memset/my_memset.h
deleted file mode 100644
index e5ed0f0..0000000
--- a/rushs/tinyprintf/my_memset/my_memset.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_MEMSET_H
-#define MY_MEMSET_H
-
-#include <stddef.h>
-
-#endif /* ! MY_MEMSET_H */
diff --git a/rushs/tinyprintf/my_pow/my_pow.c b/rushs/tinyprintf/my_pow/my_pow.c
deleted file mode 100644
index f529d87..0000000
--- a/rushs/tinyprintf/my_pow/my_pow.c
+++ /dev/null
@@ -1,13 +0,0 @@
-int my_pow(int a, int b)
-{
- if (!a)
- return b == 0;
- int res = 1;
- for (int i = 0; i < b / 2; i++)
- {
- res *= a * a;
- }
- if (b % 2)
- res *= a;
- return res;
-}
diff --git a/rushs/tinyprintf/my_round/my_round.c b/rushs/tinyprintf/my_round/my_round.c
deleted file mode 100644
index 324bc1d..0000000
--- a/rushs/tinyprintf/my_round/my_round.c
+++ /dev/null
@@ -1,6 +0,0 @@
-int my_round(float n)
-{
- if (n < 0)
- return n - 0.5;
- return n + 0.5;
-}
diff --git a/rushs/tinyprintf/my_strcmp/my_strcmp.c b/rushs/tinyprintf/my_strcmp/my_strcmp.c
deleted file mode 100644
index d3ef3e3..0000000
--- a/rushs/tinyprintf/my_strcmp/my_strcmp.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "my_strcmp.h"
-
-int my_strcmp(const char *s1, const char *s2)
-{
- for (; *s1 && *s1 == *s2; s1++, s2++)
- {
- continue;
- }
-
- return *s1 - *s2;
-}
diff --git a/rushs/tinyprintf/my_strcmp/my_strcmp.h b/rushs/tinyprintf/my_strcmp/my_strcmp.h
deleted file mode 100644
index d89a00b..0000000
--- a/rushs/tinyprintf/my_strcmp/my_strcmp.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_STRCMP_H
-#define MY_STRCMP_H
-
-#include <stddef.h>
-
-#endif /* ! MY_STRCMP_H */
diff --git a/rushs/tinyprintf/my_strcpy/my_strcpy.c b/rushs/tinyprintf/my_strcpy/my_strcpy.c
deleted file mode 100644
index 69ad5ee..0000000
--- a/rushs/tinyprintf/my_strcpy/my_strcpy.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdlib.h>
-
-char *my_strcpy(char *dest, const char *source)
-{
- size_t i;
- for (i = 0; source[i]; i++)
- {
- dest[i] = source[i];
- }
- dest[i] = '\0';
-
- return dest;
-}
diff --git a/rushs/tinyprintf/my_strlen/my_strlen.c b/rushs/tinyprintf/my_strlen/my_strlen.c
deleted file mode 100644
index ec80d0b..0000000
--- a/rushs/tinyprintf/my_strlen/my_strlen.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "my_strlen.h"
-
-size_t my_strlen(const char *s)
-{
- size_t i;
- for (i = 0; s[i]; i++)
- {
- continue;
- }
-
- return i;
-}
diff --git a/rushs/tinyprintf/my_strlen/my_strlen.h b/rushs/tinyprintf/my_strlen/my_strlen.h
deleted file mode 100644
index 02806cc..0000000
--- a/rushs/tinyprintf/my_strlen/my_strlen.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_STRLEN_H
-#define MY_STRLEN_H
-
-#include <stddef.h>
-
-#endif /* ! MY_STRLEN_H */
diff --git a/rushs/tinyprintf/my_strlowcase/my_strlowcase.c b/rushs/tinyprintf/my_strlowcase/my_strlowcase.c
deleted file mode 100644
index e52ea32..0000000
--- a/rushs/tinyprintf/my_strlowcase/my_strlowcase.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "my_strlowcase.h"
-
-void my_strlowcase(char *s)
-{
- size_t i;
- for (i = 0; s[i]; i++)
- {
- if (s[i] >= 'A' && s[i] <= 'Z')
- {
- s[i] += ('a' - 'A');
- }
- }
-}
diff --git a/rushs/tinyprintf/my_strlowcase/my_strlowcase.h b/rushs/tinyprintf/my_strlowcase/my_strlowcase.h
deleted file mode 100644
index d4996b8..0000000
--- a/rushs/tinyprintf/my_strlowcase/my_strlowcase.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_STRLOWCASE_H
-#define MY_STRLOWCASE_H
-
-#include <stddef.h>
-
-void my_strlowcase(char *str);
-
-#endif /* ! MY_STRLOWCASE_H */
diff --git a/rushs/tinyprintf/my_strspn/my_strspn.c b/rushs/tinyprintf/my_strspn/my_strspn.c
deleted file mode 100644
index 18bba0f..0000000
--- a/rushs/tinyprintf/my_strspn/my_strspn.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "my_strspn.h"
-
-int is_in(char c, const char *accept)
-{
- for (; *accept && *accept != c; accept++)
- {
- continue;
- }
- return *accept != '\0';
-}
-
-size_t my_strspn(const char *s, const char *accept)
-{
- if (s == NULL || *s == '\0')
- {
- return 0;
- }
-
- size_t res;
- for (res = 0; *s && is_in(*s, accept) != 0; res++, s++)
- {
- continue;
- }
-
- return res;
-}
diff --git a/rushs/tinyprintf/my_strspn/my_strspn.h b/rushs/tinyprintf/my_strspn/my_strspn.h
deleted file mode 100644
index f2d7759..0000000
--- a/rushs/tinyprintf/my_strspn/my_strspn.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MY_STRSPN_H
-#define MY_STRSPN_H
-
-#include <stddef.h>
-
-size_t my_strspn(const char *s, const char *accept);
-
-#endif /* ! MY_STRSPN_H */
diff --git a/rushs/tinyprintf/my_strstr/my_strstr.c b/rushs/tinyprintf/my_strstr/my_strstr.c
deleted file mode 100644
index 36ac439..0000000
--- a/rushs/tinyprintf/my_strstr/my_strstr.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "my_strstr.h"
-
-#include <stddef.h>
-
-int my_strstr(const char *haystack, const char *needle)
-{
- if (needle == NULL || *needle == '\0')
- {
- return 0;
- }
-
- for (int i = 0; haystack[i]; i++)
- {
- if (haystack[i] == needle[0])
- {
- int j;
- for (j = 0;
- haystack[i + j] && needle[j] && needle[j] == haystack[i + j];
- j++)
- {
- continue;
- }
- if (needle[j] == '\0')
- {
- return i;
- }
- if (haystack[i + j] == '\0')
- {
- return -1;
- }
- }
- }
- return -1;
-}
diff --git a/rushs/tinyprintf/my_strstr/my_strstr.h b/rushs/tinyprintf/my_strstr/my_strstr.h
deleted file mode 100644
index 1b734b2..0000000
--- a/rushs/tinyprintf/my_strstr/my_strstr.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_STRSTR_H
-#define MY_STRSTR_H
-
-int my_strstr(const char *haystack, const char *needle);
-
-#endif /* ! MY_STRSTR_H */
diff --git a/rushs/tinyprintf/my_strtok_r/my_strtok_r.c b/rushs/tinyprintf/my_strtok_r/my_strtok_r.c
deleted file mode 100644
index ec052b7..0000000
--- a/rushs/tinyprintf/my_strtok_r/my_strtok_r.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "my_strtok_r.h"
-
-#include <stddef.h>
-
-static int is_delim(char c, const char *delims)
-{
- for (const char *d = delims; *d; d++)
- {
- if (*d == c)
- return 1;
- }
- return 0;
-}
-
-char *my_strtok_r(char *str, const char *delim, char **saveptr)
-{
- if (str == NULL)
- {
- if (*saveptr == NULL)
- {
- return NULL;
- }
- str = *saveptr;
- }
-
- size_t i = 0;
- while (str[i] != '\0' && is_delim(str[i], delim))
- {
- i++;
- }
- if (str[i] == '\0')
- {
- *saveptr = NULL;
- return NULL;
- }
-
- char *res = str + i;
-
- while (str[i] != '\0' && !is_delim(str[i], delim))
- {
- i++;
- }
- if (str[i] == '\0')
- {
- *saveptr = NULL;
- return res;
- }
- *saveptr = str + i + 1;
- str[i] = '\0';
- return res;
-}
diff --git a/rushs/tinyprintf/my_strtok_r/my_strtok_r.h b/rushs/tinyprintf/my_strtok_r/my_strtok_r.h
deleted file mode 100644
index 5603729..0000000
--- a/rushs/tinyprintf/my_strtok_r/my_strtok_r.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MY_STRTOK_R_H
-#define MY_STRTOK_R_H
-
-char *my_strtok_r(char *str, const char *delim, char **saveptr);
-
-#endif /* ! MY_STRTOK_R_H */
diff --git a/rushs/tinyprintf/null_terminated_arrays/null_terminated_arrays.c b/rushs/tinyprintf/null_terminated_arrays/null_terminated_arrays.c
deleted file mode 100644
index 32d2a17..0000000
--- a/rushs/tinyprintf/null_terminated_arrays/null_terminated_arrays.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "null_terminated_arrays.h"
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdio.h>
-
-void reverse_array(const char **arr)
-{
- const char **p;
- for (p = arr; *p; p++)
- {
- continue;
- }
- p--;
-
- while (p > arr)
- {
- const char *tmp = *p;
- *p = *arr;
- *arr = tmp;
- arr++;
- p--;
- }
-}
-
-void reverse_matrix(const char ***matrix)
-{
- const char ***p;
- for (p = matrix; *p; p++)
- {
- continue;
- }
- p--;
-
- while (p > matrix)
- {
- reverse_array(*p);
- reverse_array(*matrix);
- const char **tmp = *p;
- *p = *matrix;
- *matrix = tmp;
- matrix++;
- p--;
- }
-
- if (p == matrix)
- {
- reverse_array(*matrix);
- }
-}
diff --git a/rushs/tinyprintf/null_terminated_arrays/null_terminated_arrays.h b/rushs/tinyprintf/null_terminated_arrays/null_terminated_arrays.h
deleted file mode 100644
index 31fccc5..0000000
--- a/rushs/tinyprintf/null_terminated_arrays/null_terminated_arrays.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef NULL_TERMINATED_ARRAYS_H_
-#define NULL_TERMINATED_ARRAYS_H_
-
-void reverse_matrix(const char ***matrix);
-
-#endif /* !NULL_TERMINATED_ARRAYS_H_ */
diff --git a/rushs/tinyprintf/number_digits_rec/number_digits_rec.c b/rushs/tinyprintf/number_digits_rec/number_digits_rec.c
deleted file mode 100644
index 94de296..0000000
--- a/rushs/tinyprintf/number_digits_rec/number_digits_rec.c
+++ /dev/null
@@ -1,8 +0,0 @@
-unsigned int number_digits_rec(unsigned int n)
-{
- if (n / 10 == 0)
- {
- return 1;
- }
- return 1 + number_digits_rec(n / 10);
-}
diff --git a/rushs/tinyprintf/palindrome/palindrome.c b/rushs/tinyprintf/palindrome/palindrome.c
deleted file mode 100644
index 2ecacfd..0000000
--- a/rushs/tinyprintf/palindrome/palindrome.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "palindrome.h"
-
-#include <stddef.h>
-
-int palindrome(const char *s)
-{
- if (s == NULL)
- {
- return 0;
- }
-
- if (*s == '\0')
- {
- return 1;
- }
-
- const char *p = s;
- while (*p)
- {
- p++;
- }
- p--;
-
- while (p > s)
- {
- while ((*p < '0' || (*p > '9' && *p < 'A') || (*p > 'Z' && *p < 'a')
- || *p > 'z')
- && p > s)
- {
- p--;
- }
- while ((*s < '0' || (*s > '9' && *s < 'A') || (*s > 'Z' && *s < 'a')
- || *s > 'z')
- && p > s)
- {
- s++;
- }
- if (*p != *s)
- {
- return 0;
- }
- p--;
- s++;
- }
-
- return 1;
-}
diff --git a/rushs/tinyprintf/palindrome/palindrome.h b/rushs/tinyprintf/palindrome/palindrome.h
deleted file mode 100644
index 8595911..0000000
--- a/rushs/tinyprintf/palindrome/palindrome.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef PALINDROME_H
-#define PALINDROME_H
-
-int palindrome(const char *s);
-
-#endif /* !PALINDROME_H */
diff --git a/rushs/tinyprintf/pine/pine.c b/rushs/tinyprintf/pine/pine.c
deleted file mode 100644
index 9d48761..0000000
--- a/rushs/tinyprintf/pine/pine.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <stdio.h>
-
-int pine(unsigned n)
-{
- if (n < 3)
- {
- return 1;
- }
-
- for (unsigned i = 0; i < n; i++)
- {
- for (unsigned j = 0; j < n - i - 1; j++)
- {
- putchar(' ');
- }
-
- for (unsigned j = 0; j < 2 * i + 1; j++)
- {
- putchar('*');
- }
-
- putchar('\n');
- }
-
- for (unsigned i = 0; i < n / 2; i++)
- {
- for (unsigned j = 0; j < n - 1; j++)
- {
- putchar(' ');
- }
- putchar('*');
- putchar('\n');
- }
-
- return 0;
-}
diff --git a/rushs/tinyprintf/pointer_swap/pointer_swap.c b/rushs/tinyprintf/pointer_swap/pointer_swap.c
deleted file mode 100644
index 32ceb84..0000000
--- a/rushs/tinyprintf/pointer_swap/pointer_swap.c
+++ /dev/null
@@ -1,6 +0,0 @@
-void pointer_swap(int **a, int **b)
-{
- int *tmp = *a;
- *a = *b;
- *b = tmp;
-}
diff --git a/rushs/tinyprintf/prototypes/prototypes.sh b/rushs/tinyprintf/prototypes/prototypes.sh
deleted file mode 100755
index 3c80468..0000000
--- a/rushs/tinyprintf/prototypes/prototypes.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-sed -En 's/^(([a-zA-Z]* ){0,2}([a-zA-Z]*) *\**([a-z][a-z0-9_]*)\((([a-zA-Z]* )?([a-zA-Z]* )?([a-z][a-z0-9_]* *)(\**[a-z][a-z0-9_]*|[a-z][a-z0-9_]*\[([0-9][0-9]*)?\])(, ([a-zA-Z]* )?([a-zA-Z]* )?([a-z][a-z0-9_]* *)(\**[a-z][a-z0-9_]*|[a-z][a-z0-9_]*\[([0-9][0-9]*)?\])){0,3}|void)\))$/\1;/p' "$1"
diff --git a/rushs/tinyprintf/quick_sort/quick_sort.c b/rushs/tinyprintf/quick_sort/quick_sort.c
deleted file mode 100644
index 6c61fc3..0000000
--- a/rushs/tinyprintf/quick_sort/quick_sort.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stddef.h>
-
-void quicksort(int *tab, size_t len)
-{
- if (tab == NULL)
- {
- return;
- }
- for (size_t i = 1; i < len; i++)
- {
- for (size_t j = i; j > 0 && tab[j - 1] > tab[j]; j--)
- {
- int tmp = tab[j];
- tab[j] = tab[j - 1];
- tab[j - 1] = tmp;
- }
- }
-}
diff --git a/rushs/tinyprintf/quick_sort/quick_sort_example.c b/rushs/tinyprintf/quick_sort/quick_sort_example.c
deleted file mode 100644
index 2a5228f..0000000
--- a/rushs/tinyprintf/quick_sort/quick_sort_example.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdio.h>
-
-void quicksort(int *tab, int len);
-
-int main(void)
-{
- unsigned i = 0;
- int tab[] = { 10, 11, 2, 3, 8, 5, 7, 6, 26, 30, 2, 1, 17, 13, 14 };
-
- unsigned size = sizeof(tab) / sizeof(int);
-
- quicksort(tab, size);
-
- for (; i < size - 1; ++i)
- printf("%d ", tab[i]);
- printf("%d\n", tab[i]);
-
- return 0;
-}
diff --git a/rushs/tinyprintf/repeat/repeat.c b/rushs/tinyprintf/repeat/repeat.c
deleted file mode 100644
index 06d0b43..0000000
--- a/rushs/tinyprintf/repeat/repeat.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-
-int main(int argc, char **argv)
-{
- if (argc != 3)
- return 1;
-
- for (int i = 0; i < argv[2][0] - '0'; i++)
- puts(argv[1]);
- return 0;
-}
diff --git a/rushs/tinyprintf/right_tarball/my_tarball.tar.gz b/rushs/tinyprintf/right_tarball/my_tarball.tar.gz
deleted file mode 100644
index eb6acfc..0000000
--- a/rushs/tinyprintf/right_tarball/my_tarball.tar.gz
+++ /dev/null
Binary files differ
diff --git a/rushs/tinyprintf/rotx/rotx.c b/rushs/tinyprintf/rotx/rotx.c
deleted file mode 100644
index a2cb820..0000000
--- a/rushs/tinyprintf/rotx/rotx.c
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-
-#define BUFFER_SIZE 10
-
-int main(int argc, char **argv)
-{
- if (argc != 2)
- {
- return 0;
- }
-
- int rot = atoi(argv[1]);
- int rod = rot;
- if (rot < 0)
- {
- rot = (rot % 26) + 26;
- rod = (rod % 10) + 10;
- }
-
- char buf[BUFFER_SIZE];
- ssize_t r;
-
- while ((r = read(STDIN_FILENO, buf, BUFFER_SIZE)))
- {
- if (r == -1)
- {
- return 1;
- }
-
- for (ssize_t i = 0; i < r; i++)
- {
- if (buf[i] >= 'a' && buf[i] <= 'z')
- {
- buf[i] = ((buf[i] - 'a') + rot) % 26 + 'a';
- }
- else if (buf[i] >= 'A' && buf[i] <= 'Z')
- {
- buf[i] = ((buf[i] - 'A') + rot) % 26 + 'A';
- }
- else if (buf[i] >= '0' && buf[i] <= '9')
- {
- buf[i] = ((buf[i] - '0') + rod) % 10 + '0';
- }
- }
-
- ssize_t w = write(STDOUT_FILENO, buf, r);
- while (w != r)
- {
- w += write(STDOUT_FILENO, buf, r);
- if (w == -1)
- {
- return 1;
- }
- }
- }
-
- return 0;
-}
diff --git a/rushs/tinyprintf/sed_trailing_whitespaces/whitespaces.sed b/rushs/tinyprintf/sed_trailing_whitespaces/whitespaces.sed
deleted file mode 100644
index 46b7017..0000000
--- a/rushs/tinyprintf/sed_trailing_whitespaces/whitespaces.sed
+++ /dev/null
@@ -1 +0,0 @@
-s/[ \t]*$//
diff --git a/rushs/tinyprintf/selection_sort/selection_sort.c b/rushs/tinyprintf/selection_sort/selection_sort.c
deleted file mode 100644
index 98adc7e..0000000
--- a/rushs/tinyprintf/selection_sort/selection_sort.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <stddef.h>
-
-void swap(int *a, int *b)
-{
- int tmp = *a;
- *a = *b;
- *b = tmp;
-}
-
-unsigned array_min(const int arr[], unsigned start, unsigned size)
-{
- unsigned min = start;
- for (; start < size; start++)
- {
- if (arr[min] > arr[start])
- {
- min = start;
- }
- }
- return min;
-}
-
-void selection_sort(int arr[], unsigned size)
-{
- for (size_t i = 0; i < size; i++)
- {
- unsigned j = array_min(arr, i, size);
- swap(&(arr[i]), &(arr[j]));
- }
-}
diff --git a/rushs/tinyprintf/seq/seq.sh b/rushs/tinyprintf/seq/seq.sh
deleted file mode 100755
index 9721432..0000000
--- a/rushs/tinyprintf/seq/seq.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-if [ $# -ne 3 ]; then
- echo "Usage: ./seq.sh FIRST INCREMENT LAST" 1>&2
- exit 1
-fi
-
-if [ "$2" -eq 0 ]; then
- exit 1
-fi
-
-if [ "$1" -eq "$3" ]; then
- echo "$1"
- exit 0
-fi
-
-if [ "$1" -lt "$3" ]; then
- [ 0 -gt "$2" ] && exit 1
- i="$1"
- while [ "$3" -ge "$i" ]; do
- echo "$i"
- i=$(($i + $2))
- done
- exit 0
-fi
-
-[ "$2" -gt 0 ] && exit 1
-i="$1"
-while [ "$i" -ge "$3" ]; do
- echo "$i"
- i=$(($i + $2))
-done
-exit 0
diff --git a/rushs/tinyprintf/sieve_eratosthenes_advanced/Makefile b/rushs/tinyprintf/sieve_eratosthenes_advanced/Makefile
deleted file mode 100644
index c7e35f9..0000000
--- a/rushs/tinyprintf/sieve_eratosthenes_advanced/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-CC=gcc
-CFLAGS=-std=c99 -Wall -Wextra -Werror -Wvla -pedantic
-LDLIBS=
-
-all: sieve.o
-
-sieve.o: sieve.c
- $(CC) $(CFLAGS) -c -o sieve.o sieve.c
-
-.PHONY: clean
-
-clean:
- rm sieve.o
diff --git a/rushs/tinyprintf/sieve_eratosthenes_advanced/sieve.c b/rushs/tinyprintf/sieve_eratosthenes_advanced/sieve.c
deleted file mode 100644
index 7dd4816..0000000
--- a/rushs/tinyprintf/sieve_eratosthenes_advanced/sieve.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-void sieve(int n)
-{
- if (n <= 2)
- {
- return;
- }
-
- // Generate array
- int *a = calloc(n, sizeof(int));
- int count = 0;
-
- // Actual sieve and count
- for (int i = 2; i < n; i++)
- {
- if (a[i] == 0)
- {
- for (int k = 2 * i; k < n; k += i)
- {
- a[k] = 1;
- }
- }
- }
-
- for (int i = 2; i < n; i++)
- {
- if (a[i] == 0)
- {
- count++;
- }
- }
-
- // Print the count
- printf("%d\n", count);
-
- free(a);
-}
diff --git a/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c b/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c
deleted file mode 100644
index d40353f..0000000
--- a/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "simple_fnmatch.h"
-
-int simple_fnmatch(const char *pattern, const char *string)
-{
- if (!pattern || !string)
- return FNM_NOMATCH;
- if (*pattern == '*' && pattern[1] == '\0')
- return 0;
- while (*pattern && *string)
- {
- if (*pattern == '?')
- {
- pattern++;
- string++;
- }
- else if (*pattern == '\\')
- {
- pattern++;
- if (!pattern || *pattern != *string)
- return FNM_NOMATCH;
- string++;
- pattern++;
- }
- else if (*pattern == '*')
- {
- pattern++;
- while (*string && simple_fnmatch(pattern, string))
- string++;
- if (*string)
- return 0;
- }
- else if (*pattern != *string)
- return FNM_NOMATCH;
- else
- {
- string++;
- pattern++;
- }
- }
-
- if (*pattern == '*' && pattern[1] == '\0')
- return 0;
- if (*string || *pattern)
- return FNM_NOMATCH;
- return 0;
-}
diff --git a/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.h b/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.h
deleted file mode 100644
index e1ae166..0000000
--- a/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef SIMPLE_FNMATCH_H
-#define SIMPLE_FNMATCH_H
-
-#define FNM_NOMATCH 1
-
-int simple_fnmatch(const char *pattern, const char *string);
-
-#endif /* !SIMPLE_FNMATCH_H */
diff --git a/rushs/evalexpr/tinyprintf/src/tinyprintf.c b/rushs/tinyprintf/src/tinyprintf.c
index d005db7..d005db7 100644
--- a/rushs/evalexpr/tinyprintf/src/tinyprintf.c
+++ b/rushs/tinyprintf/src/tinyprintf.c
diff --git a/rushs/evalexpr/tinyprintf/src/tinyprintf.h b/rushs/tinyprintf/src/tinyprintf.h
index fd1f0b4..fd1f0b4 100644
--- a/rushs/evalexpr/tinyprintf/src/tinyprintf.h
+++ b/rushs/tinyprintf/src/tinyprintf.h
diff --git a/rushs/tinyprintf/stack/stack.c b/rushs/tinyprintf/stack/stack.c
deleted file mode 100644
index 0498abc..0000000
--- a/rushs/tinyprintf/stack/stack.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "stack.h"
-
-#include <stdlib.h>
-
-struct stack *stack_push(struct stack *s, int e)
-{
- struct stack *new = malloc(sizeof(struct stack));
- new->data = e;
- new->next = NULL;
-
- new->next = s;
- return new;
-}
-
-struct stack *stack_pop(struct stack *s)
-{
- if (s == NULL)
- {
- return NULL;
- }
-
- struct stack *res = s->next;
- free(s);
- return res;
-}
-
-int stack_peek(struct stack *s)
-{
- return s->data;
-}
diff --git a/rushs/tinyprintf/stack/stack.h b/rushs/tinyprintf/stack/stack.h
deleted file mode 100644
index bd5dd24..0000000
--- a/rushs/tinyprintf/stack/stack.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef STACK_H
-#define STACK_H
-
-struct stack
-{
- int data;
- struct stack *next;
-};
-
-struct stack *stack_push(struct stack *s, int e);
-struct stack *stack_pop(struct stack *s);
-int stack_peek(struct stack *s);
-
-#endif /* !STACK_H */
diff --git a/rushs/tinyprintf/str_revert/str_revert.c b/rushs/tinyprintf/str_revert/str_revert.c
deleted file mode 100644
index 31f7f3d..0000000
--- a/rushs/tinyprintf/str_revert/str_revert.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "str_revert.h"
-
-#include <stddef.h>
-
-void str_revert(char str[])
-{
- if (*str == '\0')
- {
- return;
- }
-
- size_t len = 0;
- for (; str[len]; len++)
- {
- continue;
- }
- len--;
-
- for (size_t i = 0; i <= len / 2; i++)
- {
- char tmp = str[i];
- str[i] = str[len - i];
- str[len - i] = tmp;
- }
-}
diff --git a/rushs/tinyprintf/str_revert/str_revert.h b/rushs/tinyprintf/str_revert/str_revert.h
deleted file mode 100644
index daa23d4..0000000
--- a/rushs/tinyprintf/str_revert/str_revert.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef STR_REVERT_H
-#define STR_REVERT_H
-
-void str_revert(char str[]);
-
-#endif /* ! STR_REVERT_H */
diff --git a/rushs/tinyprintf/test.txt b/rushs/tinyprintf/test.txt
deleted file mode 100644
index 958cdbc..0000000
--- a/rushs/tinyprintf/test.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This is a short line.
-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-This is another short line.
diff --git a/rushs/tinyprintf/test_a_bit/is_set.c b/rushs/tinyprintf/test_a_bit/is_set.c
deleted file mode 100644
index 38fccf8..0000000
--- a/rushs/tinyprintf/test_a_bit/is_set.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "is_set.h"
-
-unsigned int is_set(unsigned int value, unsigned char n)
-{
- return (value & (1 << (n - 1))) != 0;
-}
diff --git a/rushs/tinyprintf/test_a_bit/is_set.h b/rushs/tinyprintf/test_a_bit/is_set.h
deleted file mode 100644
index 8f2fd9a..0000000
--- a/rushs/tinyprintf/test_a_bit/is_set.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef IS_SET_H
-#define IS_SET_H
-
-unsigned int is_set(unsigned int value, unsigned char n);
-
-#endif /* ! IS_SET_H */
diff --git a/rushs/tinyprintf/test_a_bit/test.c b/rushs/tinyprintf/test_a_bit/test.c
deleted file mode 100644
index e3403e4..0000000
--- a/rushs/tinyprintf/test_a_bit/test.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-
-#include "is_set.h"
-
-int main(void)
-{
- printf("%d\n", is_set(24, 4));
- printf("%d\n", is_set(24, 3));
-
- return 0;
-}
diff --git a/rushs/evalexpr/tinyprintf/tests/tests.c b/rushs/tinyprintf/tests/tests.c
index 4235203..4235203 100644
--- a/rushs/evalexpr/tinyprintf/tests/tests.c
+++ b/rushs/tinyprintf/tests/tests.c
diff --git a/rushs/tinyprintf/tinylibstream/Makefile b/rushs/tinyprintf/tinylibstream/Makefile
deleted file mode 100644
index b060495..0000000
--- a/rushs/tinyprintf/tinylibstream/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-CC = gcc
-CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
-
-.PHONY: library clean
-
-library: src/tinylibstream.o
- ar csr libstream.a src/tinylibstream.o
-
-clean:
- rm libstream.a src/tinylibstream.o
-
-check:
- $(CC) $(CFLAGS) -lcriterion src/tinylibstream.c tests/tests.c
diff --git a/rushs/tinyprintf/tinylibstream/include/libstream.h b/rushs/tinyprintf/tinylibstream/include/libstream.h
deleted file mode 100644
index 459432d..0000000
--- a/rushs/tinyprintf/tinylibstream/include/libstream.h
+++ /dev/null
@@ -1,167 +0,0 @@
-#ifndef LIBSTREAM_H
-#define LIBSTREAM_H
-
-#include <fcntl.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <unistd.h>
-
-/*
-** /!\ DO NOT MODIFY THIS FILE, AS IT WILL BE OVERRIDDEN DURING CORRECTION. /!\
-**
-** You can add your own functions declarations to OTHER HEADER FILES.
-*/
-
-/* the value returned when end of file is reached */
-#define LBS_EOF (-1)
-
-/* the size of the buffer */
-#define LBS_BUFFER_SIZE 32
-
-/*
-** Describes the current operation:
-** - if reading, the buffer contains read-buffered data
-** - if writing, the buffer contains write-buffered data
-*/
-enum stream_io_operation
-{
- STREAM_READING = 0,
- STREAM_WRITING,
-};
-
-/*
-** Controls when to flush the buffer:
-** - when unbuffered, flush every time a character is written
-** - when buffered, flush when the buffer is full
-** - when line buffered, flush when the buffer is full or when a \n
-** character is written
-*/
-enum stream_buffering
-{
- STREAM_UNBUFFERED = 0,
- STREAM_LINE_BUFFERED,
- STREAM_BUFFERED,
-};
-
-struct stream
-{
- /* the flags passed to open */
- int flags;
-
- /*
- ** Initially, this variable is 0.
- ** When a function such as fgetc fails, it is set to 1 to indicate
- ** something went wrong. This is useful to make the difference between
- ** reaching the end of file and read errors while using fgetc and
- ** some others.
- ** It is often referred to as the error indicator.
- */
- int error;
-
- /* the file descriptor, as returned by open(2) */
- int fd;
-
- /*
- ** the kind of data stored by the buffer.
- ** The default value shouldn't matter.
- */
- enum stream_io_operation io_operation;
-
- /*
- ** defines when to flush **output**.
- ** This field does not control input buffering (which is always fully
- ** buffered).
- **
- ** The default value is LINE_BUFFERED if isatty(fd), BUFFERED otherwise.
- */
- enum stream_buffering buffering_mode;
-
- /* the amount of used bytes in the buffer */
- size_t buffered_size;
-
- /*
- ** /!\ This field only makes sense when io_operation is STREAM_READING /!\
- ** the amount of data already read from the buffer by the user.
- */
- size_t already_read;
-
- /*
- ** buffer
- ** -------------->
- ** +==============+====================+---------------------+
- ** | already_read | remaining_buffered | unused_buffer_space |
- ** +==============+====================+---------------------+
- ** \_______________________________/
- ** buffered_size
- **
- ** /!\ The buffer can contain either read-buffered or write-buffered data,
- ** depending on the value of io_operation /!\
- */
- char buffer[LBS_BUFFER_SIZE];
-};
-
-/*
-** These functions are defined in a header for optimization reasons:
-** each .c file that includes this header will get its own copy of the
-** function's code, thus easily make optimizations.
-**
-** ``static`` means each compilation unit (.c file) will have its own copy
-** of the function without them clashing.
-**
-** ``inline`` means the content of the function should be "copy pasted"
-** where it's called. It also tells the compiler not to complain when the
-** function isn't used.
-**
-** They're just like a macro, except the type of arguments is checked.
-*/
-
-static inline size_t stream_remaining_buffered(struct stream *stream)
-{
- return stream->buffered_size - stream->already_read;
-}
-
-static inline size_t stream_unused_buffer_space(struct stream *stream)
-{
- return sizeof(stream->buffer) - stream->buffered_size;
-}
-
-static inline bool stream_readable(struct stream *stream)
-{
- int access_mode = stream->flags & O_ACCMODE;
- if (access_mode == O_RDWR)
- return true;
- return access_mode == O_RDONLY;
-}
-
-static inline bool stream_writable(struct stream *stream)
-{
- int access_mode = stream->flags & O_ACCMODE;
- if (access_mode == O_RDWR)
- return true;
- return access_mode == O_WRONLY;
-}
-
-static inline int lbs_ferror(struct stream *stream)
-{
- return stream->error;
-}
-
-static inline void lbs_clearerr(struct stream *stream)
-{
- stream->error = 0;
-}
-
-static inline void lbs_setbufmode(struct stream *stream,
- enum stream_buffering mode)
-{
- stream->buffering_mode = mode;
-}
-
-struct stream *lbs_fopen(const char *path, const char *mode);
-struct stream *lbs_fdopen(int fd, const char *mode);
-int lbs_fflush(struct stream *stream);
-int lbs_fclose(struct stream *stream);
-int lbs_fputc(int c, struct stream *stream);
-int lbs_fgetc(struct stream *stream);
-
-#endif /* !LIBSTREAM_H */
diff --git a/rushs/tinyprintf/tinylibstream/src/tinylibstream.c b/rushs/tinyprintf/tinylibstream/src/tinylibstream.c
deleted file mode 100644
index dca1c01..0000000
--- a/rushs/tinyprintf/tinylibstream/src/tinylibstream.c
+++ /dev/null
@@ -1,221 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-
-#include "../include/libstream.h"
-
-int get_flags(const char *mode)
-{
- int flags;
- if (strcmp(mode, "r") == 0)
- {
- flags = O_RDONLY;
- }
- else if (strcmp(mode, "r+") == 0)
- {
- flags = O_RDWR;
- }
- else if (strcmp(mode, "w") == 0)
- {
- flags = O_WRONLY | O_TRUNC | O_CREAT;
- }
- else
- {
- flags = O_RDWR | O_TRUNC | O_CREAT;
- }
-
- return flags;
-}
-
-struct stream *lbs_fopen(const char *path, const char *mode)
-{
- int fd = open(path, get_flags(mode));
-
- return lbs_fdopen(fd, mode);
-}
-
-struct stream *lbs_fdopen(int fd, const char *mode)
-{
- if (fd == -1)
- {
- return NULL;
- }
-
- struct stream *s = malloc(sizeof(struct stream));
- if (s == NULL)
- {
- return NULL;
- }
-
- s->flags = get_flags(mode);
- s->error = 0;
- s->fd = fd;
- if (isatty(fd))
- {
- s->buffering_mode = STREAM_LINE_BUFFERED;
- }
- else
- {
- s->buffering_mode = STREAM_BUFFERED;
- }
- s->buffered_size = 0;
- s->already_read = 0;
-
- return s;
-}
-
-int lbs_fflush(struct stream *stream)
-{
- if (stream == NULL || stream->buffered_size == 0)
- {
- return 0;
- }
-
- if (stream->io_operation == STREAM_READING)
- {
- if (!stream_readable(stream))
- {
- stream->error = 1;
- return LBS_EOF;
- }
- if (stream_remaining_buffered(stream) != 0
- && lseek(stream->fd, -stream_remaining_buffered(stream), SEEK_CUR)
- == -1)
- {
- stream->error = 1;
- return LBS_EOF;
- }
- stream->buffered_size = 0;
- stream->already_read = 0;
- }
- else
- {
- if (!stream_writable(stream))
- {
- stream->error = 1;
- return LBS_EOF;
- }
- ssize_t w;
- if ((w = write(stream->fd, stream->buffer, stream->buffered_size))
- == -1)
- {
- stream->error = 1;
- return LBS_EOF;
- }
- stream->buffered_size = 0;
- stream->already_read = 0;
- }
- return 0;
-}
-
-int lbs_fclose(struct stream *stream)
-{
- if (stream == NULL)
- {
- return 1;
- }
-
- lbs_fflush(stream);
- if (close(stream->fd) == -1)
- {
- return 1;
- }
-
- free(stream);
-
- return 0;
-}
-
-int lbs_fputc(int c, struct stream *stream)
-{
- if (!stream_writable(stream))
- {
- stream->error = 1;
- return -1;
- }
-
- if (stream->io_operation == STREAM_READING)
- {
- if (lbs_fflush(stream) != 0)
- {
- return -1;
- }
- stream->buffered_size = 0;
- stream->already_read = 0;
- }
- stream->io_operation = STREAM_WRITING;
-
- if (stream_unused_buffer_space(stream) == 0
- || stream->buffering_mode == STREAM_UNBUFFERED)
- {
- if (lbs_fflush(stream) != 0)
- {
- return -1;
- }
- }
-
- stream->buffer[stream->buffered_size] = c;
- stream->buffered_size++;
- if (stream_unused_buffer_space(stream) == 0
- || stream->buffering_mode == STREAM_UNBUFFERED
- || (stream->buffering_mode == STREAM_LINE_BUFFERED && c == '\n'))
- {
- if (lbs_fflush(stream) != 0)
- {
- return -1;
- }
- }
-
- return c;
-}
-
-int refill_buffer(struct stream *stream)
-{
- stream->already_read = 0;
- ssize_t r;
- if ((r = read(stream->fd, stream->buffer, LBS_BUFFER_SIZE)) == -1)
- {
- stream->error = 1;
- return -1;
- }
- if (r == 0)
- {
- return -1;
- }
- stream->buffered_size = r;
- return r;
-}
-
-int lbs_fgetc(struct stream *stream)
-{
- if (!stream_readable(stream))
- {
- stream->error = 1;
- return -1;
- }
- if (stream->io_operation == STREAM_WRITING)
- {
- if (lbs_fflush(stream) != 0)
- {
- stream->error = 1;
- return -1;
- }
- stream->already_read = 0;
- }
- stream->io_operation = STREAM_READING;
-
- if (stream_remaining_buffered(stream) == 0)
- {
- int r;
- if ((r = refill_buffer(stream)) == -1)
- {
- stream->error = 1;
- return -1;
- }
- }
-
- int res = stream->buffer[stream->already_read++];
-
- unsigned char c = res;
-
- return c;
-}
diff --git a/rushs/tinyprintf/tinylibstream/stdin_buffering_test.c b/rushs/tinyprintf/tinylibstream/stdin_buffering_test.c
deleted file mode 100644
index 6d3361b..0000000
--- a/rushs/tinyprintf/tinylibstream/stdin_buffering_test.c
+++ /dev/null
@@ -1,70 +0,0 @@
-#define _GNU_SOURCE
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-struct slow_cookie
-{
- int fd;
-};
-
-static ssize_t slow_read(void *vcookie, char *buf, size_t count)
-{
- struct slow_cookie *cookie = vcookie;
- usleep(500000); // sleep for half of a second
-
- ssize_t res;
-
- while ((res = read(cookie->fd, buf, count)) < 0)
- if (errno != EINTR && errno != EAGAIN)
- break;
-
- return res;
-}
-
-static int slow_close(void *vcookie)
-{
- struct slow_cookie *cookie = vcookie;
- return close(cookie->fd);
-}
-
-cookie_io_functions_t slow_stdio = {
- .read = slow_read,
- .close = slow_close,
-};
-
-int main(void)
-{
- /* setup a custom stdin stream with a slow read function */
- struct slow_cookie cookie = {
- .fd = STDIN_FILENO,
- };
-
- FILE *input_stream = fopencookie(&cookie, "r", slow_stdio);
-
- /* change the buffer size to the one given by stdbuf.
- ** it doesn't work out of the box as stdbuf only does
- ** this for the already existing stdin stream.
- */
- char *buffer = NULL;
- char *buffer_size = getenv("_STDBUF_I");
- if (buffer_size)
- {
- size_t size = atoi(buffer_size);
- buffer = malloc(size);
- setvbuf(input_stream, buffer, _IOFBF, size);
- }
-
- /* forward all characters from stdin to stdout */
- int c;
- while ((c = fgetc(input_stream)) != EOF)
- {
- fputc(c, stdout);
- fflush(stdout);
- }
-
- fclose(input_stream);
- free(buffer);
- return 0;
-}
diff --git a/rushs/tinyprintf/tinylibstream/stdout_buffering_test.c b/rushs/tinyprintf/tinylibstream/stdout_buffering_test.c
deleted file mode 100644
index 45c0a83..0000000
--- a/rushs/tinyprintf/tinylibstream/stdout_buffering_test.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#define _XOPEN_SOURCE 500
-#include <stdio.h>
-#include <unistd.h>
-
-int main(void)
-{
- const char test_string[] = "Robin\nloves\nBatman\n";
- for (size_t i = 0; test_string[i]; i++)
- {
- usleep(100000); // wait a tenth of a second
- putchar(test_string[i]);
- }
-}
diff --git a/rushs/tinyprintf/tinyprintf/Makefile b/rushs/tinyprintf/tinyprintf/Makefile
deleted file mode 100644
index 6a07d90..0000000
--- a/rushs/tinyprintf/tinyprintf/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-CC=gcc
-CFLAGS=-std=c99 -Wall -Wextra -Werror -Wvla -pedantic
-LDLIBS=-lcriterion
-
-all: src/tinyprintf.o
-
-check: src/tinyprintf.o
- $(CC) $(CFLAGS) -o tinytests src/tinyprintf.o tests/tests.c $(LDLIBS)
- ./tinytests
-
-src/tinyprintf.o: src/tinyprintf.c
- $(CC) $(CFLAGS) -c -o src/tinyprintf.o src/tinyprintf.c
-
-.PHONY: clean
-
-clean:
- rm src/tinyprintf.o tinytests
diff --git a/rushs/tinyprintf/tinyprintf/src/tinyprintf.c b/rushs/tinyprintf/tinyprintf/src/tinyprintf.c
deleted file mode 100644
index d005db7..0000000
--- a/rushs/tinyprintf/tinyprintf/src/tinyprintf.c
+++ /dev/null
@@ -1,251 +0,0 @@
-#include "tinyprintf.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int tinyprintf(const char *format, ...)
-{
- if (format == NULL || *format == '\0')
- {
- return 0;
- }
-
- va_list ap;
- va_start(ap, format);
- int res = 0;
-
- size_t i = 0;
- while (format[i])
- {
- if (format[i] != '%')
- {
- putchar(format[i]);
- res++;
- }
- else
- {
- dispatch(format[i + 1], ap, &res);
- format++;
- }
- format++;
- }
- va_end(ap);
- return res;
-}
-
-void dispatch(char c, va_list ap, int *res)
-{
- switch (c)
- {
- case '%':
- putchar('%');
- (*res)++;
- break;
- case 'd':
- handle_d(va_arg(ap, int), res);
- break;
- case 'u':
- handle_u(va_arg(ap, unsigned int), res);
- break;
- case 'x':
- handle_x(va_arg(ap, unsigned int), res);
- break;
- case 'o':
- handle_o(va_arg(ap, unsigned int), res);
- break;
- case 'c':
- putchar(va_arg(ap, int));
- (*res)++;
- break;
- case 's':
- handle_s(va_arg(ap, char *), res);
- break;
- default:
- putchar('%');
- putchar(c);
- *res += 2;
- break;
- }
-}
-
-void handle_d(int val, int *res)
-{
- if (val < 0)
- {
- putchar('-');
- (*res)++;
- val = -val;
- }
-
- if (val == 0)
- {
- putchar('0');
- (*res)++;
- }
-
- int t = val;
- int n = 0;
- while (t > 0)
- {
- t /= 10;
- n++;
- }
-
- char *s = malloc(n * sizeof(char));
- int m = n;
- if (s == NULL)
- {
- return;
- }
- n--;
- for (; n >= 0; n--)
- {
- s[n] = val % 10 + '0';
- val /= 10;
- }
-
- // actual printing
- for (int i = 0; i < m; i++)
- {
- putchar(s[i]);
- (*res)++;
- }
- free(s);
-}
-
-void handle_s(char *s, int *res)
-{
- if (s == NULL)
- {
- char *text = "(null)";
- for (; *text; text++)
- {
- putchar(*text);
- (*res)++;
- }
- return;
- }
- for (; *s; s++)
- {
- putchar(*s);
- (*res)++;
- }
-}
-
-void handle_u(unsigned int val, int *res)
-{
- if (val == 0)
- {
- putchar('0');
- (*res)++;
- }
-
- unsigned int t = val;
- int n = 0;
- while (t > 0)
- {
- t /= 10;
- n++;
- }
-
- char *s = malloc(n * sizeof(char));
- int m = n;
- if (s == NULL)
- {
- return;
- }
- n--;
- for (; n >= 0; n--)
- {
- s[n] = val % 10 + '0';
- val /= 10;
- }
-
- // actual printing
- for (int i = 0; i < m; i++)
- {
- putchar(s[i]);
- (*res)++;
- }
- free(s);
-}
-
-void handle_x(unsigned int val, int *res)
-{
- if (val == 0)
- {
- putchar('0');
- (*res)++;
- }
-
- unsigned int t = val;
- int n = 0;
- while (t > 0)
- {
- t /= 16;
- n++;
- }
-
- char *s = malloc(n * sizeof(char));
- int m = n;
- if (s == NULL)
- {
- return;
- }
- n--;
- for (; n >= 0; n--)
- {
- s[n] = val % 16 + '0';
- if (s[n] > '9')
- {
- s[n] = (s[n] - '0') % 10 + 'a';
- }
- val /= 16;
- }
-
- // actual printing
- for (int i = 0; i < m; i++)
- {
- putchar(s[i]);
- (*res)++;
- }
- free(s);
-}
-
-void handle_o(unsigned int val, int *res)
-{
- if (val == 0)
- {
- putchar('0');
- (*res)++;
- }
-
- unsigned int t = val;
- int n = 0;
- while (t > 0)
- {
- t /= 8;
- n++;
- }
-
- char *s = malloc(n * sizeof(char));
- int m = n;
- if (s == NULL)
- {
- return;
- }
- n--;
- for (; n >= 0; n--)
- {
- s[n] = val % 8 + '0';
- val /= 8;
- }
-
- // actual printing
- for (int i = 0; i < m; i++)
- {
- putchar(s[i]);
- (*res)++;
- }
- free(s);
-}
diff --git a/rushs/tinyprintf/tinyprintf/src/tinyprintf.h b/rushs/tinyprintf/tinyprintf/src/tinyprintf.h
deleted file mode 100644
index fd1f0b4..0000000
--- a/rushs/tinyprintf/tinyprintf/src/tinyprintf.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef TINYPRINTF_H
-#define TINYPRINTF_H
-
-#include <stdarg.h>
-#include <stddef.h>
-
-int tinyprintf(const char *format, ...);
-void handle_d(int val, int *res);
-void handle_u(unsigned int val, int *res);
-void handle_x(unsigned int val, int *res);
-void handle_o(unsigned int val, int *res);
-void handle_s(char *s, int *res);
-void dispatch(char c, va_list ap, int *res);
-
-#endif /* ! TINYPRINTF_H */
diff --git a/rushs/tinyprintf/tinyprintf/tests/tests.c b/rushs/tinyprintf/tinyprintf/tests/tests.c
deleted file mode 100644
index 4235203..0000000
--- a/rushs/tinyprintf/tinyprintf/tests/tests.c
+++ /dev/null
@@ -1,213 +0,0 @@
-#include <criterion/criterion.h>
-#include <criterion/assert.h>
-#include <criterion/redirect.h>
-#include <stdio.h>
-
-#include "../src/tinyprintf.h"
-
-TestSuite(TestHandleD);
-
-Test(TestHandleD, handle_d42, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_d(42, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("42");
- cr_expect(res == 2, "Expected: %d. Got: %d", 2, res);
-}
-
-Test(TestHandleD, handle_d0, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_d(0, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("0");
- cr_expect(res == 1, "Expected: %d. Got: %d", 1, res);
-}
-
-Test(TestHandleD, handle_dminus42, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_d(-42, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("-42");
- cr_expect(res == 3, "Expected: %d. Got: %d", 3, res);
-}
-
-Test(TestHandleD, simple_print, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf("%s [%d] %s", "Hello", 42, "world!");
- fflush(stdout);
- cr_assert_stdout_eq_str("Hello [42] world!");
- cr_expect(retval == 17, "Expected: %d. Got: %d", 17, retval);
-}
-
-TestSuite(TestHandleX);
-
-Test(TestHandleX, handle_x42, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_x(42, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("2a");
- cr_expect(res == 2, "Expected: %d. Got: %d", 2, res);
-}
-
-Test(TestHandleX, handle_x0, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_x(0, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("0");
- cr_expect(res == 1, "Expected: %d. Got: %d", 1, res);
-}
-
-Test(TestHandleX, handle_x15, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_x(15, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("f");
- cr_expect(res == 1, "Expected: %d. Got: %d", 1, res);
-}
-
-Test(TestHandleX, handle_0xdeadc0de, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_x(0xdeadc0de, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("deadc0de");
- cr_expect(res == 8, "Expected: %d. Got: %d", 8, res);
-}
-
-Test(TestHandleX, simple_print_hexa, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf("%s [%x] %s", "Hello", 42, "world!");
- fflush(stdout);
- cr_assert_stdout_eq_str("Hello [2a] world!");
- cr_expect(retval == 17, "Expected: %d. Got: %d", 17, retval);
-}
-
-TestSuite(TestHandleU);
-
-Test(TestHandleU, handle_u42, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_u(42, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("42");
- cr_expect(res == 2, "Expected: %d. Got: %d", 2, res);
-}
-
-Test(TestHandleU, handle_u0, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_u(0, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("0");
- cr_expect(res == 1, "Expected: %d. Got: %d", 1, res);
-}
-
-Test(TestHandleU, handle_u15, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_u(15, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("15");
- cr_expect(res == 2, "Expected: %d. Got: %d", 2, res);
-}
-
-Test(TestHandleU, simple_print_unsigned, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf("%s [%u] %s", "Hello", 42, "world!");
- fflush(stdout);
- cr_assert_stdout_eq_str("Hello [42] world!");
- cr_expect(retval == 17, "Expected: %d. Got: %d", 17, retval);
-}
-
-TestSuite(TestHandleO);
-
-Test(TestHandleO, handle_o42, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_o(42, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("52");
- cr_expect(res == 2, "Expected: %d. Got: %d", 2, res);
-}
-
-Test(TestHandleO, handle_o0, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_o(0, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("0");
- cr_expect(res == 1, "Expected: %d. Got: %d", 1, res);
-}
-
-Test(TestHandleO, handle_o7, .init = cr_redirect_stdout)
-{
- int res = 0;
- handle_o(7, &res);
- fflush(stdout);
- cr_assert_stdout_eq_str("7");
- cr_expect(res == 1, "Expected: %d. Got: %d", 1, res);
-}
-
-Test(TestHandleO, simple_print_octal, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf("%s [%o] %s", "Hello", 42, "world!");
- fflush(stdout);
- cr_assert_stdout_eq_str("Hello [52] world!");
- cr_expect(retval == 17, "Expected: %d. Got: %d", 17, retval);
-}
-
-TestSuite(TestPrint);
-
-Test(TestPrint, print_percent, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf("%%s", "in your head");
- fflush(stdout);
- cr_assert_stdout_eq_str("%s");
- cr_expect(retval == 2, "Expected: %d. Got: %d", 2, retval);
-}
-
-Test(TestPrint, print_unknown_option, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf("Good morning ACU! %t Tinyprintf is cool", 12);
- fflush(stdout);
- cr_assert_stdout_eq_str("Good morning ACU! %t Tinyprintf is cool");
- cr_expect(retval == 39, "Expected: %d. Got: %d", 39, retval);
-}
-
-Test(TestPrint, print_tricky, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf("%c%c is %s... %d too.", '4', '2', "the answer", '*');
- fflush(stdout);
- cr_assert_stdout_eq_str("42 is the answer... 42 too.");
- cr_expect(retval == 27, "Expected: %d. Got: %d", 27, retval);
-}
-
-Test(TestPrint, print_null, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf("%c%c is %s... %d too.", '4', '2', NULL, '*');
- fflush(stdout);
- cr_assert_stdout_eq_str("42 is (null)... 42 too.");
- cr_expect(retval == 23, "Expected: %d. Got: %d", 23, retval);
-}
-
-Test(TestPrint, print_null_fmt, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf(NULL, '4', '2', NULL, '*');
- fflush(stdout);
- cr_assert_stdout_eq_str("");
- cr_expect(retval == 0, "Expected: %d. Got: %d", 0, retval);
-}
-
-Test(TestPrint, print_empty_fmt, .init = cr_redirect_stdout)
-{
- int retval = tinyprintf("", '4', '2', NULL, '*');
- fflush(stdout);
- cr_assert_stdout_eq_str("");
- cr_expect(retval == 0, "Expected: %d. Got: %d", 0, retval);
-}
diff --git a/rushs/tinyprintf/traffic_lights/traffic_lights.c b/rushs/tinyprintf/traffic_lights/traffic_lights.c
deleted file mode 100644
index 76ea94f..0000000
--- a/rushs/tinyprintf/traffic_lights/traffic_lights.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "traffic_lights.h"
-
-void init(unsigned char *lights)
-{
- *lights <<= 4;
-}
-
-void turn_on(unsigned char *lights, unsigned char light_num)
-{
- *lights |= 1 << (light_num - 1);
-}
-
-void turn_off(unsigned char *lights, unsigned char light_num)
-{
- *lights &= ~(1 << (light_num - 1));
-}
-
-void next_step(unsigned char *lights)
-{
- *lights <<= 1;
- *lights += *lights >> 4;
-}
-
-void reverse(unsigned char *lights)
-{
- *lights = ~*lights;
-}
-
-void swap(unsigned char *lights_1, unsigned char *lights_2)
-{
- if (lights_1 == lights_2)
- {
- return;
- }
- *lights_1 = *lights_2 ^ *lights_1;
- *lights_2 = *lights_1 ^ *lights_2;
- *lights_1 = *lights_2 ^ *lights_1;
-}
diff --git a/rushs/tinyprintf/traffic_lights/traffic_lights.h b/rushs/tinyprintf/traffic_lights/traffic_lights.h
deleted file mode 100644
index 7c803ea..0000000
--- a/rushs/tinyprintf/traffic_lights/traffic_lights.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef TRAFFIC_LIGHTS_H
-#define TRAFFIC_LIGHTS_H
-
-void init(unsigned char *lights);
-void turn_on(unsigned char *lights, unsigned char light_num);
-void turn_off(unsigned char *lights, unsigned char light_num);
-void next_step(unsigned char *lights);
-void reverse(unsigned char *lights);
-void swap(unsigned char *lights_1, unsigned char *lights_2);
-
-#endif /* !TRAFFIC_LIGHTS_H */
diff --git a/rushs/tinyprintf/user_ids/get_ids.sh b/rushs/tinyprintf/user_ids/get_ids.sh
deleted file mode 100644
index 2a1668b..0000000
--- a/rushs/tinyprintf/user_ids/get_ids.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-cut --delimiter=: --fields=3 -s /etc/passwd | sort -rgu
diff --git a/rushs/tinyprintf/using_special_variables/print.sh b/rushs/tinyprintf/using_special_variables/print.sh
deleted file mode 100755
index c24bebd..0000000
--- a/rushs/tinyprintf/using_special_variables/print.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-echo $#
-echo $*
-echo $1
-echo $2
-echo $3
-echo ${13}
-echo $0
diff --git a/rushs/tinyprintf/variant/variant.c b/rushs/tinyprintf/variant/variant.c
deleted file mode 100644
index eb2f8a8..0000000
--- a/rushs/tinyprintf/variant/variant.c
+++ /dev/null
@@ -1,96 +0,0 @@
-#include "variant.h"
-
-#include <stdio.h>
-#include <string.h>
-
-void variant_display(const struct variant *e)
-{
- switch (e->type)
- {
- case (TYPE_INT):
- printf("%d\n", e->value.int_v);
- break;
- case (TYPE_FLOAT):
- printf("%f\n", e->value.float_v);
- break;
- case (TYPE_CHAR):
- printf("%c\n", e->value.char_v);
- break;
- default:
- printf("%s\n", e->value.str_v);
- break;
- }
-}
-
-bool variant_equal(const struct variant *left, const struct variant *right)
-{
- if (left == NULL || right == NULL)
- {
- return true;
- }
- switch (left->type)
- {
- case (TYPE_INT):
- if (right->type != TYPE_INT)
- {
- return false;
- }
- return left->value.int_v == right->value.int_v;
- case (TYPE_FLOAT):
- if (right->type != TYPE_FLOAT)
- {
- return false;
- }
- return left->value.float_v == right->value.float_v;
- case (TYPE_CHAR):
- if (right->type != TYPE_CHAR)
- {
- return false;
- }
- return left->value.char_v == right->value.char_v;
- default:
- if (right->type != TYPE_STRING)
- {
- return false;
- }
- return strcmp(left->value.str_v, right->value.str_v) == 0;
- }
-}
-
-int variant_find(const struct variant *array, size_t len, enum type type,
- union type_any value)
-{
- size_t i;
- struct variant cmp = { type, value };
- for (i = 0; i < len && variant_equal(array + i, &cmp) == false; i++)
- {
- continue;
- }
-
- if (i == len)
- {
- return -1;
- }
- return i;
-}
-
-float variant_sum(const struct variant *array, size_t len)
-{
- if (array == NULL)
- {
- return 0;
- }
- float sum = 0;
- for (size_t i = 0; i < len; i++)
- {
- if (array[i].type == TYPE_FLOAT)
- {
- sum += array[i].value.float_v;
- }
- else if (array[i].type == TYPE_INT)
- {
- sum += array[i].value.int_v;
- }
- }
- return sum;
-}
diff --git a/rushs/tinyprintf/variant/variant.h b/rushs/tinyprintf/variant/variant.h
deleted file mode 100644
index 9983bc1..0000000
--- a/rushs/tinyprintf/variant/variant.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef VARIANT_H
-#define VARIANT_H
-
-#include <stdbool.h>
-#include <stddef.h>
-
-enum type
-{
- TYPE_INT,
- TYPE_FLOAT,
- TYPE_CHAR,
- TYPE_STRING
-};
-
-union type_any
-{
- int int_v;
- float float_v;
- char char_v;
- const char *str_v;
-};
-
-struct variant
-{
- enum type type;
- union type_any value;
-};
-
-void variant_display(const struct variant *e);
-bool variant_equal(const struct variant *left, const struct variant *right);
-int variant_find(const struct variant *array, size_t len, enum type type,
- union type_any value);
-float variant_sum(const struct variant *array, size_t len);
-
-#endif /* !VARIANT_H */
diff --git a/rushs/tinyprintf/vector/Makefile b/rushs/tinyprintf/vector/Makefile
deleted file mode 100644
index 744241f..0000000
--- a/rushs/tinyprintf/vector/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-CC = gcc
-CFLAGS = -Wall -Werror -Wvla -Wextra -std=c99 -pedantic
-
-.PHONY: library clean
-
-library: vector.o
- ar csr libvector.a vector.o
-
-vector.o: vector.c
- $(CC) $(CFLAGS) -c -o vector.o vector.c
-
-clean:
- $(RM) libvector.a vector.o
diff --git a/rushs/tinyprintf/vector/vector.c b/rushs/tinyprintf/vector/vector.c
deleted file mode 100644
index cbd19aa..0000000
--- a/rushs/tinyprintf/vector/vector.c
+++ /dev/null
@@ -1,152 +0,0 @@
-#include "vector.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-struct vector *vector_init(size_t n)
-{
- struct vector *res = malloc(sizeof(struct vector));
- if (res == NULL)
- {
- return NULL;
- }
-
- res->size = 0;
- res->capacity = n;
- res->data = malloc(n * sizeof(int));
- if (res->data == NULL)
- {
- return NULL;
- }
- return res;
-}
-
-void vector_destroy(struct vector *v)
-{
- if (v)
- {
- free(v->data);
- free(v);
- }
-}
-
-struct vector *vector_resize(struct vector *v, size_t n)
-{
- if (!v)
- {
- return NULL;
- }
- if (n == v->capacity)
- {
- return v;
- }
- if (v)
- {
- int *tmp = realloc(v->data, n * sizeof(int));
- if (tmp == NULL)
- {
- return NULL;
- }
- v->data = tmp;
-
- if (n < v->size)
- {
- v->size = n;
- }
- v->capacity = n;
- return v;
- }
- return NULL;
-}
-
-struct vector *vector_append(struct vector *v, int elt)
-{
- if (v == NULL)
- {
- return NULL;
- }
-
- if (v->size == v->capacity)
- {
- if (vector_resize(v, v->capacity * 2) == NULL)
- {
- return NULL;
- }
- }
- v->data[v->size] = elt;
- v->size++;
- return v;
-}
-
-void vector_print(const struct vector *v)
-{
- if (v == NULL || v->size == 0)
- {
- printf("\n");
- return;
- }
- for (size_t i = 0; i < v->size - 1; i++)
- {
- printf("%d,", v->data[i]);
- }
- printf("%d\n", v->data[v->size - 1]);
-}
-
-struct vector *vector_reset(struct vector *v, size_t n)
-{
- if (vector_resize(v, n) == NULL)
- {
- return NULL;
- }
-
- v->size = 0;
- return v;
-}
-
-struct vector *vector_insert(struct vector *v, size_t i, int elt)
-{
- if (v == NULL || i > v->size)
- return NULL;
- if (i == v->size)
- {
- return vector_append(v, elt);
- }
- if (v->size == v->capacity)
- {
- if (vector_resize(v, v->capacity * 2) == NULL)
- {
- return NULL;
- }
- }
- for (size_t j = v->size; j > i; j--)
- {
- v->data[j] = v->data[j - 1];
- }
- v->size++;
-
- v->data[i] = elt;
- return v;
-}
-
-struct vector *vector_remove(struct vector *v, size_t i)
-{
- if (v == NULL || v->size == 0 || i >= v->size)
- {
- return NULL;
- }
- for (size_t j = i; j < v->size - 1; j++)
- {
- v->data[j] = v->data[j + 1];
- }
-
- v->size--;
-
- if (v->size < v->capacity / 2)
- {
- if (vector_resize(v, v->capacity / 2) == NULL)
- {
- return NULL;
- }
- }
- return v;
-}
diff --git a/rushs/tinyprintf/vector/vector.h b/rushs/tinyprintf/vector/vector.h
deleted file mode 100644
index 5afada7..0000000
--- a/rushs/tinyprintf/vector/vector.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef VECTOR_H
-#define VECTOR_H
-
-#include <stddef.h>
-
-struct vector
-{
- // The number of elements in the vector
- size_t size;
- // The maximum number of elements in the vector
- size_t capacity;
- // The elements themselves
- int *data;
-};
-
-/*
-** Initialize the vector with `n` capacity.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_init(size_t n);
-
-/*
-** Release the memory used by the vector.
-** Does nothing if `v` is `NULL`.
-*/
-void vector_destroy(struct vector *v);
-
-/*
-** Resize the vector to `n` capacity.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_resize(struct vector *v, size_t n);
-
-/*
-** Append an element to the end of the vector. Expand the vector if needed.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_append(struct vector *v, int elt);
-
-/*
-** Display the vector contents on `stdout`.
-** Displays `\n` if `v` is `NULL`.
-*/
-void vector_print(const struct vector *v);
-
-/*
-** Remove all the elements of the vector, and resize it to `n` capacity.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_reset(struct vector *v, size_t n);
-
-/*
-** Insert `n` at the index `i`. Expand the vector if needed.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_insert(struct vector *v, size_t i, int elt);
-
-/*
-** Remove the element at the index `i`.
-** Returns `NULL` if an error occured.
-*/
-struct vector *vector_remove(struct vector *v, size_t i);
-
-#endif /* !VECTOR_H */