diff options
author | polwex <polwex@sortug.com> | 2025-10-05 21:56:51 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-10-05 21:56:51 +0700 |
commit | fcedfddf00b3f994e4f4e40332ac7fc192c63244 (patch) | |
tree | 51d38e62c7bdfcc5f9a5e9435fe820c93cfc9a3d /vere/pkg/noun/jets/f/comb.c |
claude is gud
Diffstat (limited to 'vere/pkg/noun/jets/f/comb.c')
-rw-r--r-- | vere/pkg/noun/jets/f/comb.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/vere/pkg/noun/jets/f/comb.c b/vere/pkg/noun/jets/f/comb.c new file mode 100644 index 0000000..1dfe794 --- /dev/null +++ b/vere/pkg/noun/jets/f/comb.c @@ -0,0 +1,70 @@ +/// @file + +#include "jets/q.h" +#include "jets/w.h" + +#include "noun.h" + + + u3_noun + u3qf_comb(u3_noun mal, + u3_noun buz) + { + if ( (u3_none == mal) || (u3_none == buz) ) { + return u3_none; + } + else { + u3_noun p_mal, q_mal, p_buz, q_buz, pp_buz, pq_buz; + + if ( (c3y == u3r_p(mal, 0, &p_mal)) && (0 != p_mal) ) { + if ( (c3y == u3r_p(buz, 0, &p_buz)) && (0 != p_buz) ) { + return u3nc(0, + u3qc_peg(p_mal, p_buz)); + } + else if ( c3y == u3r_pq(buz, 2, &p_buz, &q_buz) && + c3y == u3r_p(p_buz, 0, &pp_buz) && + c3y == u3r_p(q_buz, 0, &pq_buz) ) + { + return u3nt(2, + u3nc(0, + u3qc_peg(p_mal, pp_buz)), + u3nc(0, + u3qc_peg(p_mal, pq_buz))); + } + else return u3nt(7, + u3k(mal), + u3k(buz)); + } +#if 1 + else if ( (c3y == u3r_bush(mal, &p_mal, &q_mal)) && + (c3y == u3du(p_mal)) && + (c3y == u3du(q_mal)) && + (0 == u3h(q_mal)) && + (1 == u3t(q_mal)) ) + { + return u3nt(8, + u3k(p_mal), + u3k(buz)); + } +#endif + else if ( (c3y == u3r_p(buz, 0, &p_buz)) && + (c3y == u3r_sing(1, p_buz)) ) + { + return u3k(mal); + } + else return u3nt(7, + u3k(mal), + u3k(buz)); + } + } + u3_noun + u3wf_comb(u3_noun cor) + { + u3_noun mal, buz; + + if ( c3n == u3r_mean(cor, u3x_sam_2, &mal, u3x_sam_3, &buz, 0) ) { + return u3_none; + } else { + return u3qf_comb(mal, buz); + } + } |