Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,44 @@
#include <order/interpreter.h>
#define ORDER_PP_DEF_8hail ORDER_PP_FN( \
8fn(8N, 8cond((8equal(8N, 1), 1) \
(8is_0(8remainder(8N, 2)), 8quotient(8N, 2)) \
(8else, 8inc(8times(8N, 3))))) )
#define ORDER_PP_DEF_8h_loop ORDER_PP_FN( \
8fn(8S, \
8let((8F, 8fn(8E, 8env_ref(8(8H), 8E))), \
8do( \
8print(8seq_to_tuple(8seq_map(8F, 8S)) 8space), \
8let((8S, 8h_once(8S)), \
8if(8equal(1, \
8seq_fold(8times, 1, 8seq_map(8F, 8S))), \
8print_counts(8S), \
8h_loop(8S)))))) )
#define ORDER_PP_DEF_8h_once ORDER_PP_FN( \
8fn(8S, \
8seq_map( \
8fn(8E, \
8eval(8E, \
8quote( \
8env_bind(8(8C), \
8env_bind(8(8H), \
8env_bind(8(8E), 8E, 8E), \
8hail(8H)), \
8if(8equal(8H, 1), 8C, 8inc(8C))) ))), \
8S)) )
#define ORDER_PP_DEF_8print_counts ORDER_PP_FN( \
8fn(8S, \
8print(8space 8(Counts:) \
8seq_to_tuple(8seq_map(8fn(8E, 8env_ref(8(8C), 8E)), 8S)))) )
ORDER_PP(
8let((8S, // Build a list of environments
8seq_map(8fn(8N, 8seq_of_pairs_to_env(
8seq(8pair(8(8H), 8N), 8pair(8(8C), 0),
8pair(8(8E), 8env_nil)))),
8seq_iota(1, 13))),
8h_loop(8S))
)

View file

@ -0,0 +1 @@
(1,2,3,4,5,6,7,8,9,10,11,12) (1,1,10,2,16,3,22,4,28,5,34,6) (1,1,5,1,8,10,11,2,14,16,17,3) (1,1,16,1,4,5,34,1,7,8,52,10) (1,1,8,1,2,16,17,1,22,4,26,5) (1,1,4,1,1,8,52,1,11,2,13,16) (1,1,2,1,1,4,26,1,34,1,40,8) (1,1,1,1,1,2,13,1,17,1,20,4) (1,1,1,1,1,1,40,1,52,1,10,2) (1,1,1,1,1,1,20,1,26,1,5,1) (1,1,1,1,1,1,10,1,13,1,16,1) (1,1,1,1,1,1,5,1,40,1,8,1) (1,1,1,1,1,1,16,1,20,1,4,1) (1,1,1,1,1,1,8,1,10,1,2,1) (1,1,1,1,1,1,4,1,5,1,1,1) (1,1,1,1,1,1,2,1,16,1,1,1) (1,1,1,1,1,1,1,1,8,1,1,1) (1,1,1,1,1,1,1,1,4,1,1,1) (1,1,1,1,1,1,1,1,2,1,1,1) Counts:(0,1,7,2,5,8,16,3,19,6,14,9)