redscript-mc 2.5.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/README.md +5 -75
- package/README.zh.md +165 -147
- package/ROADMAP.md +195 -0
- package/dist/data/linalg/function/_vec2d_len_sq_fx.mcfunction +17 -0
- package/dist/data/linalg/function/_vec3d_len_sq_fx.mcfunction +27 -0
- package/dist/data/linalg/function/load.mcfunction +1 -0
- package/dist/data/linalg/function/mat2d_det.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_mul_r0c0.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_mul_r0c1.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_mul_r1c0.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_mul_r1c1.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_vecmul_x.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_vecmul_y.mcfunction +16 -0
- package/dist/data/linalg/function/solve2d_x.mcfunction +27 -0
- package/dist/data/linalg/function/solve2d_y.mcfunction +27 -0
- package/dist/data/linalg/function/vec2d_dist.mcfunction +15 -0
- package/dist/data/linalg/function/vec2d_dot.mcfunction +16 -0
- package/dist/data/linalg/function/vec2d_length.mcfunction +21 -0
- package/dist/data/linalg/function/vec2d_normalize_x.mcfunction +8 -0
- package/dist/data/linalg/function/vec2d_normalize_x__merge_1.mcfunction +10 -0
- package/dist/data/linalg/function/vec2d_normalize_x__then_0.mcfunction +3 -0
- package/dist/data/linalg/function/vec2d_normalize_y.mcfunction +8 -0
- package/dist/data/linalg/function/vec2d_normalize_y__merge_1.mcfunction +10 -0
- package/dist/data/linalg/function/vec2d_normalize_y__then_0.mcfunction +3 -0
- package/dist/data/linalg/function/vec3d_cross_x.mcfunction +16 -0
- package/dist/data/linalg/function/vec3d_cross_y.mcfunction +16 -0
- package/dist/data/linalg/function/vec3d_cross_z.mcfunction +16 -0
- package/dist/data/linalg/function/vec3d_dist.mcfunction +21 -0
- package/dist/data/linalg/function/vec3d_dot.mcfunction +26 -0
- package/dist/data/linalg/function/vec3d_length.mcfunction +31 -0
- package/dist/data/linalg/function/vec3d_normalize_x.mcfunction +9 -0
- package/dist/data/linalg/function/vec3d_normalize_x__merge_1.mcfunction +11 -0
- package/dist/data/linalg/function/vec3d_normalize_x__then_0.mcfunction +3 -0
- package/dist/data/linalg/function/vec3d_normalize_y.mcfunction +9 -0
- package/dist/data/linalg/function/vec3d_normalize_y__merge_1.mcfunction +11 -0
- package/dist/data/linalg/function/vec3d_normalize_y__then_0.mcfunction +3 -0
- package/dist/data/linalg/function/vec3d_normalize_z.mcfunction +9 -0
- package/dist/data/linalg/function/vec3d_normalize_z__merge_1.mcfunction +11 -0
- package/dist/data/linalg/function/vec3d_normalize_z__then_0.mcfunction +3 -0
- package/dist/data/math_hp/function/cos_hp.mcfunction +8 -0
- package/dist/data/math_hp/function/div3_hp.mcfunction +23 -0
- package/dist/data/math_hp/function/div_hp.mcfunction +13 -0
- package/dist/data/math_hp/function/init_div.mcfunction +1 -0
- package/dist/data/math_hp/function/init_trig.mcfunction +1 -0
- package/dist/data/math_hp/function/ln_5term.mcfunction +6 -0
- package/dist/data/math_hp/function/ln_5term__loop_body_1.mcfunction +8 -0
- package/dist/data/math_hp/function/ln_5term__loop_body_4.mcfunction +8 -0
- package/dist/data/math_hp/function/ln_5term__loop_exit_2.mcfunction +1 -0
- package/dist/data/math_hp/function/ln_5term__loop_exit_5.mcfunction +61 -0
- package/dist/data/math_hp/function/ln_5term__loop_header_0.mcfunction +3 -0
- package/dist/data/math_hp/function/ln_5term__loop_header_3.mcfunction +6 -0
- package/dist/data/math_hp/function/load.mcfunction +1 -0
- package/dist/data/math_hp/function/norm3_hp.mcfunction +43 -0
- package/dist/data/math_hp/function/sin_hp.mcfunction +8 -0
- package/dist/data/math_hp/function/sqrt_hp.mcfunction +17 -0
- package/dist/data/math_hp/function/sqrt_hp__merge_1.mcfunction +21 -0
- package/dist/data/math_hp/function/sqrt_hp__then_0.mcfunction +2 -0
- package/dist/data/minecraft/tags/function/load.json +1 -2
- package/dist/data/minecraft/tags/function/tick.json +1 -1
- package/dist/data/readme_demo/function/_draw.mcfunction +1 -0
- package/dist/data/readme_demo/function/_init.mcfunction +1 -0
- package/dist/data/readme_demo/function/_math_init.mcfunction +4 -0
- package/dist/data/readme_demo/function/_wave_tick.mcfunction +1 -0
- package/dist/data/readme_demo/function/_wave_tick__foreach_t8.mcfunction +109 -0
- package/dist/data/readme_demo/function/acos_approx.mcfunction +7 -0
- package/dist/data/readme_demo/function/approx_eq.mcfunction +10 -0
- package/dist/data/readme_demo/function/approx_eq__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/approx_eq__merge_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/approx_eq__then_0.mcfunction +4 -0
- package/dist/data/readme_demo/function/approx_eq__then_2.mcfunction +2 -0
- package/dist/data/readme_demo/function/asin_approx.mcfunction +5 -0
- package/dist/data/readme_demo/function/asin_approx__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/asin_approx__merge_10.mcfunction +5 -0
- package/dist/data/readme_demo/function/asin_approx__merge_4.mcfunction +12 -0
- package/dist/data/readme_demo/function/asin_approx__merge_7.mcfunction +14 -0
- package/dist/data/readme_demo/function/asin_approx__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/asin_approx__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/asin_approx__then_6.mcfunction +2 -0
- package/dist/data/readme_demo/function/asin_approx__then_9.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx.mcfunction +5 -0
- package/dist/data/readme_demo/function/cbrt_fx__loop_body_6.mcfunction +7 -0
- package/dist/data/readme_demo/function/cbrt_fx__loop_exit_7.mcfunction +1 -0
- package/dist/data/readme_demo/function/cbrt_fx__loop_header_5.mcfunction +4 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_1.mcfunction +8 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_11.mcfunction +5 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_13.mcfunction +4 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_4.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_9.mcfunction +13 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_10.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_12.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_8.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_newton.mcfunction +5 -0
- package/dist/data/readme_demo/function/cbrt_newton__else_7.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_newton__merge_1.mcfunction +11 -0
- package/dist/data/readme_demo/function/cbrt_newton__merge_4.mcfunction +1 -0
- package/dist/data/readme_demo/function/cbrt_newton__merge_6.mcfunction +1 -0
- package/dist/data/readme_demo/function/cbrt_newton__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_newton__then_3.mcfunction +17 -0
- package/dist/data/readme_demo/function/cbrt_newton__then_5.mcfunction +11 -0
- package/dist/data/readme_demo/function/ceil_div.mcfunction +9 -0
- package/dist/data/readme_demo/function/combinations.mcfunction +6 -0
- package/dist/data/readme_demo/function/combinations__loop_body_9.mcfunction +15 -0
- package/dist/data/readme_demo/function/combinations__loop_exit_10.mcfunction +1 -0
- package/dist/data/readme_demo/function/combinations__loop_header_8.mcfunction +3 -0
- package/dist/data/readme_demo/function/combinations__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/combinations__merge_4.mcfunction +6 -0
- package/dist/data/readme_demo/function/combinations__merge_7.mcfunction +3 -0
- package/dist/data/readme_demo/function/combinations__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/combinations__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/combinations__then_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/cos_fixed.mcfunction +7 -0
- package/dist/data/readme_demo/function/cubic_disc_fx.mcfunction +26 -0
- package/dist/data/readme_demo/function/cubic_newton.mcfunction +8 -0
- package/dist/data/readme_demo/function/cubic_newton__loop_body_1.mcfunction +55 -0
- package/dist/data/readme_demo/function/cubic_newton__loop_exit_2.mcfunction +1 -0
- package/dist/data/readme_demo/function/cubic_newton__loop_header_0.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__merge_10.mcfunction +1 -0
- package/dist/data/readme_demo/function/cubic_newton__merge_4.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__merge_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__merge_8.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/cubic_newton__then_5.mcfunction +13 -0
- package/dist/data/readme_demo/function/cubic_newton__then_7.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__then_9.mcfunction +2 -0
- package/dist/data/readme_demo/function/divfix.mcfunction +6 -0
- package/dist/data/readme_demo/function/divfix__merge_1.mcfunction +6 -0
- package/dist/data/readme_demo/function/divfix__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/exp_fx.mcfunction +16 -0
- package/dist/data/readme_demo/function/exp_fx__loop_body_10.mcfunction +8 -0
- package/dist/data/readme_demo/function/exp_fx__loop_body_5.mcfunction +8 -0
- package/dist/data/readme_demo/function/exp_fx__loop_exit_11.mcfunction +1 -0
- package/dist/data/readme_demo/function/exp_fx__loop_exit_6.mcfunction +1 -0
- package/dist/data/readme_demo/function/exp_fx__loop_header_4.mcfunction +3 -0
- package/dist/data/readme_demo/function/exp_fx__loop_header_9.mcfunction +3 -0
- package/dist/data/readme_demo/function/exp_fx__merge_1.mcfunction +47 -0
- package/dist/data/readme_demo/function/exp_fx__merge_3.mcfunction +4 -0
- package/dist/data/readme_demo/function/exp_fx__merge_8.mcfunction +1 -0
- package/dist/data/readme_demo/function/exp_fx__then_0.mcfunction +7 -0
- package/dist/data/readme_demo/function/exp_fx__then_2.mcfunction +2 -0
- package/dist/data/readme_demo/function/exp_fx__then_7.mcfunction +5 -0
- package/dist/data/readme_demo/function/factorial.mcfunction +5 -0
- package/dist/data/readme_demo/function/factorial__loop_body_4.mcfunction +7 -0
- package/dist/data/readme_demo/function/factorial__loop_exit_5.mcfunction +1 -0
- package/dist/data/readme_demo/function/factorial__loop_header_3.mcfunction +3 -0
- package/dist/data/readme_demo/function/factorial__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/factorial__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/gamma_int.mcfunction +5 -0
- package/dist/data/readme_demo/function/gamma_int__merge_1.mcfunction +6 -0
- package/dist/data/readme_demo/function/gamma_int__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/gcd.mcfunction +7 -0
- package/dist/data/readme_demo/function/gcd__loop_body_5.mcfunction +5 -0
- package/dist/data/readme_demo/function/gcd__loop_exit_6.mcfunction +1 -0
- package/dist/data/readme_demo/function/gcd__loop_header_4.mcfunction +4 -0
- package/dist/data/readme_demo/function/gcd__merge_1.mcfunction +5 -0
- package/dist/data/readme_demo/function/gcd__merge_3.mcfunction +1 -0
- package/dist/data/readme_demo/function/gcd__then_0.mcfunction +4 -0
- package/dist/data/readme_demo/function/gcd__then_2.mcfunction +4 -0
- package/dist/data/readme_demo/function/isqrt.mcfunction +5 -0
- package/dist/data/readme_demo/function/isqrt__loop_body_10.mcfunction +8 -0
- package/dist/data/readme_demo/function/isqrt__loop_body_13.mcfunction +11 -0
- package/dist/data/readme_demo/function/isqrt__loop_body_7.mcfunction +8 -0
- package/dist/data/readme_demo/function/isqrt__loop_exit_11.mcfunction +2 -0
- package/dist/data/readme_demo/function/isqrt__loop_exit_14.mcfunction +1 -0
- package/dist/data/readme_demo/function/isqrt__loop_exit_8.mcfunction +9 -0
- package/dist/data/readme_demo/function/isqrt__loop_header_12.mcfunction +4 -0
- package/dist/data/readme_demo/function/isqrt__loop_header_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/isqrt__loop_header_9.mcfunction +3 -0
- package/dist/data/readme_demo/function/isqrt__merge_1.mcfunction +4 -0
- package/dist/data/readme_demo/function/isqrt__merge_16.mcfunction +5 -0
- package/dist/data/readme_demo/function/isqrt__merge_4.mcfunction +3 -0
- package/dist/data/readme_demo/function/isqrt__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/isqrt__then_15.mcfunction +1 -0
- package/dist/data/readme_demo/function/isqrt__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/lcm.mcfunction +11 -0
- package/dist/data/readme_demo/function/lcm__merge_1.mcfunction +5 -0
- package/dist/data/readme_demo/function/lcm__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/lerp.mcfunction +13 -0
- package/dist/data/readme_demo/function/ln.mcfunction +9 -0
- package/dist/data/readme_demo/function/ln__loop_body_1.mcfunction +8 -0
- package/dist/data/readme_demo/function/ln__loop_body_4.mcfunction +8 -0
- package/dist/data/readme_demo/function/ln__loop_exit_2.mcfunction +1 -0
- package/dist/data/readme_demo/function/ln__loop_exit_5.mcfunction +37 -0
- package/dist/data/readme_demo/function/ln__loop_header_0.mcfunction +3 -0
- package/dist/data/readme_demo/function/ln__loop_header_3.mcfunction +6 -0
- package/dist/data/readme_demo/function/load.mcfunction +1 -0
- package/dist/data/readme_demo/function/log10_fx.mcfunction +11 -0
- package/dist/data/readme_demo/function/log2_fx.mcfunction +11 -0
- package/dist/data/readme_demo/function/log2_int.mcfunction +5 -0
- package/dist/data/readme_demo/function/log2_int__loop_body_4.mcfunction +8 -0
- package/dist/data/readme_demo/function/log2_int__loop_exit_5.mcfunction +1 -0
- package/dist/data/readme_demo/function/log2_int__loop_header_3.mcfunction +4 -0
- package/dist/data/readme_demo/function/log2_int__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/log2_int__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/loga_fx.mcfunction +10 -0
- package/dist/data/readme_demo/function/loga_fx__merge_1.mcfunction +9 -0
- package/dist/data/readme_demo/function/loga_fx__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/map.mcfunction +12 -0
- package/dist/data/readme_demo/function/map__merge_1.mcfunction +11 -0
- package/dist/data/readme_demo/function/map__then_0.mcfunction +1 -0
- package/dist/data/readme_demo/function/mulfix.mcfunction +8 -0
- package/dist/data/readme_demo/function/newton_step.mcfunction +7 -0
- package/dist/data/readme_demo/function/newton_step__merge_1.mcfunction +8 -0
- package/dist/data/readme_demo/function/newton_step__then_0.mcfunction +1 -0
- package/dist/data/readme_demo/function/pow_int.mcfunction +6 -0
- package/dist/data/readme_demo/function/pow_int__loop_body_4.mcfunction +7 -0
- package/dist/data/readme_demo/function/pow_int__loop_exit_5.mcfunction +1 -0
- package/dist/data/readme_demo/function/pow_int__loop_header_3.mcfunction +4 -0
- package/dist/data/readme_demo/function/pow_int__merge_1.mcfunction +4 -0
- package/dist/data/readme_demo/function/pow_int__merge_7.mcfunction +8 -0
- package/dist/data/readme_demo/function/pow_int__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/pow_int__then_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/quadratic_disc.mcfunction +12 -0
- package/dist/data/readme_demo/function/quadratic_x1.mcfunction +7 -0
- package/dist/data/readme_demo/function/quadratic_x1__merge_1.mcfunction +13 -0
- package/dist/data/readme_demo/function/quadratic_x1__merge_4.mcfunction +15 -0
- package/dist/data/readme_demo/function/quadratic_x1__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/quadratic_x1__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/quadratic_x2.mcfunction +7 -0
- package/dist/data/readme_demo/function/quadratic_x2__merge_1.mcfunction +13 -0
- package/dist/data/readme_demo/function/quadratic_x2__merge_4.mcfunction +15 -0
- package/dist/data/readme_demo/function/quadratic_x2__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/quadratic_x2__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/sign.mcfunction +5 -0
- package/dist/data/readme_demo/function/sign__merge_1.mcfunction +4 -0
- package/dist/data/readme_demo/function/sign__merge_4.mcfunction +2 -0
- package/dist/data/readme_demo/function/sign__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/sign__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/simpson_step.mcfunction +16 -0
- package/dist/data/readme_demo/function/sin_fixed.mcfunction +9 -0
- package/dist/data/readme_demo/function/sin_fixed__merge_1.mcfunction +4 -0
- package/dist/data/readme_demo/function/sin_fixed__merge_3.mcfunction +4 -0
- package/dist/data/readme_demo/function/sin_fixed__merge_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/sin_fixed__merge_9.mcfunction +10 -0
- package/dist/data/readme_demo/function/sin_fixed__then_0.mcfunction +4 -0
- package/dist/data/readme_demo/function/sin_fixed__then_2.mcfunction +6 -0
- package/dist/data/readme_demo/function/sin_fixed__then_5.mcfunction +8 -0
- package/dist/data/readme_demo/function/sin_fixed__then_8.mcfunction +10 -0
- package/dist/data/readme_demo/function/smootherstep.mcfunction +10 -0
- package/dist/data/readme_demo/function/smootherstep__merge_1.mcfunction +12 -0
- package/dist/data/readme_demo/function/smootherstep__merge_4.mcfunction +4 -0
- package/dist/data/readme_demo/function/smootherstep__merge_6.mcfunction +27 -0
- package/dist/data/readme_demo/function/smootherstep__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/smootherstep__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/smootherstep__then_5.mcfunction +2 -0
- package/dist/data/readme_demo/function/smoothstep.mcfunction +10 -0
- package/dist/data/readme_demo/function/smoothstep__merge_1.mcfunction +12 -0
- package/dist/data/readme_demo/function/smoothstep__merge_4.mcfunction +4 -0
- package/dist/data/readme_demo/function/smoothstep__merge_6.mcfunction +15 -0
- package/dist/data/readme_demo/function/smoothstep__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/smoothstep__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/smoothstep__then_5.mcfunction +2 -0
- package/dist/data/readme_demo/function/solve2x2_x.mcfunction +17 -0
- package/dist/data/readme_demo/function/solve2x2_x__merge_1.mcfunction +12 -0
- package/dist/data/readme_demo/function/solve2x2_x__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/solve2x2_y.mcfunction +17 -0
- package/dist/data/readme_demo/function/solve2x2_y__merge_1.mcfunction +12 -0
- package/dist/data/readme_demo/function/solve2x2_y__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/sqrt_fixed.mcfunction +8 -0
- package/dist/data/readme_demo/function/sqrt_fx.mcfunction +8 -0
- package/dist/data/readme_demo/function/start.mcfunction +2 -0
- package/dist/data/readme_demo/function/stop.mcfunction +1 -0
- package/dist/data/readme_demo/function/trapezoid_step.mcfunction +11 -0
- package/dist/data/stdextra/function/__load.mcfunction +2 -0
- package/dist/data/stdextra/function/load.mcfunction +1 -0
- package/dist/data/stdextra/function/test_bigint.mcfunction +52 -0
- package/dist/data/stdextra/function/test_bits.mcfunction +33 -0
- package/dist/data/stdextra/function/test_list_sort.mcfunction +55 -0
- package/dist/data/stdextra/function/test_random.mcfunction +17 -0
- package/dist/data/stdextra/function/test_random__merge_1.mcfunction +4 -0
- package/dist/data/stdextra/function/test_random__merge_11.mcfunction +1 -0
- package/dist/data/stdextra/function/test_random__merge_3.mcfunction +14 -0
- package/dist/data/stdextra/function/test_random__merge_5.mcfunction +8 -0
- package/dist/data/stdextra/function/test_random__merge_7.mcfunction +1 -0
- package/dist/data/stdextra/function/test_random__merge_9.mcfunction +1 -0
- package/dist/data/stdextra/function/test_random__then_0.mcfunction +4 -0
- package/dist/data/stdextra/function/test_random__then_10.mcfunction +2 -0
- package/dist/data/stdextra/function/test_random__then_2.mcfunction +2 -0
- package/dist/data/stdextra/function/test_random__then_4.mcfunction +4 -0
- package/dist/data/stdextra/function/test_random__then_6.mcfunction +2 -0
- package/dist/data/stdextra/function/test_random__then_8.mcfunction +4 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_nums.mcfunction +1 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_parent.mcfunction +1 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_queue.mcfunction +1 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_rev.mcfunction +1 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_visited.mcfunction +1 -0
- package/dist/data/test/function/__dyn_wrt_test_arrays_parent.mcfunction +1 -0
- package/dist/data/test/function/__dyn_wrt_test_arrays_visited.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_body_1.mcfunction +17 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_body_1_continue.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_body_1_yield.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_header_0_exit.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__else_8.mcfunction +19 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__loop_body_4.mcfunction +9 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__loop_header_3.mcfunction +3 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__loop_header_3_exit.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_10.mcfunction +11 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_12.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_14.mcfunction +11 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_16.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_18.mcfunction +11 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_20.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_22.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_24.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_7.mcfunction +6 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_7_continue.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_7_yield.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_11.mcfunction +15 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_13.mcfunction +13 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_15.mcfunction +15 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_17.mcfunction +13 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_19.mcfunction +15 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_21.mcfunction +13 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_23.mcfunction +15 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_6.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_9.mcfunction +13 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__else_32.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__loop_body_28.mcfunction +6 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__loop_header_27.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__loop_header_27_exit.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__merge_31.mcfunction +6 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__merge_31_continue.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__merge_31_yield.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__then_30.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_body_34.mcfunction +16 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_body_34_continue.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_body_34_yield.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_header_33.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_header_33_exit.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_5.mcfunction +16 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_5__merge_26.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_1.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_2.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_3.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_4.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_5.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_2.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_3.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_4.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_5.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__done.mcfunction +1 -0
- package/dist/data/test/function/_hsl_chroma_x.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_1.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_10.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_13.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_4.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_7.mcfunction +1 -2
- package/dist/data/test/function/acos_approx.mcfunction +7 -0
- package/dist/data/test/function/add_to_team.mcfunction +5 -0
- package/dist/data/test/function/angle_diff.mcfunction +1 -2
- package/dist/data/test/function/angle_normalize__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/angle_normalize__loop_header_3.mcfunction +1 -2
- package/dist/data/test/function/angry_at.mcfunction +1 -0
- package/dist/data/test/function/apply_damage.mcfunction +12 -0
- package/dist/data/test/function/apply_damage__else_2.mcfunction +2 -0
- package/dist/data/test/function/apply_damage__merge_1.mcfunction +1 -0
- package/dist/data/test/function/apply_damage__then_0.mcfunction +2 -0
- package/dist/data/test/function/arr_test.mcfunction +4 -0
- package/dist/data/test/function/asin_approx.mcfunction +5 -0
- package/dist/data/test/function/asin_approx__merge_1.mcfunction +3 -0
- package/dist/data/test/function/asin_approx__merge_10.mcfunction +5 -0
- package/dist/data/test/function/asin_approx__merge_4.mcfunction +12 -0
- package/dist/data/test/function/asin_approx__merge_7.mcfunction +14 -0
- package/dist/data/test/function/asin_approx__then_0.mcfunction +2 -0
- package/dist/data/test/function/asin_approx__then_3.mcfunction +2 -0
- package/dist/data/test/function/asin_approx__then_6.mcfunction +2 -0
- package/dist/data/test/function/asin_approx__then_9.mcfunction +2 -0
- package/dist/data/test/function/barrier_wall.mcfunction +1 -0
- package/dist/data/test/function/bernoulli.mcfunction +1 -2
- package/dist/data/test/function/bernoulli__merge_1.mcfunction +1 -2
- package/dist/data/test/function/bigint_chunk.mcfunction +2 -0
- package/dist/data/test/function/bigint_div_small.mcfunction +6 -0
- package/dist/data/test/function/bigint_div_small__loop_body_1.mcfunction +12 -0
- package/dist/data/test/function/bigint_div_small__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/bigint_div_small__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/bigint_mod_small.mcfunction +6 -0
- package/dist/data/test/function/bigint_mod_small__loop_body_1.mcfunction +12 -0
- package/dist/data/test/function/bigint_mod_small__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/bigint_mod_small__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/bit_and__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/bit_and__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_and__then_3.mcfunction +1 -2
- package/dist/data/test/function/bit_clear__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/bit_clear__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_get__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_not__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/bit_not__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_or__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/bit_or__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_or__merge_4.mcfunction +1 -2
- package/dist/data/test/function/bit_or__then_5.mcfunction +1 -2
- package/dist/data/test/function/bit_set__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/bit_set__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_shl__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_shr__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_toggle__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/bit_toggle__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_xor__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/bit_xor__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/buff_all.mcfunction +22 -0
- package/dist/data/test/function/cbrt_newton.mcfunction +5 -0
- package/dist/data/test/function/cbrt_newton__else_7.mcfunction +2 -0
- package/dist/data/test/function/cbrt_newton__merge_1.mcfunction +11 -0
- package/dist/data/test/function/cbrt_newton__merge_4.mcfunction +1 -0
- package/dist/data/test/function/cbrt_newton__merge_6.mcfunction +1 -0
- package/dist/data/test/function/cbrt_newton__then_0.mcfunction +2 -0
- package/dist/data/test/function/cbrt_newton__then_3.mcfunction +17 -0
- package/dist/data/test/function/cbrt_newton__then_5.mcfunction +11 -0
- package/dist/data/test/function/check_holding_item.mcfunction +1 -0
- package/dist/data/test/function/check_look_down.mcfunction +1 -0
- package/dist/data/test/function/check_look_down__foreach_t0.mcfunction +2 -0
- package/dist/data/test/function/check_look_straight.mcfunction +1 -0
- package/dist/data/test/function/check_look_straight__foreach_t0.mcfunction +2 -0
- package/dist/data/test/function/check_look_up.mcfunction +1 -0
- package/dist/data/test/function/check_look_up__foreach_t0.mcfunction +2 -0
- package/dist/data/test/function/cleanup_teams.mcfunction +8 -0
- package/dist/data/test/function/clear_area.mcfunction +1 -0
- package/dist/data/test/function/clear_effect.mcfunction +1 -0
- package/dist/data/test/function/clear_effects.mcfunction +1 -0
- package/dist/data/test/function/clear_inventory.mcfunction +1 -0
- package/dist/data/test/function/cooldown_ready.mcfunction +7 -0
- package/dist/data/test/function/cooldown_ready__merge_1.mcfunction +4 -0
- package/dist/data/test/function/cooldown_ready__merge_4.mcfunction +2 -0
- package/dist/data/test/function/cooldown_ready__then_0.mcfunction +2 -0
- package/dist/data/test/function/cooldown_ready__then_3.mcfunction +2 -0
- package/dist/data/test/function/cooldown_start.mcfunction +3 -0
- package/dist/data/test/function/cooldown_tick.mcfunction +7 -0
- package/dist/data/test/function/cooldown_tick__else_5.mcfunction +2 -0
- package/dist/data/test/function/cooldown_tick__merge_1.mcfunction +4 -0
- package/dist/data/test/function/cooldown_tick__merge_4.mcfunction +1 -0
- package/dist/data/test/function/cooldown_tick__merge_7.mcfunction +1 -0
- package/dist/data/test/function/cooldown_tick__then_0.mcfunction +1 -0
- package/dist/data/test/function/cooldown_tick__then_3.mcfunction +7 -0
- package/dist/data/test/function/cooldown_tick__then_6.mcfunction +2 -0
- package/dist/data/test/function/cos_hp.mcfunction +4 -2
- package/dist/data/test/function/create_blue_team.mcfunction +10 -0
- package/dist/data/test/function/create_green_team.mcfunction +10 -0
- package/dist/data/test/function/create_health_bar.mcfunction +24 -0
- package/dist/data/test/function/create_progress_bar.mcfunction +24 -0
- package/dist/data/test/function/create_red_team.mcfunction +10 -0
- package/dist/data/test/function/create_team.mcfunction +8 -0
- package/dist/data/test/function/create_timer_bar.mcfunction +30 -0
- package/dist/data/test/function/create_yellow_team.mcfunction +10 -0
- package/dist/data/test/function/cubic_disc_fx.mcfunction +26 -0
- package/dist/data/test/function/cubic_newton.mcfunction +8 -0
- package/dist/data/test/function/cubic_newton__loop_body_1.mcfunction +55 -0
- package/dist/data/test/function/cubic_newton__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/cubic_newton__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__merge_10.mcfunction +1 -0
- package/dist/data/test/function/cubic_newton__merge_4.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__merge_6.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__merge_8.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__then_3.mcfunction +2 -0
- package/dist/data/test/function/cubic_newton__then_5.mcfunction +13 -0
- package/dist/data/test/function/cubic_newton__then_7.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__then_9.mcfunction +2 -0
- package/dist/data/test/function/curve_length_2d.mcfunction +6 -0
- package/dist/data/test/function/curve_length_2d__loop_body_1.mcfunction +32 -0
- package/dist/data/test/function/curve_length_2d__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/curve_length_2d__loop_header_0.mcfunction +5 -0
- package/dist/data/test/function/cylinder_contains.mcfunction +1 -2
- package/dist/data/test/function/damage.mcfunction +9 -0
- package/dist/data/test/function/damage__else_2.mcfunction +2 -0
- package/dist/data/test/function/damage__merge_1.mcfunction +1 -0
- package/dist/data/test/function/damage__then_0.mcfunction +2 -0
- package/dist/data/test/function/deriv_central.mcfunction +7 -0
- package/dist/data/test/function/deriv_central__merge_1.mcfunction +10 -0
- package/dist/data/test/function/deriv_central__then_0.mcfunction +2 -0
- package/dist/data/test/function/deriv_forward.mcfunction +7 -0
- package/dist/data/test/function/deriv_forward__merge_1.mcfunction +8 -0
- package/dist/data/test/function/deriv_forward__then_0.mcfunction +2 -0
- package/dist/data/test/function/disable_fire_spread.mcfunction +1 -0
- package/dist/data/test/function/disable_keep_inventory.mcfunction +1 -0
- package/dist/data/test/function/disable_mob_griefing.mcfunction +1 -0
- package/dist/data/test/function/div3_hp.mcfunction +23 -0
- package/dist/data/test/function/div_hp.mcfunction +13 -0
- package/dist/data/test/function/draw_circle.mcfunction +8 -0
- package/dist/data/test/function/draw_circle__loop_body_1.mcfunction +34 -0
- package/dist/data/test/function/draw_circle__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/draw_circle__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/draw_helix.mcfunction +10 -0
- package/dist/data/test/function/draw_helix__loop_body_1.mcfunction +42 -0
- package/dist/data/test/function/draw_helix__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/draw_helix__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/draw_line_2d.mcfunction +9 -0
- package/dist/data/test/function/draw_line_2d__loop_body_1.mcfunction +34 -0
- package/dist/data/test/function/draw_line_2d__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/draw_line_2d__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/ease_in_expo.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_back.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_bounce.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_cubic.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_quad.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_sine.mcfunction +1 -2
- package/dist/data/test/function/ease_out_bounce.mcfunction +1 -2
- package/dist/data/test/function/ease_out_bounce__merge_1.mcfunction +1 -2
- package/dist/data/test/function/ease_out_bounce__merge_4.mcfunction +1 -2
- package/dist/data/test/function/ease_out_expo.mcfunction +1 -2
- package/dist/data/test/function/enable_keep_inventory.mcfunction +1 -0
- package/dist/data/test/function/end_sparkles_at.mcfunction +1 -0
- package/dist/data/test/function/enemy_health.mcfunction +2 -0
- package/dist/data/test/function/example_right_click.mcfunction +1 -0
- package/dist/data/test/function/example_right_click__foreach_t0.mcfunction +5 -0
- package/dist/data/test/function/example_right_click__foreach_t0__merge_1.mcfunction +1 -0
- package/dist/data/test/function/example_right_click__foreach_t0__then_0.mcfunction +3 -0
- package/dist/data/test/function/exp_dist_approx.mcfunction +1 -2
- package/dist/data/test/function/exp_dist_approx__merge_1.mcfunction +1 -2
- package/dist/data/test/function/exp_dist_approx__merge_3.mcfunction +1 -2
- package/dist/data/test/function/explosion_effect.mcfunction +1 -0
- package/dist/data/test/function/fbm_1d__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/fbm_1d__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/fbm_2d__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/fbm_2d__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/flames.mcfunction +1 -0
- package/dist/data/test/function/gather_all.mcfunction +8 -0
- package/dist/data/test/function/give_kit_archer.mcfunction +6 -0
- package/dist/data/test/function/give_kit_mage.mcfunction +5 -0
- package/dist/data/test/function/give_kit_warrior.mcfunction +6 -0
- package/dist/data/test/function/glass_box.mcfunction +2 -0
- package/dist/data/test/function/glow.mcfunction +1 -0
- package/dist/data/test/function/goto_arena.mcfunction +7 -0
- package/dist/data/test/function/goto_lobby.mcfunction +7 -0
- package/dist/data/test/function/happy_at.mcfunction +1 -0
- package/dist/data/test/function/hash_1d_pos.mcfunction +1 -2
- package/dist/data/test/function/hash_2d_pos.mcfunction +1 -2
- package/dist/data/test/function/heal.mcfunction +5 -0
- package/dist/data/test/function/heap_new.mcfunction +7 -0
- package/dist/data/test/function/heap_new__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/heap_new__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/heap_new__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/heap_peek.mcfunction +2 -0
- package/dist/data/test/function/heap_pop.mcfunction +4 -0
- package/dist/data/test/function/heap_pop__else_13.mcfunction +2 -0
- package/dist/data/test/function/heap_pop__loop_body_1.mcfunction +14 -0
- package/dist/data/test/function/heap_pop__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/heap_pop__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/heap_pop__merge_10.mcfunction +1 -0
- package/dist/data/test/function/heap_pop__merge_12.mcfunction +1 -0
- package/dist/data/test/function/heap_pop__merge_4.mcfunction +3 -0
- package/dist/data/test/function/heap_pop__merge_6.mcfunction +1 -0
- package/dist/data/test/function/heap_pop__merge_8.mcfunction +3 -0
- package/dist/data/test/function/heap_pop__then_11.mcfunction +2 -0
- package/dist/data/test/function/heap_pop__then_3.mcfunction +3 -0
- package/dist/data/test/function/heap_pop__then_5.mcfunction +2 -0
- package/dist/data/test/function/heap_pop__then_7.mcfunction +3 -0
- package/dist/data/test/function/heap_pop__then_9.mcfunction +2 -0
- package/dist/data/test/function/heap_push.mcfunction +6 -0
- package/dist/data/test/function/heap_push__else_5.mcfunction +2 -0
- package/dist/data/test/function/heap_push__else_8.mcfunction +2 -0
- package/dist/data/test/function/heap_push__loop_body_1.mcfunction +4 -0
- package/dist/data/test/function/heap_push__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/heap_push__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/heap_push__merge_4.mcfunction +1 -0
- package/dist/data/test/function/heap_push__merge_7.mcfunction +1 -0
- package/dist/data/test/function/heap_push__then_3.mcfunction +7 -0
- package/dist/data/test/function/heap_push__then_6.mcfunction +2 -0
- package/dist/data/test/function/heap_size.mcfunction +2 -0
- package/dist/data/test/function/hearts_at.mcfunction +1 -0
- package/dist/data/test/function/hide_bar.mcfunction +4 -0
- package/dist/data/test/function/hsl_to_b.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_1.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_12.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_3.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_6.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_9.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_1.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_12.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_3.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_6.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_9.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_1.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_12.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_3.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_6.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_9.mcfunction +1 -2
- package/dist/data/test/function/init_div.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort__else_11.mcfunction +2 -0
- package/dist/data/test/function/insertion_sort__else_8.mcfunction +2 -0
- package/dist/data/test/function/insertion_sort__loop_body_1.mcfunction +6 -0
- package/dist/data/test/function/insertion_sort__loop_body_4.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort__loop_exit_5.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/insertion_sort__loop_header_3.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort__merge_10.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort__merge_7.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort__then_6.mcfunction +3 -0
- package/dist/data/test/function/insertion_sort__then_9.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc__else_11.mcfunction +2 -0
- package/dist/data/test/function/insertion_sort_desc__else_8.mcfunction +2 -0
- package/dist/data/test/function/insertion_sort_desc__loop_body_1.mcfunction +6 -0
- package/dist/data/test/function/insertion_sort_desc__loop_body_4.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort_desc__loop_exit_5.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/insertion_sort_desc__loop_header_3.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc__merge_10.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort_desc__merge_7.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort_desc__then_6.mcfunction +3 -0
- package/dist/data/test/function/insertion_sort_desc__then_9.mcfunction +4 -0
- package/dist/data/test/function/integrate_simpson.mcfunction +7 -0
- package/dist/data/test/function/integrate_simpson__loop_body_6.mcfunction +7 -0
- package/dist/data/test/function/integrate_simpson__loop_exit_7.mcfunction +6 -0
- package/dist/data/test/function/integrate_simpson__loop_header_5.mcfunction +5 -0
- package/dist/data/test/function/integrate_simpson__merge_1.mcfunction +8 -0
- package/dist/data/test/function/integrate_simpson__merge_11.mcfunction +4 -0
- package/dist/data/test/function/integrate_simpson__merge_4.mcfunction +5 -0
- package/dist/data/test/function/integrate_simpson__merge_9.mcfunction +7 -0
- package/dist/data/test/function/integrate_simpson__then_0.mcfunction +6 -0
- package/dist/data/test/function/integrate_simpson__then_10.mcfunction +6 -0
- package/dist/data/test/function/integrate_simpson__then_3.mcfunction +4 -0
- package/dist/data/test/function/integrate_simpson__then_8.mcfunction +6 -0
- package/dist/data/test/function/integrate_trapezoid.mcfunction +7 -0
- package/dist/data/test/function/integrate_trapezoid__loop_body_4.mcfunction +7 -0
- package/dist/data/test/function/integrate_trapezoid__loop_exit_5.mcfunction +6 -0
- package/dist/data/test/function/integrate_trapezoid__loop_header_3.mcfunction +5 -0
- package/dist/data/test/function/integrate_trapezoid__merge_1.mcfunction +11 -0
- package/dist/data/test/function/integrate_trapezoid__then_0.mcfunction +2 -0
- package/dist/data/test/function/interactions_init.mcfunction +9 -0
- package/dist/data/test/function/invisible.mcfunction +1 -0
- package/dist/data/test/function/is_op.mcfunction +2 -0
- package/dist/data/test/function/is_op__exec_t1.mcfunction +1 -0
- package/dist/data/test/function/is_sneaking.mcfunction +5 -0
- package/dist/data/test/function/is_sneaking__merge_1.mcfunction +2 -0
- package/dist/data/test/function/is_sneaking__then_0.mcfunction +2 -0
- package/dist/data/test/function/jump.mcfunction +1 -0
- package/dist/data/test/function/launch_up.mcfunction +6 -0
- package/dist/data/test/function/list_max3.mcfunction +1 -2
- package/dist/data/test/function/list_max3__merge_1.mcfunction +1 -2
- package/dist/data/test/function/list_max5.mcfunction +1 -2
- package/dist/data/test/function/list_max5__merge_1.mcfunction +1 -2
- package/dist/data/test/function/list_max5__merge_3.mcfunction +1 -2
- package/dist/data/test/function/list_max5__merge_5.mcfunction +1 -2
- package/dist/data/test/function/list_min3.mcfunction +1 -2
- package/dist/data/test/function/list_min3__merge_1.mcfunction +1 -2
- package/dist/data/test/function/list_min5.mcfunction +1 -2
- package/dist/data/test/function/list_min5__merge_1.mcfunction +1 -2
- package/dist/data/test/function/list_min5__merge_3.mcfunction +1 -2
- package/dist/data/test/function/list_min5__merge_5.mcfunction +1 -2
- package/dist/data/test/function/list_sort_asc__loop_body_4.mcfunction +1 -2
- package/dist/data/test/function/list_sort_asc__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/list_sort_asc__loop_header_3.mcfunction +1 -2
- package/dist/data/test/function/list_sort_desc__loop_body_4.mcfunction +1 -2
- package/dist/data/test/function/list_sort_desc__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/list_sort_desc__loop_header_3.mcfunction +1 -2
- package/dist/data/test/function/max_heap_pop.mcfunction +4 -0
- package/dist/data/test/function/max_heap_pop__else_13.mcfunction +2 -0
- package/dist/data/test/function/max_heap_pop__loop_body_1.mcfunction +14 -0
- package/dist/data/test/function/max_heap_pop__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/max_heap_pop__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/max_heap_pop__merge_10.mcfunction +1 -0
- package/dist/data/test/function/max_heap_pop__merge_12.mcfunction +1 -0
- package/dist/data/test/function/max_heap_pop__merge_4.mcfunction +3 -0
- package/dist/data/test/function/max_heap_pop__merge_6.mcfunction +1 -0
- package/dist/data/test/function/max_heap_pop__merge_8.mcfunction +3 -0
- package/dist/data/test/function/max_heap_pop__then_11.mcfunction +2 -0
- package/dist/data/test/function/max_heap_pop__then_3.mcfunction +3 -0
- package/dist/data/test/function/max_heap_pop__then_5.mcfunction +2 -0
- package/dist/data/test/function/max_heap_pop__then_7.mcfunction +3 -0
- package/dist/data/test/function/max_heap_pop__then_9.mcfunction +2 -0
- package/dist/data/test/function/max_heap_push.mcfunction +6 -0
- package/dist/data/test/function/max_heap_push__else_5.mcfunction +2 -0
- package/dist/data/test/function/max_heap_push__else_8.mcfunction +2 -0
- package/dist/data/test/function/max_heap_push__loop_body_1.mcfunction +4 -0
- package/dist/data/test/function/max_heap_push__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/max_heap_push__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/max_heap_push__merge_4.mcfunction +1 -0
- package/dist/data/test/function/max_heap_push__merge_7.mcfunction +1 -0
- package/dist/data/test/function/max_heap_push__then_3.mcfunction +7 -0
- package/dist/data/test/function/max_heap_push__then_6.mcfunction +2 -0
- package/dist/data/test/function/newton_step.mcfunction +7 -0
- package/dist/data/test/function/newton_step__merge_1.mcfunction +8 -0
- package/dist/data/test/function/newton_step__then_0.mcfunction +1 -0
- package/dist/data/test/function/night_vision.mcfunction +1 -0
- package/dist/data/test/function/norm3_hp.mcfunction +43 -0
- package/dist/data/test/function/normal_approx12.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_1.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_11.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_13.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_15.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_17.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_19.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_21.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_3.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_5.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_7.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_9.mcfunction +1 -2
- package/dist/data/test/function/on_double_sneak.mcfunction +1 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0.mcfunction +9 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0__merge_1.mcfunction +1 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0__merge_3.mcfunction +2 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0__then_0.mcfunction +6 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0__then_2.mcfunction +2 -0
- package/dist/data/test/function/on_right_click.mcfunction +1 -0
- package/dist/data/test/function/on_right_click__foreach_t1.mcfunction +5 -0
- package/dist/data/test/function/on_right_click__foreach_t1__merge_1.mcfunction +1 -0
- package/dist/data/test/function/on_right_click__foreach_t1__then_0.mcfunction +3 -0
- package/dist/data/test/function/on_sneak_click.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0.mcfunction +7 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__else_4.mcfunction +3 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__merge_1.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__merge_3.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__then_0.mcfunction +4 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__then_2.mcfunction +3 -0
- package/dist/data/test/function/on_sneak_start.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_start__foreach_t0.mcfunction +5 -0
- package/dist/data/test/function/on_sneak_start__foreach_t0__else_2.mcfunction +2 -0
- package/dist/data/test/function/on_sneak_start__foreach_t0__merge_1.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_start__foreach_t0__then_0.mcfunction +2 -0
- package/dist/data/test/function/particle_at_fx.mcfunction +1 -0
- package/dist/data/test/function/particle_dot.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs.mcfunction +11 -0
- package/dist/data/test/function/pathfind_bfs__else_33.mcfunction +4 -0
- package/dist/data/test/function/pathfind_bfs__else_8.mcfunction +19 -0
- package/dist/data/test/function/pathfind_bfs__loop_body_1.mcfunction +10 -0
- package/dist/data/test/function/pathfind_bfs__loop_body_29.mcfunction +6 -0
- package/dist/data/test/function/pathfind_bfs__loop_body_35.mcfunction +9 -0
- package/dist/data/test/function/pathfind_bfs__loop_body_4.mcfunction +9 -0
- package/dist/data/test/function/pathfind_bfs__loop_exit_2.mcfunction +24 -0
- package/dist/data/test/function/pathfind_bfs__loop_exit_30.mcfunction +6 -0
- package/dist/data/test/function/pathfind_bfs__loop_exit_36.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__loop_exit_5.mcfunction +6 -0
- package/dist/data/test/function/pathfind_bfs__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/pathfind_bfs__loop_header_28.mcfunction +4 -0
- package/dist/data/test/function/pathfind_bfs__loop_header_3.mcfunction +3 -0
- package/dist/data/test/function/pathfind_bfs__loop_header_34.mcfunction +4 -0
- package/dist/data/test/function/pathfind_bfs__merge_10.mcfunction +11 -0
- package/dist/data/test/function/pathfind_bfs__merge_12.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_14.mcfunction +11 -0
- package/dist/data/test/function/pathfind_bfs__merge_16.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_18.mcfunction +11 -0
- package/dist/data/test/function/pathfind_bfs__merge_20.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_22.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_24.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_26.mcfunction +5 -0
- package/dist/data/test/function/pathfind_bfs__merge_32.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_7.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__then_11.mcfunction +15 -0
- package/dist/data/test/function/pathfind_bfs__then_13.mcfunction +13 -0
- package/dist/data/test/function/pathfind_bfs__then_15.mcfunction +15 -0
- package/dist/data/test/function/pathfind_bfs__then_17.mcfunction +13 -0
- package/dist/data/test/function/pathfind_bfs__then_19.mcfunction +15 -0
- package/dist/data/test/function/pathfind_bfs__then_21.mcfunction +13 -0
- package/dist/data/test/function/pathfind_bfs__then_23.mcfunction +15 -0
- package/dist/data/test/function/pathfind_bfs__then_25.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__then_31.mcfunction +2 -0
- package/dist/data/test/function/pathfind_bfs__then_6.mcfunction +3 -0
- package/dist/data/test/function/pathfind_bfs__then_9.mcfunction +13 -0
- package/dist/data/test/function/pathfind_bfs_coro.mcfunction +1 -0
- package/dist/data/test/function/pcg_output.mcfunction +1 -2
- package/dist/data/test/function/pf_heuristic.mcfunction +14 -0
- package/dist/data/test/function/pf_heuristic__merge_1.mcfunction +4 -0
- package/dist/data/test/function/pf_heuristic__merge_3.mcfunction +6 -0
- package/dist/data/test/function/pf_heuristic__then_0.mcfunction +4 -0
- package/dist/data/test/function/pf_heuristic__then_2.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked.mcfunction +7 -0
- package/dist/data/test/function/pf_is_blocked__merge_1.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked__merge_10.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked__merge_4.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked__merge_7.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked__then_0.mcfunction +2 -0
- package/dist/data/test/function/pf_is_blocked__then_3.mcfunction +2 -0
- package/dist/data/test/function/pf_is_blocked__then_6.mcfunction +2 -0
- package/dist/data/test/function/pf_is_blocked__then_9.mcfunction +2 -0
- package/dist/data/test/function/pf_new_map.mcfunction +4 -0
- package/dist/data/test/function/pf_new_map__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/pf_new_map__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/pf_new_map__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/pf_noop.mcfunction +1 -0
- package/dist/data/test/function/pf_pack.mcfunction +8 -0
- package/dist/data/test/function/pf_set_blocked.mcfunction +5 -0
- package/dist/data/test/function/pf_set_open.mcfunction +5 -0
- package/dist/data/test/function/pf_unpack_x.mcfunction +5 -0
- package/dist/data/test/function/pf_unpack_z.mcfunction +5 -0
- package/dist/data/test/function/popcount__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/popcount__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/portal_effect.mcfunction +1 -0
- package/dist/data/test/function/random_bool.mcfunction +1 -2
- package/dist/data/test/function/random_range.mcfunction +1 -2
- package/dist/data/test/function/regen.mcfunction +1 -0
- package/dist/data/test/function/remove_bar.mcfunction +3 -0
- package/dist/data/test/function/remove_from_teams.mcfunction +3 -0
- package/dist/data/test/function/remove_item.mcfunction +1 -0
- package/dist/data/test/function/resistance.mcfunction +1 -0
- package/dist/data/test/function/rgb_to_h.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_1.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_12.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_3.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_5.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_7.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_9.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__then_11.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_l.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_l__merge_1.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_l__merge_3.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_l__merge_5.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_1.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_3.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_5.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_7.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_9.mcfunction +1 -2
- package/dist/data/test/function/riemann_left.mcfunction +6 -0
- package/dist/data/test/function/riemann_left__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/riemann_left__loop_exit_2.mcfunction +6 -0
- package/dist/data/test/function/riemann_left__loop_header_0.mcfunction +5 -0
- package/dist/data/test/function/riemann_mid.mcfunction +6 -0
- package/dist/data/test/function/riemann_mid__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/riemann_mid__loop_exit_2.mcfunction +6 -0
- package/dist/data/test/function/riemann_mid__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/riemann_right.mcfunction +6 -0
- package/dist/data/test/function/riemann_right__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/riemann_right__loop_exit_2.mcfunction +6 -0
- package/dist/data/test/function/riemann_right__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/running_m2.mcfunction +16 -0
- package/dist/data/test/function/running_mean.mcfunction +7 -0
- package/dist/data/test/function/running_mean__merge_1.mcfunction +13 -0
- package/dist/data/test/function/running_mean__then_0.mcfunction +1 -0
- package/dist/data/test/function/second_deriv.mcfunction +8 -0
- package/dist/data/test/function/second_deriv__merge_1.mcfunction +14 -0
- package/dist/data/test/function/second_deriv__then_0.mcfunction +2 -0
- package/dist/data/test/function/set_day.mcfunction +1 -0
- package/dist/data/test/function/set_easy.mcfunction +1 -0
- package/dist/data/test/function/set_hard.mcfunction +1 -0
- package/dist/data/test/function/set_midnight.mcfunction +1 -0
- package/dist/data/test/function/set_night.mcfunction +1 -0
- package/dist/data/test/function/set_noon.mcfunction +1 -0
- package/dist/data/test/function/set_normal.mcfunction +1 -0
- package/dist/data/test/function/set_peaceful.mcfunction +1 -0
- package/dist/data/test/function/setup_four_teams.mcfunction +4 -0
- package/dist/data/test/function/setup_two_teams.mcfunction +2 -0
- package/dist/data/test/function/show_bar.mcfunction +4 -0
- package/dist/data/test/function/simpson_step.mcfunction +16 -0
- package/dist/data/test/function/sin_hp.mcfunction +4 -2
- package/dist/data/test/function/slow_fall.mcfunction +1 -0
- package/dist/data/test/function/smoke.mcfunction +1 -0
- package/dist/data/test/function/sort2_max.mcfunction +1 -2
- package/dist/data/test/function/sort2_min.mcfunction +1 -2
- package/dist/data/test/function/sort3.mcfunction +1 -2
- package/dist/data/test/function/sort3__merge_1.mcfunction +1 -2
- package/dist/data/test/function/sort3__merge_3.mcfunction +1 -2
- package/dist/data/test/function/sort3__merge_5.mcfunction +1 -2
- package/dist/data/test/function/sort3__merge_7.mcfunction +1 -2
- package/dist/data/test/function/sort4.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_1.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_11.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_14.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_3.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_5.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_7.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_9.mcfunction +1 -2
- package/dist/data/test/function/sort5.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_1.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_11.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_13.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_15.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_17.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_19.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_22.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_25.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_3.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_5.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_7.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_9.mcfunction +1 -2
- package/dist/data/test/function/sort_merge.mcfunction +10 -0
- package/dist/data/test/function/sort_merge__else_11.mcfunction +7 -0
- package/dist/data/test/function/sort_merge__else_14.mcfunction +2 -0
- package/dist/data/test/function/sort_merge__else_5.mcfunction +3 -0
- package/dist/data/test/function/sort_merge__else_8.mcfunction +7 -0
- package/dist/data/test/function/sort_merge__loop_body_1.mcfunction +3 -0
- package/dist/data/test/function/sort_merge__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/sort_merge__merge_10.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__merge_13.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__merge_4.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__merge_7.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__then_12.mcfunction +7 -0
- package/dist/data/test/function/sort_merge__then_3.mcfunction +3 -0
- package/dist/data/test/function/sort_merge__then_6.mcfunction +3 -0
- package/dist/data/test/function/sort_merge__then_9.mcfunction +7 -0
- package/dist/data/test/function/sparkles_at.mcfunction +1 -0
- package/dist/data/test/function/speed.mcfunction +1 -0
- package/dist/data/test/function/sphere_contains.mcfunction +1 -2
- package/dist/data/test/function/spread_players.mcfunction +1 -0
- package/dist/data/test/function/sqrt_fx.mcfunction +5 -8
- package/dist/data/test/function/sqrt_hp.mcfunction +17 -0
- package/dist/data/test/function/sqrt_hp__merge_1.mcfunction +21 -0
- package/dist/data/test/function/sqrt_hp__then_0.mcfunction +2 -0
- package/dist/data/test/function/std_dev_approx.mcfunction +5 -0
- package/dist/data/test/function/std_dev_approx__merge_1.mcfunction +13 -0
- package/dist/data/test/function/std_dev_approx__then_0.mcfunction +2 -0
- package/dist/data/test/function/str_len.mcfunction +2 -0
- package/dist/data/test/function/strength.mcfunction +1 -0
- package/dist/data/test/function/t.mcfunction +3 -0
- package/dist/data/test/function/teleport_to.mcfunction +9 -0
- package/dist/data/test/function/teleport_to_entity.mcfunction +5 -0
- package/dist/data/test/function/test.mcfunction +5 -0
- package/dist/data/test/function/test__loop_body_1.mcfunction +9 -0
- package/dist/data/test/function/test__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/test__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/tile_of.mcfunction +1 -2
- package/dist/data/test/function/timer/done.mcfunction +1 -2
- package/dist/data/test/function/timer/remaining.mcfunction +1 -2
- package/dist/data/test/function/timer/tick.mcfunction +1 -2
- package/dist/data/test/function/timer/tick__then_0.mcfunction +1 -2
- package/dist/data/test/function/totem_at.mcfunction +1 -0
- package/dist/data/test/function/trapezoid_step.mcfunction +11 -0
- package/dist/data/test/function/uniform_frac.mcfunction +1 -2
- package/dist/data/test/function/uniform_int.mcfunction +1 -2
- package/dist/data/test/function/update_bar.mcfunction +5 -0
- package/dist/data/test/function/update_bar_color.mcfunction +6 -0
- package/dist/data/test/function/update_bar_color__else_2.mcfunction +4 -0
- package/dist/data/test/function/update_bar_color__else_5.mcfunction +4 -0
- package/dist/data/test/function/update_bar_color__merge_1.mcfunction +1 -0
- package/dist/data/test/function/update_bar_color__merge_4.mcfunction +1 -0
- package/dist/data/test/function/update_bar_color__then_0.mcfunction +4 -0
- package/dist/data/test/function/update_bar_color__then_3.mcfunction +4 -0
- package/dist/data/test/function/value_noise_1d.mcfunction +1 -2
- package/dist/data/test/function/value_noise_2d.mcfunction +1 -2
- package/dist/data/test/function/value_noise_2d__merge_1.mcfunction +1 -2
- package/dist/data/test/function/variance_from_m2.mcfunction +6 -0
- package/dist/data/test/function/variance_from_m2__merge_1.mcfunction +5 -0
- package/dist/data/test/function/variance_from_m2__then_0.mcfunction +2 -0
- package/dist/data/test/function/weapon_damage.mcfunction +5 -0
- package/dist/data/test/function/weather_clear.mcfunction +1 -0
- package/dist/data/test/function/weather_rain.mcfunction +1 -0
- package/dist/data/test/function/weather_thunder.mcfunction +1 -0
- package/dist/data/test/function/weighted2.mcfunction +1 -2
- package/dist/data/test/function/weighted2__merge_1.mcfunction +1 -2
- package/dist/data/test/function/weighted3.mcfunction +1 -2
- package/dist/data/test/function/weighted3__merge_1.mcfunction +1 -2
- package/dist/data/test/function/weighted3__merge_3.mcfunction +1 -2
- package/dist/data/test_dmul/function/__double_mul_macro.mcfunction +1 -0
- package/dist/data/test_dmul/function/double_mul_fixed.mcfunction +6 -0
- package/dist/data/test_dmul/function/load.mcfunction +1 -0
- package/dist/data/test_double_fn/function/double_test.mcfunction +2 -0
- package/dist/data/test_double_fn/function/load.mcfunction +1 -0
- package/dist/data/test_double_fn2/function/double_test.mcfunction +2 -0
- package/dist/data/test_double_fn2/function/load.mcfunction +1 -0
- package/dist/data/test_double_pass/function/caller_fn.mcfunction +4 -0
- package/dist/data/test_double_pass/function/consume_double.mcfunction +2 -0
- package/dist/data/test_double_pass/function/load.mcfunction +1 -0
- package/dist/data/test_macro/function/load.mcfunction +1 -0
- package/dist/data/test_macro/function/macro_helper.mcfunction +1 -0
- package/dist/data/test_macro3/function/__dmul_macro.mcfunction +1 -0
- package/dist/data/test_macro3/function/double_mul_test.mcfunction +7 -0
- package/dist/data/test_macro3/function/load.mcfunction +1 -0
- package/dist/data/test_ret_double/function/load.mcfunction +1 -0
- package/dist/data/test_ret_double/function/make_double.mcfunction +3 -0
- package/dist/data/test_ret_double/function/use_it.mcfunction +3 -0
- package/dist/pack.mcmeta +1 -1
- package/dist/src/__tests__/array-dynamic.test.js +42 -0
- package/dist/src/__tests__/builtins.test.d.ts +1 -0
- package/dist/src/__tests__/builtins.test.js +55 -0
- package/dist/src/__tests__/compile-all.test.js +1 -0
- package/dist/src/__tests__/diagnostics.test.js +8 -11
- package/dist/src/__tests__/double.test.d.ts +7 -0
- package/dist/src/__tests__/double.test.js +464 -0
- package/dist/src/__tests__/e2e/ecs-stdlib.test.d.ts +7 -0
- package/dist/src/__tests__/e2e/ecs-stdlib.test.js +328 -0
- package/dist/src/__tests__/e2e/events-stdlib.test.d.ts +1 -0
- package/dist/src/__tests__/e2e/events-stdlib.test.js +81 -0
- package/dist/src/__tests__/e2e/fft-stdlib.test.d.ts +13 -0
- package/dist/src/__tests__/e2e/fft-stdlib.test.js +288 -0
- package/dist/src/__tests__/e2e/for-in-array.test.d.ts +4 -0
- package/dist/src/__tests__/e2e/for-in-array.test.js +59 -0
- package/dist/src/__tests__/e2e/macros.test.js +7 -7
- package/dist/src/__tests__/e2e/ode-stdlib.test.d.ts +1 -0
- package/dist/src/__tests__/e2e/ode-stdlib.test.js +91 -0
- package/dist/src/__tests__/e2e/stdlib-e2e.test.js +1616 -0
- package/dist/src/__tests__/emit/compile.test.d.ts +1 -0
- package/dist/src/__tests__/emit/compile.test.js +95 -0
- package/dist/src/__tests__/emit/index.test.d.ts +1 -0
- package/dist/src/__tests__/emit/index.test.js +180 -0
- package/dist/src/__tests__/emit/modules-extra.test.d.ts +1 -0
- package/dist/src/__tests__/emit/modules-extra.test.js +77 -0
- package/dist/src/__tests__/enum.test.js +4 -6
- package/dist/src/__tests__/fixed.test.d.ts +7 -0
- package/dist/src/__tests__/fixed.test.js +148 -0
- package/dist/src/__tests__/float-lint.test.d.ts +7 -0
- package/dist/src/__tests__/float-lint.test.js +96 -0
- package/dist/src/__tests__/float.test.d.ts +7 -0
- package/dist/src/__tests__/float.test.js +148 -0
- package/dist/src/__tests__/for-each.test.d.ts +1 -0
- package/dist/src/__tests__/for-each.test.js +125 -0
- package/dist/src/__tests__/for-range.test.d.ts +1 -0
- package/dist/src/__tests__/for-range.test.js +136 -0
- package/dist/src/__tests__/generics.test.js +4 -4
- package/dist/src/__tests__/impl.test.d.ts +1 -0
- package/dist/src/__tests__/impl.test.js +199 -0
- package/dist/src/__tests__/lsp-logic.test.d.ts +1 -0
- package/dist/src/__tests__/lsp-logic.test.js +145 -0
- package/dist/src/__tests__/match.test.d.ts +10 -0
- package/dist/src/__tests__/match.test.js +197 -0
- package/dist/src/__tests__/mc-integration/item-entity-events.test.d.ts +18 -0
- package/dist/src/__tests__/mc-integration/item-entity-events.test.js +287 -0
- package/dist/src/__tests__/mc-integration/stdlib-coverage-2.test.d.ts +13 -0
- package/dist/src/__tests__/mc-integration/stdlib-coverage-2.test.js +833 -0
- package/dist/src/__tests__/mc-integration/stdlib-coverage.test.d.ts +13 -0
- package/dist/src/__tests__/mc-integration/stdlib-coverage.test.js +707 -0
- package/dist/src/__tests__/mc-integration/syntax-coverage.test.d.ts +9 -0
- package/dist/src/__tests__/mc-integration/syntax-coverage.test.js +442 -0
- package/dist/src/__tests__/mc-integration.test.js +835 -5
- package/dist/src/__tests__/optimizer/constant_fold.test.js +105 -0
- package/dist/src/__tests__/optimizer/coroutine.test.js +3 -2
- package/dist/src/__tests__/parser.test.js +5 -5
- package/dist/src/__tests__/runtime.test.js +143 -238
- package/dist/src/__tests__/stdlib/arr-len.test.d.ts +13 -0
- package/dist/src/__tests__/stdlib/arr-len.test.js +195 -0
- package/dist/src/__tests__/stdlib/calculus.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/calculus.test.js +123 -0
- package/dist/src/__tests__/stdlib/dialog.test.d.ts +6 -0
- package/dist/src/__tests__/stdlib/dialog.test.js +142 -0
- package/dist/src/__tests__/stdlib/easing.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/easing.test.js +117 -0
- package/dist/src/__tests__/stdlib/geometry.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/geometry.test.js +163 -0
- package/dist/src/__tests__/stdlib/heap.test.d.ts +4 -0
- package/dist/src/__tests__/stdlib/heap.test.js +141 -0
- package/dist/src/__tests__/stdlib/list.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/list.test.js +134 -0
- package/dist/src/__tests__/stdlib/matrix.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/matrix.test.js +148 -0
- package/dist/src/__tests__/stdlib/pathfind.test.d.ts +4 -0
- package/dist/src/__tests__/stdlib/pathfind.test.js +167 -0
- package/dist/src/__tests__/stdlib/scheduler.test.d.ts +6 -0
- package/dist/src/__tests__/stdlib/scheduler.test.js +177 -0
- package/dist/src/__tests__/stdlib/sort-v2.test.d.ts +4 -0
- package/dist/src/__tests__/stdlib/sort-v2.test.js +131 -0
- package/dist/src/__tests__/stdlib/sort.test.d.ts +4 -0
- package/dist/src/__tests__/stdlib/sort.test.js +128 -0
- package/dist/src/__tests__/stdlib/state.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/state.test.js +176 -0
- package/dist/src/__tests__/typechecker-strict.test.js +21 -21
- package/dist/src/__tests__/typechecker.test.js +5 -3
- package/dist/src/ast/types.d.ts +28 -2
- package/dist/src/emit/compile.js +30 -3
- package/dist/src/emit/index.d.ts +2 -0
- package/dist/src/emit/index.js +20 -1
- package/dist/src/emit/modules.js +3 -2
- package/dist/src/events/types.d.ts +1 -1
- package/dist/src/events/types.js +5 -2
- package/dist/src/hir/lower.js +88 -2
- package/dist/src/hir/monomorphize.js +11 -5
- package/dist/src/hir/types.d.ts +20 -1
- package/dist/src/lexer/index.d.ts +1 -1
- package/dist/src/lexer/index.js +10 -1
- package/dist/src/lir/lower.js +7 -0
- package/dist/src/lsp/server.js +912 -56
- package/dist/src/mc-test/client.d.ts +13 -1
- package/dist/src/mc-test/client.js +29 -1
- package/dist/src/mir/lower.js +703 -74
- package/dist/src/mir/types.d.ts +5 -0
- package/dist/src/mir/verify.js +2 -0
- package/dist/src/optimizer/constant_fold.js +10 -6
- package/dist/src/optimizer/coroutine.js +90 -33
- package/dist/src/optimizer/interprocedural.js +4 -0
- package/dist/src/parser/index.d.ts +5 -0
- package/dist/src/parser/index.js +171 -39
- package/dist/src/runtime/index.js +24 -0
- package/dist/src/typechecker/index.d.ts +8 -1
- package/dist/src/typechecker/index.js +73 -14
- package/docs/LANGUAGE_REFERENCE.md +302 -67
- package/docs/stdlib/README.md +54 -0
- package/docs/stdlib/advanced.md +276 -0
- package/docs/stdlib/bigint.md +285 -0
- package/docs/stdlib/bits.md +159 -0
- package/docs/stdlib/bossbar.md +101 -0
- package/docs/stdlib/calculus.md +141 -0
- package/docs/stdlib/color.md +125 -0
- package/docs/stdlib/combat.md +41 -0
- package/docs/stdlib/cooldown.md +48 -0
- package/docs/stdlib/easing.md +157 -0
- package/docs/stdlib/effects.md +101 -0
- package/docs/stdlib/expr.md +38 -0
- package/docs/stdlib/geometry.md +130 -0
- package/docs/stdlib/interactions.md +111 -0
- package/docs/stdlib/inventory.md +53 -0
- package/docs/stdlib/list.md +189 -0
- package/docs/stdlib/math.md +334 -0
- package/docs/stdlib/math_hp.md +185 -0
- package/docs/stdlib/matrix.md +123 -0
- package/docs/stdlib/mobs.md +131 -0
- package/docs/stdlib/noise.md +103 -0
- package/docs/stdlib/parabola.md +119 -0
- package/docs/stdlib/particles.md +123 -0
- package/docs/stdlib/physics.md +148 -0
- package/docs/stdlib/player.md +43 -0
- package/docs/stdlib/quaternion.md +159 -0
- package/docs/stdlib/random.md +86 -0
- package/docs/stdlib/sets.md +68 -0
- package/docs/stdlib/signal.md +141 -0
- package/docs/stdlib/spawn.md +65 -0
- package/docs/stdlib/strings.md +17 -0
- package/docs/stdlib/tags.md +117 -0
- package/docs/stdlib/teams.md +87 -0
- package/docs/stdlib/timer.md +126 -0
- package/docs/stdlib/vec.md +193 -0
- package/docs/stdlib/world.md +151 -0
- package/editors/vscode/build.mjs +31 -12
- package/editors/vscode/out/extension.js +3670 -200
- package/editors/vscode/out/lsp-server.js +14854 -0
- package/editors/vscode/package-lock.json +3 -3
- package/editors/vscode/package.json +1 -1
- package/editors/vscode/snippets/redscript.json +109 -30
- package/editors/vscode/src/extension.ts +15 -13
- package/examples/readme-demo.mcrs +4 -4
- package/jest.config.js +5 -2
- package/package.json +1 -1
- package/scripts/postbuild.js +20 -0
- package/src/__tests__/array-dynamic.test.ts +42 -0
- package/src/__tests__/builtins.test.ts +66 -0
- package/src/__tests__/compile-all.test.ts +3 -2
- package/src/__tests__/diagnostics.test.ts +8 -10
- package/src/__tests__/double.test.ts +478 -0
- package/src/__tests__/e2e/ecs-stdlib.test.ts +371 -0
- package/src/__tests__/e2e/events-stdlib.test.ts +50 -0
- package/src/__tests__/e2e/fft-stdlib.test.ts +313 -0
- package/src/__tests__/e2e/macros.test.ts +7 -7
- package/src/__tests__/e2e/ode-stdlib.test.ts +68 -0
- package/src/__tests__/e2e/stdlib-e2e.test.ts +1952 -0
- package/src/__tests__/emit/compile.test.ts +102 -0
- package/src/__tests__/emit/index.test.ts +189 -0
- package/src/__tests__/emit/modules-extra.test.ts +80 -0
- package/src/__tests__/enum.test.ts +4 -6
- package/src/__tests__/fixed.test.ts +159 -0
- package/src/__tests__/fixtures/coroutine-mc-test.mcrs +58 -0
- package/src/__tests__/fixtures/for-range.mcrs +15 -0
- package/src/__tests__/fixtures/heap-sort-mc-test.mcrs +87 -0
- package/src/__tests__/fixtures/impl-test.mcrs +13 -44
- package/src/__tests__/fixtures/stdlib-extra-test.mcrs +226 -0
- package/src/__tests__/fixtures/stdlib-math-integration.mcrs +28 -0
- package/src/__tests__/fixtures/stdlib-math-test.mcrs +53 -0
- package/src/__tests__/float-lint.test.ts +102 -0
- package/src/__tests__/float.test.ts +158 -0
- package/src/__tests__/for-each.test.ts +135 -0
- package/src/__tests__/for-range.test.ts +149 -0
- package/src/__tests__/generics.test.ts +4 -4
- package/src/__tests__/impl.test.ts +207 -0
- package/src/__tests__/lsp-logic.test.ts +162 -0
- package/src/__tests__/match.test.ts +212 -0
- package/src/__tests__/mc-integration/item-entity-events.test.ts +298 -0
- package/src/__tests__/mc-integration/stdlib-coverage-2.test.ts +817 -0
- package/src/__tests__/mc-integration/stdlib-coverage.test.ts +699 -0
- package/src/__tests__/mc-integration/syntax-coverage.test.ts +464 -0
- package/src/__tests__/mc-integration.test.ts +889 -5
- package/src/__tests__/optimizer/constant_fold.test.ts +115 -0
- package/src/__tests__/optimizer/coroutine.test.ts +3 -2
- package/src/__tests__/parser.test.ts +5 -5
- package/src/__tests__/runtime.test.ts +194 -0
- package/src/__tests__/stdlib/arr-len.test.ts +231 -0
- package/src/__tests__/stdlib/calculus.test.ts +99 -0
- package/src/__tests__/stdlib/dialog.test.ts +132 -0
- package/src/__tests__/stdlib/easing.test.ts +97 -0
- package/src/__tests__/stdlib/geometry.test.ts +171 -0
- package/src/__tests__/stdlib/heap.test.ts +121 -0
- package/src/__tests__/stdlib/list.test.ts +117 -0
- package/src/__tests__/stdlib/matrix.test.ts +140 -0
- package/src/__tests__/stdlib/pathfind.test.ts +151 -0
- package/src/__tests__/stdlib/scheduler.test.ts +171 -0
- package/src/__tests__/stdlib/sort-v2.test.ts +111 -0
- package/src/__tests__/stdlib/sort.test.ts +106 -0
- package/src/__tests__/stdlib/state.test.ts +164 -0
- package/src/__tests__/typechecker-strict.test.ts +21 -21
- package/src/__tests__/typechecker.test.ts +5 -3
- package/src/ast/types.ts +16 -3
- package/src/emit/compile.ts +32 -3
- package/src/emit/index.ts +24 -1
- package/src/emit/modules.ts +2 -1
- package/src/events/types.ts +5 -2
- package/src/examples/capture_the_flag.mcrs +2 -2
- package/src/examples/hunger_games.mcrs +4 -4
- package/src/examples/parkour_race.mcrs +8 -8
- package/src/examples/tutorial_01_hello.mcrs +63 -0
- package/src/examples/tutorial_02_variables.mcrs +157 -0
- package/src/examples/tutorial_03_functions_structs.mcrs +162 -0
- package/src/examples/tutorial_04_selectors.mcrs +139 -0
- package/src/examples/tutorial_05_decorators.mcrs +131 -0
- package/src/examples/tutorial_06_math_particles.mcrs +123 -0
- package/src/examples/tutorial_07_random.mcrs +142 -0
- package/src/examples/tutorial_08_coroutine.mcrs +163 -0
- package/src/examples/tutorial_09_precision.mcrs +154 -0
- package/src/examples/tutorial_10_kill_race.mcrs +289 -0
- package/src/examples/zombie_survival.mcrs +7 -7
- package/src/hir/lower.ts +101 -4
- package/src/hir/monomorphize.ts +11 -6
- package/src/hir/types.ts +14 -1
- package/src/lexer/index.ts +11 -2
- package/src/lir/lower.ts +8 -0
- package/src/lsp/server.ts +894 -54
- package/src/mc-test/client.ts +32 -1
- package/src/mir/lower.ts +703 -74
- package/src/mir/types.ts +1 -0
- package/src/mir/verify.ts +2 -0
- package/src/optimizer/constant_fold.ts +11 -6
- package/src/optimizer/coroutine.ts +89 -29
- package/src/optimizer/interprocedural.ts +4 -0
- package/src/parser/index.ts +175 -41
- package/src/runtime/index.ts +26 -0
- package/src/stdlib/advanced.mcrs +47 -0
- package/src/stdlib/bigint.mcrs +251 -0
- package/src/stdlib/calculus.mcrs +150 -0
- package/src/stdlib/color.mcrs +102 -82
- package/src/stdlib/combat.mcrs +18 -12
- package/src/stdlib/dialog.mcrs +55 -0
- package/src/stdlib/ecs.mcrs +238 -0
- package/src/stdlib/events.mcrs +29 -0
- package/src/stdlib/expr.mcrs +117 -0
- package/src/stdlib/fft.mcrs +177 -0
- package/src/stdlib/geometry.mcrs +89 -0
- package/src/stdlib/graph.mcrs +274 -0
- package/src/stdlib/heap.mcrs +175 -0
- package/src/stdlib/linalg.mcrs +260 -0
- package/src/stdlib/list.mcrs +99 -0
- package/src/stdlib/math.mcrs +121 -5
- package/src/stdlib/math_hp.mcrs +452 -0
- package/src/stdlib/matrix.mcrs +113 -0
- package/src/stdlib/ode.mcrs +168 -0
- package/src/stdlib/parabola.mcrs +160 -0
- package/src/stdlib/particles.mcrs +69 -0
- package/src/stdlib/pathfind.mcrs +321 -0
- package/src/stdlib/quaternion.mcrs +192 -0
- package/src/stdlib/random.mcrs +46 -1
- package/src/stdlib/scheduler.mcrs +271 -0
- package/src/stdlib/signal.mcrs +223 -0
- package/src/stdlib/sort.mcrs +194 -0
- package/src/stdlib/state.mcrs +65 -0
- package/src/stdlib/world.mcrs +24 -0
- package/src/typechecker/index.ts +88 -15
- package/test_trig.ts +43 -0
package/src/stdlib/bigint.mcrs
CHANGED
|
@@ -194,3 +194,254 @@ fn bigint_leading_zeros(arr: int[], len: int): int {
|
|
|
194
194
|
}
|
|
195
195
|
return count;
|
|
196
196
|
}
|
|
197
|
+
|
|
198
|
+
// ─── Division: bigint ÷ small integer ────────────────────────────────────────
|
|
199
|
+
// Divides n-chunk bigint by a small integer (1 ≤ divisor ≤ 9999)
|
|
200
|
+
// Algorithm: long division chunk by chunk (most-significant first)
|
|
201
|
+
// result[i] = (rem*10000 + a[i]) / divisor
|
|
202
|
+
// rem = (rem*10000 + a[i]) % divisor
|
|
203
|
+
|
|
204
|
+
// bigint_div_small(a, divisor, result, len): result = a / divisor
|
|
205
|
+
// Returns remainder.
|
|
206
|
+
fn bigint_div_small(a: int[], divisor: int, result: int[], len: int): int {
|
|
207
|
+
let rem: int = 0;
|
|
208
|
+
let i: int = 0;
|
|
209
|
+
while (i < len) {
|
|
210
|
+
let cur: int = rem * 10000 + a[i];
|
|
211
|
+
result[i] = cur / divisor;
|
|
212
|
+
rem = cur % divisor;
|
|
213
|
+
i = i + 1;
|
|
214
|
+
}
|
|
215
|
+
return rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// bigint_mod_small(a, divisor, len): return a % divisor (0..divisor-1)
|
|
219
|
+
fn bigint_mod_small(a: int[], divisor: int, len: int): int {
|
|
220
|
+
let rem: int = 0;
|
|
221
|
+
let i: int = 0;
|
|
222
|
+
while (i < len) {
|
|
223
|
+
rem = (rem * 10000 + a[i]) % divisor;
|
|
224
|
+
i = i + 1;
|
|
225
|
+
}
|
|
226
|
+
return rem;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// bigint_print_chunks(a, len): get the value of chunk at index i
|
|
230
|
+
// Helper to read specific chunk for display purposes
|
|
231
|
+
fn bigint_chunk(a: int[], i: int): int {
|
|
232
|
+
return a[i];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ─── Full bigint × bigint multiplication ─────────────────────────────────────
|
|
236
|
+
//
|
|
237
|
+
// bigint_mul(a, b, result, la, lb):
|
|
238
|
+
// Multiply two bigints: result = a * b
|
|
239
|
+
// a has la chunks, b has lb chunks, result must have la+lb chunks (pre-zeroed)
|
|
240
|
+
// Uses schoolbook O(n²) algorithm.
|
|
241
|
+
// Maximum safe chunk product: 9999 * 9999 = 99,980,001 < INT32_MAX ✓
|
|
242
|
+
// After accumulation each chunk can exceed 10000 — carry_pass normalizes.
|
|
243
|
+
//
|
|
244
|
+
// Usage:
|
|
245
|
+
// import "stdlib/bigint"
|
|
246
|
+
// let a: int[] = [0, 0, 1234, 5678]; // 4-chunk
|
|
247
|
+
// let b: int[] = [0, 0, 9999]; // 3-chunk
|
|
248
|
+
// let result: int[] = [0, 0, 0, 0, 0, 0, 0]; // la+lb = 7 chunks, pre-zeroed
|
|
249
|
+
// bigint_mul(a, b, result, 4, 3);
|
|
250
|
+
//
|
|
251
|
+
fn bigint_mul(a: int[], b: int[], result: int[], la: int, lb: int) {
|
|
252
|
+
// Phase 1: accumulate partial products (big-endian, MSB at index 0)
|
|
253
|
+
// a[i] is the (la-1-i)-th digit from LSB, similarly for b[j]
|
|
254
|
+
// result has la+lb chunks; result[la+lb-1] is the LSB chunk
|
|
255
|
+
let i: int = 0;
|
|
256
|
+
while (i < la) {
|
|
257
|
+
let j: int = 0;
|
|
258
|
+
while (j < lb) {
|
|
259
|
+
// Position in result: MSB-aligned
|
|
260
|
+
// a[i] * b[j] contributes to result[i + j + 1] (1-indexed from MSB, 0 = overflow slot)
|
|
261
|
+
let pos: int = i + j + 1;
|
|
262
|
+
result[pos] = result[pos] + a[i] * b[j];
|
|
263
|
+
j = j + 1;
|
|
264
|
+
}
|
|
265
|
+
i = i + 1;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Phase 2: carry propagation from LSB to MSB
|
|
269
|
+
let total: int = la + lb;
|
|
270
|
+
let k: int = total - 1;
|
|
271
|
+
while (k > 0) {
|
|
272
|
+
let carry: int = result[k] / 10000;
|
|
273
|
+
result[k] = result[k] % 10000;
|
|
274
|
+
result[k - 1] = result[k - 1] + carry;
|
|
275
|
+
k = k - 1;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// bigint_mul_result_len(la, lb): required result array length for bigint_mul
|
|
280
|
+
fn bigint_mul_result_len(la: int, lb: int): int {
|
|
281
|
+
return la + lb;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// bigint_sq(a, result, len):
|
|
285
|
+
// Square a bigint: result = a * a
|
|
286
|
+
// result must have len*2 chunks (pre-zeroed).
|
|
287
|
+
// Optimized: only compute upper triangle and double (avoids redundant multiplications).
|
|
288
|
+
//
|
|
289
|
+
fn bigint_sq(a: int[], result: int[], len: int) {
|
|
290
|
+
// Diagonal terms (i == j)
|
|
291
|
+
let i: int = 0;
|
|
292
|
+
while (i < len) {
|
|
293
|
+
let pos: int = i + i + 1;
|
|
294
|
+
result[pos] = result[pos] + a[i] * a[i];
|
|
295
|
+
i = i + 1;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Off-diagonal terms (i < j), doubled
|
|
299
|
+
i = 0;
|
|
300
|
+
while (i < len) {
|
|
301
|
+
let j: int = i + 1;
|
|
302
|
+
while (j < len) {
|
|
303
|
+
let pos: int = i + j + 1;
|
|
304
|
+
// a[i]*a[j] * 2 — safe: 9999*9999*2 = 199,960,002 < INT32_MAX
|
|
305
|
+
result[pos] = result[pos] + a[i] * a[j] * 2;
|
|
306
|
+
j = j + 1;
|
|
307
|
+
}
|
|
308
|
+
i = i + 1;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Carry propagation
|
|
312
|
+
let total: int = len * 2;
|
|
313
|
+
let k: int = total - 1;
|
|
314
|
+
while (k > 0) {
|
|
315
|
+
let carry: int = result[k] / 10000;
|
|
316
|
+
result[k] = result[k] % 10000;
|
|
317
|
+
result[k - 1] = result[k - 1] + carry;
|
|
318
|
+
k = k - 1;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// ─── Full bigint ÷ bigint (Long Division) ────────────────────────────────────
|
|
323
|
+
//
|
|
324
|
+
// bigint_div(a, b, quotient, remainder, la, lb):
|
|
325
|
+
// Compute a / b → quotient, a % b → remainder
|
|
326
|
+
// a has la chunks, b has lb chunks (most-significant first, base 10000)
|
|
327
|
+
// quotient must have la chunks (pre-zeroed)
|
|
328
|
+
// remainder must have lb chunks (pre-zeroed)
|
|
329
|
+
//
|
|
330
|
+
// Algorithm: Binary-search trial subtraction per digit position.
|
|
331
|
+
// For each position i in quotient (0..la-lb):
|
|
332
|
+
// trial_subtract(a_window, b, lb) to find max digit q such that q*b ≤ window.
|
|
333
|
+
//
|
|
334
|
+
// Prerequisite helpers: bigint_cmp, bigint_mul_small, bigint_sub (all in bigint.mcrs)
|
|
335
|
+
|
|
336
|
+
// bigint_shl1(a, len): shift bigint left by 1 chunk (multiply by base 10000)
|
|
337
|
+
// Modifies a in-place, drops most-significant chunk.
|
|
338
|
+
fn bigint_shl1(a: int[], len: int): void {
|
|
339
|
+
let i: int = 0;
|
|
340
|
+
while (i < len - 1) {
|
|
341
|
+
a[i] = a[i + 1];
|
|
342
|
+
i = i + 1;
|
|
343
|
+
}
|
|
344
|
+
a[len - 1] = 0;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// bigint_cmp_window(a, aoff, b, len): compare a[aoff..aoff+len] with b[0..len]
|
|
348
|
+
// Returns 1 if a_window > b, -1 if a_window < b, 0 if equal
|
|
349
|
+
fn bigint_cmp_window(a: int[], aoff: int, b: int[], len: int): int {
|
|
350
|
+
let i: int = 0;
|
|
351
|
+
while (i < len) {
|
|
352
|
+
let ai: int = a[aoff + i];
|
|
353
|
+
let bi: int = b[i];
|
|
354
|
+
if (ai > bi) { return 1; }
|
|
355
|
+
if (ai < bi) { return -1; }
|
|
356
|
+
i = i + 1;
|
|
357
|
+
}
|
|
358
|
+
return 0;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// bigint_sub_window(a, aoff, b, len): a[aoff..aoff+len] -= b[0..len] (in-place)
|
|
362
|
+
fn bigint_sub_window(a: int[], aoff: int, b: int[], len: int): void {
|
|
363
|
+
let borrow: int = 0;
|
|
364
|
+
let i: int = len - 1;
|
|
365
|
+
while (i >= 0) {
|
|
366
|
+
let diff: int = a[aoff + i] - b[i] - borrow;
|
|
367
|
+
if (diff < 0) {
|
|
368
|
+
diff = diff + 10000;
|
|
369
|
+
borrow = 1;
|
|
370
|
+
} else {
|
|
371
|
+
borrow = 0;
|
|
372
|
+
}
|
|
373
|
+
a[aoff + i] = diff;
|
|
374
|
+
i = i - 1;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// bigint_mul_small_into(b, factor, out, len): out = b * factor (small int)
|
|
379
|
+
fn bigint_mul_small_into(b: int[], factor: int, out: int[], len: int): void {
|
|
380
|
+
let carry: int = 0;
|
|
381
|
+
let i: int = len - 1;
|
|
382
|
+
while (i >= 0) {
|
|
383
|
+
let prod: int = b[i] * factor + carry;
|
|
384
|
+
out[i] = prod % 10000;
|
|
385
|
+
carry = prod / 10000;
|
|
386
|
+
i = i - 1;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// bigint_div(a, b, quotient, remainder, la, lb):
|
|
391
|
+
// Full arbitrary-precision integer division.
|
|
392
|
+
// quotient[0..la-1] is written, remainder[0..lb-1] is written.
|
|
393
|
+
// a and b must not alias quotient or remainder.
|
|
394
|
+
// NOTE: la >= lb required; both arrays most-significant first, base 10000.
|
|
395
|
+
fn bigint_div(a: int[], b: int[], quotient: int[], remainder: int[], la: int, lb: int): void {
|
|
396
|
+
// Work on a copy of a (dividend) to allow in-place subtraction
|
|
397
|
+
let work: int[] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
398
|
+
let wi: int = 0;
|
|
399
|
+
while (wi < la) {
|
|
400
|
+
work[wi] = a[wi];
|
|
401
|
+
wi = wi + 1;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// Temp buffer for trial product: b * q_digit
|
|
405
|
+
let trial: int[] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
406
|
+
|
|
407
|
+
// Zero quotient
|
|
408
|
+
let qi: int = 0;
|
|
409
|
+
while (qi < la) {
|
|
410
|
+
quotient[qi] = 0;
|
|
411
|
+
qi = qi + 1;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Process each quotient digit position (la - lb + 1 digits)
|
|
415
|
+
let pos: int = 0;
|
|
416
|
+
while (pos <= la - lb) {
|
|
417
|
+
// Binary search for largest q in [0, 9999] s.t. b * q ≤ work[pos..pos+lb]
|
|
418
|
+
let lo: int = 0;
|
|
419
|
+
let hi: int = 9999;
|
|
420
|
+
let q: int = 0;
|
|
421
|
+
while (lo <= hi) {
|
|
422
|
+
let mid: int = (lo + hi) / 2;
|
|
423
|
+
bigint_mul_small_into(b, mid, trial, lb);
|
|
424
|
+
let cmp: int = bigint_cmp_window(work, pos, trial, lb);
|
|
425
|
+
if (cmp >= 0) {
|
|
426
|
+
q = mid;
|
|
427
|
+
lo = mid + 1;
|
|
428
|
+
} else {
|
|
429
|
+
hi = mid - 1;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
quotient[pos] = q;
|
|
433
|
+
// Subtract b * q from work window
|
|
434
|
+
if (q > 0) {
|
|
435
|
+
bigint_mul_small_into(b, q, trial, lb);
|
|
436
|
+
bigint_sub_window(work, pos, trial, lb);
|
|
437
|
+
}
|
|
438
|
+
pos = pos + 1;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// Remainder is work[la-lb .. la-1]
|
|
442
|
+
let ri: int = 0;
|
|
443
|
+
while (ri < lb) {
|
|
444
|
+
remainder[ri] = work[la - lb + ri];
|
|
445
|
+
ri = ri + 1;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// calculus.mcrs — Numerical calculus for RedScript datapacks.
|
|
2
|
+
//
|
|
3
|
+
// All values fixed-point ×10000 unless noted.
|
|
4
|
+
//
|
|
5
|
+
// Methods:
|
|
6
|
+
// - Numerical differentiation (finite difference)
|
|
7
|
+
// - Numerical integration (trapezoid, Simpson's rule over fixed arrays)
|
|
8
|
+
// - Riemann sum helpers
|
|
9
|
+
// - Curve length approximation
|
|
10
|
+
|
|
11
|
+
module library;
|
|
12
|
+
|
|
13
|
+
// ─── Differentiation ─────────────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
// deriv_forward(f1, f0, h_fx): forward difference derivative
|
|
16
|
+
// f1 = f(x+h), f0 = f(x), h_fx = step size ×10000
|
|
17
|
+
// Returns df/dx ×10000
|
|
18
|
+
fn deriv_forward(f1: int, f0: int, h_fx: int): int {
|
|
19
|
+
if (h_fx == 0) { return 0; }
|
|
20
|
+
return (f1 - f0) * 10000 / h_fx;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// deriv_central(f_plus, f_minus, h_fx): central difference (more accurate)
|
|
24
|
+
// f_plus = f(x+h), f_minus = f(x-h)
|
|
25
|
+
// Returns df/dx ×10000
|
|
26
|
+
fn deriv_central(f_plus: int, f_minus: int, h_fx: int): int {
|
|
27
|
+
if (h_fx == 0) { return 0; }
|
|
28
|
+
return (f_plus - f_minus) * 10000 / (2 * h_fx);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// second_deriv(f_plus, f0, f_minus, h_fx): second derivative
|
|
32
|
+
// Returns d²f/dx² ×10000
|
|
33
|
+
fn second_deriv(f_plus: int, f0: int, f_minus: int, h_fx: int): int {
|
|
34
|
+
if (h_fx == 0) { return 0; }
|
|
35
|
+
return (f_plus - 2 * f0 + f_minus) * 100000000 / h_fx / h_fx;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ─── Integration over arrays ──────────────────────────────────────────────────
|
|
39
|
+
//
|
|
40
|
+
// For integration, the user provides an array of function values at equally
|
|
41
|
+
// spaced points, and the step size.
|
|
42
|
+
|
|
43
|
+
// integrate_trapezoid(vals, n, h_fx): trapezoidal rule integration
|
|
44
|
+
// vals: array of n function values ×10000, equally spaced by h_fx
|
|
45
|
+
// h_fx: step width ×10000
|
|
46
|
+
// Returns integral ×10000 (area under curve)
|
|
47
|
+
fn integrate_trapezoid(vals: int[], n: int, h_fx: int): int {
|
|
48
|
+
if (n < 2) { return 0; }
|
|
49
|
+
// Sum = (vals[0] + vals[n-1]) / 2 + vals[1] + vals[2] + ... + vals[n-2]
|
|
50
|
+
let sum: int = vals[0] / 2 + vals[n - 1] / 2;
|
|
51
|
+
let i: int = 1;
|
|
52
|
+
while (i < n - 1) {
|
|
53
|
+
sum = sum + vals[i];
|
|
54
|
+
i = i + 1;
|
|
55
|
+
}
|
|
56
|
+
return sum * h_fx / 10000;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// integrate_simpson(vals, n, h_fx): Simpson's 1/3 rule (n must be odd, n ≥ 3)
|
|
60
|
+
// More accurate than trapezoid for smooth functions
|
|
61
|
+
fn integrate_simpson(vals: int[], n: int, h_fx: int): int {
|
|
62
|
+
if (n < 3) { return integrate_trapezoid(vals, n, h_fx); }
|
|
63
|
+
// Ensure n is odd by using n-1 if even
|
|
64
|
+
let m: int = n;
|
|
65
|
+
if (m % 2 == 0) { m = m - 1; }
|
|
66
|
+
// Coefficients: 1, 4, 2, 4, 2, ..., 4, 1 (times h/3)
|
|
67
|
+
let sum: int = vals[0] + vals[m - 1];
|
|
68
|
+
let i: int = 1;
|
|
69
|
+
while (i < m - 1) {
|
|
70
|
+
if (i % 2 == 1) {
|
|
71
|
+
sum = sum + 4 * vals[i];
|
|
72
|
+
}
|
|
73
|
+
if (i % 2 == 0) {
|
|
74
|
+
sum = sum + 2 * vals[i];
|
|
75
|
+
}
|
|
76
|
+
i = i + 1;
|
|
77
|
+
}
|
|
78
|
+
return sum * h_fx / 30000; // × h/3 = h_fx / (3 × 10000)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ─── Riemann sums ─────────────────────────────────────────────────────────────
|
|
82
|
+
|
|
83
|
+
// riemann_left(vals, n, h_fx): left Riemann sum
|
|
84
|
+
fn riemann_left(vals: int[], n: int, h_fx: int): int {
|
|
85
|
+
let sum: int = 0;
|
|
86
|
+
let i: int = 0;
|
|
87
|
+
while (i < n - 1) { sum = sum + vals[i]; i = i + 1; }
|
|
88
|
+
return sum * h_fx / 10000;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// riemann_right(vals, n, h_fx): right Riemann sum
|
|
92
|
+
fn riemann_right(vals: int[], n: int, h_fx: int): int {
|
|
93
|
+
let sum: int = 0;
|
|
94
|
+
let i: int = 1;
|
|
95
|
+
while (i < n) { sum = sum + vals[i]; i = i + 1; }
|
|
96
|
+
return sum * h_fx / 10000;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// riemann_mid(vals, n, h_fx): midpoint Riemann sum
|
|
100
|
+
// vals: midpoint values (n-1 midpoints for n-1 intervals)
|
|
101
|
+
fn riemann_mid(vals: int[], n: int, h_fx: int): int {
|
|
102
|
+
let sum: int = 0;
|
|
103
|
+
let i: int = 0;
|
|
104
|
+
while (i < n) { sum = sum + vals[i]; i = i + 1; }
|
|
105
|
+
return sum * h_fx / 10000;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ─── Curve length ────────────────────────────────────────────────────────────
|
|
109
|
+
|
|
110
|
+
// curve_length_2d(xs, ys, n): approximate arc length of a 2D polyline
|
|
111
|
+
// xs, ys: x and y coordinates ×10000 of n points
|
|
112
|
+
fn curve_length_2d(xs: int[], ys: int[], n: int): int {
|
|
113
|
+
let total: int = 0;
|
|
114
|
+
let i: int = 0;
|
|
115
|
+
while (i < n - 1) {
|
|
116
|
+
let dx: int = xs[i + 1] - xs[i];
|
|
117
|
+
let dy: int = ys[i + 1] - ys[i];
|
|
118
|
+
let seg_sq: int = dx * dx / 10000 + dy * dy / 10000;
|
|
119
|
+
total = total + isqrt(seg_sq * 100) * 100;
|
|
120
|
+
i = i + 1;
|
|
121
|
+
}
|
|
122
|
+
return total;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// ─── Running statistics ───────────────────────────────────────────────────────
|
|
126
|
+
|
|
127
|
+
// running_mean(prev_mean, new_val, n): Welford's online mean update
|
|
128
|
+
// prev_mean ×10000, new_val ×10000, n: count after adding new_val (n ≥ 1)
|
|
129
|
+
fn running_mean(prev_mean: int, new_val: int, n: int): int {
|
|
130
|
+
if (n <= 1) { return new_val; }
|
|
131
|
+
return prev_mean + (new_val - prev_mean) * 10000 / (n * 10000);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// running_m2(prev_m2, prev_mean, new_mean, new_val): Welford's M2 update
|
|
135
|
+
// Used to compute variance: variance = m2 / (n-1)
|
|
136
|
+
fn running_m2(prev_m2: int, prev_mean: int, new_mean: int, new_val: int): int {
|
|
137
|
+
return prev_m2 + (new_val - prev_mean) * (new_val - new_mean) / 10000;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// variance_from_m2(m2, n): get variance from Welford's M2, n = number of samples
|
|
141
|
+
fn variance_from_m2(m2: int, n: int): int {
|
|
142
|
+
if (n <= 1) { return 0; }
|
|
143
|
+
return m2 / (n - 1);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// std_dev_approx(variance_fx): approximate std dev = √variance
|
|
147
|
+
fn std_dev_approx(variance_fx: int): int {
|
|
148
|
+
if (variance_fx <= 0) { return 0; }
|
|
149
|
+
return isqrt(variance_fx * 100) * 100 / 10000;
|
|
150
|
+
}
|
package/src/stdlib/color.mcrs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// color.mcrs — Color utilities for RedScript datapacks.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// Packed int format: 0xRRGGBB (R in bits 16-23, G in bits 8-15, B in bits 0-7)
|
|
6
|
-
// packed = R*65536 + G*256 + B
|
|
3
|
+
// Pack/unpack: RGB values 0-255, packed int 0xRRGGBB = R*65536 + G*256 + B
|
|
4
|
+
// HSL ×10000 scale: R,G,B ∈ [0,2550000], H ∈ [0,3600000], S,L ∈ [0,10000]
|
|
7
5
|
//
|
|
8
6
|
// Note: No native bitwise ops in MC scoreboard — packing/unpacking uses multiply/divide.
|
|
9
7
|
|
|
@@ -48,71 +46,14 @@ fn rgb_lerp(a: int, b: int, t: int): int {
|
|
|
48
46
|
return r * 65536 + g * 256 + bv;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
|
-
// ─── HSL
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
let sector: int = h / 60;
|
|
58
|
-
let rem: int = h % 120;
|
|
59
|
-
if (rem > 60) { rem = 120 - rem; }
|
|
60
|
-
return c * rem / 60;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
fn hsl_to_r(h: int, s: int, l: int): int {
|
|
64
|
-
let c: int = s * (1000 - (2 * l * 10 - 1000)) / 1000;
|
|
65
|
-
if (c < 0) { c = 0 - c; }
|
|
66
|
-
c = c / 10;
|
|
67
|
-
let x: int = _hsl_chroma_x(h, c);
|
|
68
|
-
let m: int = l * 255 / 100 - c / 2;
|
|
69
|
-
let sector: int = h / 60;
|
|
70
|
-
if (sector == 0) { return (c + m); }
|
|
71
|
-
if (sector == 1) { return (x + m); }
|
|
72
|
-
if (sector == 2) { return m; }
|
|
73
|
-
if (sector == 3) { return m; }
|
|
74
|
-
if (sector == 4) { return (x + m); }
|
|
75
|
-
return (c + m);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
fn hsl_to_g(h: int, s: int, l: int): int {
|
|
79
|
-
let c: int = s * (1000 - (2 * l * 10 - 1000)) / 1000;
|
|
80
|
-
if (c < 0) { c = 0 - c; }
|
|
81
|
-
c = c / 10;
|
|
82
|
-
let x: int = _hsl_chroma_x(h, c);
|
|
83
|
-
let m: int = l * 255 / 100 - c / 2;
|
|
84
|
-
let sector: int = h / 60;
|
|
85
|
-
if (sector == 0) { return (x + m); }
|
|
86
|
-
if (sector == 1) { return (c + m); }
|
|
87
|
-
if (sector == 2) { return (c + m); }
|
|
88
|
-
if (sector == 3) { return (x + m); }
|
|
89
|
-
if (sector == 4) { return m; }
|
|
90
|
-
return m;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
fn hsl_to_b(h: int, s: int, l: int): int {
|
|
94
|
-
let c: int = s * (1000 - (2 * l * 10 - 1000)) / 1000;
|
|
95
|
-
if (c < 0) { c = 0 - c; }
|
|
96
|
-
c = c / 10;
|
|
97
|
-
let x: int = _hsl_chroma_x(h, c);
|
|
98
|
-
let m: int = l * 255 / 100 - c / 2;
|
|
99
|
-
let sector: int = h / 60;
|
|
100
|
-
if (sector == 0) { return m; }
|
|
101
|
-
if (sector == 1) { return m; }
|
|
102
|
-
if (sector == 2) { return (x + m); }
|
|
103
|
-
if (sector == 3) { return (c + m); }
|
|
104
|
-
if (sector == 4) { return (c + m); }
|
|
105
|
-
return (x + m);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// hsl_to_packed(h, s, l): HSL → packed RGB int
|
|
109
|
-
fn hsl_to_packed(h: int, s: int, l: int): int {
|
|
110
|
-
return rgb_pack(hsl_to_r(h, s, l), hsl_to_g(h, s, l), hsl_to_b(h, s, l));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// ─── RGB → HSL ────────────────────────────────────────────────────────────────
|
|
49
|
+
// ─── RGB → HSL (×10000 scale) ─────────────────────────────────────────────────
|
|
50
|
+
//
|
|
51
|
+
// All values ×10000 scale:
|
|
52
|
+
// R, G, B ∈ [0, 2550000] (255 × 10000)
|
|
53
|
+
// H ∈ [0, 3600000] (360° × 10000)
|
|
54
|
+
// S, L ∈ [0, 10000] (1.0 × 10000)
|
|
114
55
|
|
|
115
|
-
// rgb_to_l(r, g, b): lightness 0
|
|
56
|
+
// rgb_to_l(r, g, b): lightness ×10000, range [0, 10000]
|
|
116
57
|
fn rgb_to_l(r: int, g: int, b: int): int {
|
|
117
58
|
let mx: int = r;
|
|
118
59
|
if (g > mx) { mx = g; }
|
|
@@ -120,10 +61,10 @@ fn rgb_to_l(r: int, g: int, b: int): int {
|
|
|
120
61
|
let mn: int = r;
|
|
121
62
|
if (g < mn) { mn = g; }
|
|
122
63
|
if (b < mn) { mn = b; }
|
|
123
|
-
return (mx + mn)
|
|
64
|
+
return (mx + mn) / 510;
|
|
124
65
|
}
|
|
125
66
|
|
|
126
|
-
// rgb_to_s(r, g, b): saturation 0
|
|
67
|
+
// rgb_to_s(r, g, b): saturation ×10000, range [0, 10000]
|
|
127
68
|
fn rgb_to_s(r: int, g: int, b: int): int {
|
|
128
69
|
let mx: int = r;
|
|
129
70
|
if (g > mx) { mx = g; }
|
|
@@ -131,14 +72,16 @@ fn rgb_to_s(r: int, g: int, b: int): int {
|
|
|
131
72
|
let mn: int = r;
|
|
132
73
|
if (g < mn) { mn = g; }
|
|
133
74
|
if (b < mn) { mn = b; }
|
|
134
|
-
let
|
|
135
|
-
if (
|
|
136
|
-
let l: int = (mx + mn)
|
|
137
|
-
|
|
138
|
-
|
|
75
|
+
let d: int = mx - mn;
|
|
76
|
+
if (d == 0) { return 0; }
|
|
77
|
+
let l: int = (mx + mn) / 510;
|
|
78
|
+
let denom: int = 2 * l;
|
|
79
|
+
if (20000 - 2 * l < denom) { denom = 20000 - 2 * l; }
|
|
80
|
+
if (denom == 0) { return 0; }
|
|
81
|
+
return d * 10000 / (255 * denom);
|
|
139
82
|
}
|
|
140
83
|
|
|
141
|
-
// rgb_to_h(r, g, b): hue 0
|
|
84
|
+
// rgb_to_h(r, g, b): hue ×10000, range [0, 3600000]
|
|
142
85
|
fn rgb_to_h(r: int, g: int, b: int): int {
|
|
143
86
|
let mx: int = r;
|
|
144
87
|
if (g > mx) { mx = g; }
|
|
@@ -146,15 +89,92 @@ fn rgb_to_h(r: int, g: int, b: int): int {
|
|
|
146
89
|
let mn: int = r;
|
|
147
90
|
if (g < mn) { mn = g; }
|
|
148
91
|
if (b < mn) { mn = b; }
|
|
149
|
-
let
|
|
150
|
-
if (
|
|
92
|
+
let d: int = mx - mn;
|
|
93
|
+
if (d == 0) { return 0; }
|
|
151
94
|
if (mx == r) {
|
|
152
|
-
let h: int =
|
|
153
|
-
if (h < 0) { h = h +
|
|
95
|
+
let h: int = 600000 * (g - b) / d;
|
|
96
|
+
if (h < 0) { h = h + 3600000; }
|
|
154
97
|
return h;
|
|
155
98
|
}
|
|
156
99
|
if (mx == g) {
|
|
157
|
-
return
|
|
100
|
+
return 1200000 + 600000 * (b - r) / d;
|
|
158
101
|
}
|
|
159
|
-
return
|
|
102
|
+
return 2400000 + 600000 * (r - g) / d;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ─── HSL → RGB (×10000 scale) ─────────────────────────────────────────────────
|
|
106
|
+
|
|
107
|
+
// _hsl10k_chroma_x: helper — X component for HSL→RGB conversion (×10000 scale)
|
|
108
|
+
// c: chroma ×10000, h: hue ×10000 [0, 3600000]
|
|
109
|
+
fn _hsl10k_chroma_x(h: int, c: int): int {
|
|
110
|
+
// X = C * (1 - |H/600000 mod 2 - 1|)
|
|
111
|
+
let rem: int = h % 1200000;
|
|
112
|
+
if (rem > 600000) { rem = 1200000 - rem; }
|
|
113
|
+
return c * rem / 600000;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// _hsl10k_chroma: chroma C = (1 - |2L-1|) * S, all ×10000
|
|
117
|
+
fn _hsl10k_chroma(s: int, l: int): int {
|
|
118
|
+
let abs2l1: int = 2 * l - 10000;
|
|
119
|
+
if (abs2l1 < 0) { abs2l1 = 0 - abs2l1; }
|
|
120
|
+
return (10000 - abs2l1) * s / 10000;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// hsl_to_r(h, s, l): H×10000, S×10000, L×10000 → R ∈ [0, 2550000]
|
|
124
|
+
fn hsl_to_r(h: int, s: int, l: int): int {
|
|
125
|
+
let c: int = _hsl10k_chroma(s, l);
|
|
126
|
+
let x: int = _hsl10k_chroma_x(h, c);
|
|
127
|
+
let m: int = l - c / 2;
|
|
128
|
+
let sector: int = h / 600000;
|
|
129
|
+
let r1: int = 0;
|
|
130
|
+
if (sector == 0) { r1 = c; }
|
|
131
|
+
if (sector == 1) { r1 = x; }
|
|
132
|
+
if (sector == 4) { r1 = x; }
|
|
133
|
+
if (sector == 5) { r1 = c; }
|
|
134
|
+
return (r1 + m) * 255;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// hsl_to_g(h, s, l): H×10000, S×10000, L×10000 → G ∈ [0, 2550000]
|
|
138
|
+
fn hsl_to_g(h: int, s: int, l: int): int {
|
|
139
|
+
let c: int = _hsl10k_chroma(s, l);
|
|
140
|
+
let x: int = _hsl10k_chroma_x(h, c);
|
|
141
|
+
let m: int = l - c / 2;
|
|
142
|
+
let sector: int = h / 600000;
|
|
143
|
+
let g1: int = 0;
|
|
144
|
+
if (sector == 0) { g1 = x; }
|
|
145
|
+
if (sector == 1) { g1 = c; }
|
|
146
|
+
if (sector == 2) { g1 = c; }
|
|
147
|
+
if (sector == 3) { g1 = x; }
|
|
148
|
+
return (g1 + m) * 255;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// hsl_to_b(h, s, l): H×10000, S×10000, L×10000 → B ∈ [0, 2550000]
|
|
152
|
+
fn hsl_to_b(h: int, s: int, l: int): int {
|
|
153
|
+
let c: int = _hsl10k_chroma(s, l);
|
|
154
|
+
let x: int = _hsl10k_chroma_x(h, c);
|
|
155
|
+
let m: int = l - c / 2;
|
|
156
|
+
let sector: int = h / 600000;
|
|
157
|
+
let b1: int = 0;
|
|
158
|
+
if (sector == 2) { b1 = x; }
|
|
159
|
+
if (sector == 3) { b1 = c; }
|
|
160
|
+
if (sector == 4) { b1 = c; }
|
|
161
|
+
if (sector == 5) { b1 = x; }
|
|
162
|
+
return (b1 + m) * 255;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// hsl_to_packed(h, s, l): HSL (×10000 scale) → packed RGB int (0xRRGGBB)
|
|
166
|
+
fn hsl_to_packed(h: int, s: int, l: int): int {
|
|
167
|
+
let r: int = hsl_to_r(h, s, l) / 10000;
|
|
168
|
+
let g: int = hsl_to_g(h, s, l) / 10000;
|
|
169
|
+
let b: int = hsl_to_b(h, s, l) / 10000;
|
|
170
|
+
return rgb_pack(r, g, b);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// ─── rgb_to_hex ───────────────────────────────────────────────────────────────
|
|
174
|
+
|
|
175
|
+
// rgb_to_hex(r, g, b): pack RGB into 0xRRGGBB integer
|
|
176
|
+
// Equivalent to rgb_pack; provided as an explicit named alias.
|
|
177
|
+
// r, g, b ∈ [0, 255]; no fixed-point — simple integer arithmetic.
|
|
178
|
+
fn rgb_to_hex(r: int, g: int, b: int): int {
|
|
179
|
+
return r * 65536 + g * 256 + b;
|
|
160
180
|
}
|
package/src/stdlib/combat.mcrs
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
+
// module library
|
|
1
2
|
// Combat helpers for simple RPG-style datapacks.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
// Returns base + bonus damage.
|
|
5
|
+
fn weapon_damage(base: int, bonus: int): int {
|
|
6
|
+
return base + bonus
|
|
5
7
|
}
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
// Applies damage to a health value, clamping to 0.
|
|
10
|
+
// Usage: let new_hp: int = take_damage(current_hp, amount)
|
|
11
|
+
// Then: scoreboard_set(player, objective, new_hp)
|
|
12
|
+
fn take_damage(health: int, amount: int): int {
|
|
13
|
+
let next: int = health - amount
|
|
14
|
+
if (next < 0) {
|
|
15
|
+
next = 0
|
|
16
|
+
}
|
|
17
|
+
return next
|
|
9
18
|
}
|
|
10
19
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (next < 0) {
|
|
16
|
-
scoreboard_set(name, #health, 0);
|
|
17
|
-
} else {
|
|
18
|
-
scoreboard_set(name, #health, next);
|
|
20
|
+
// Returns 1 if health <= 0 (dead), else 0.
|
|
21
|
+
fn is_dead(health: int): int {
|
|
22
|
+
if (health <= 0) {
|
|
23
|
+
return 1
|
|
19
24
|
}
|
|
25
|
+
return 0
|
|
20
26
|
}
|