Coherent-cords-d, not stripped.

This commit is contained in:
C. Guy Yarvin 2017-03-26 18:31:05 -07:00
parent b24554423a
commit 2665ee9042
15 changed files with 39972 additions and 39314 deletions

View File

@ -342,6 +342,7 @@ J_Z_OFILES=\
jets/z/help.o \
jets/z/hike.o \
jets/z/look.o \
jets/z/loot.o
J_Z_OFILES_UT=\
jets/z/ut.o \

View File

@ -207,6 +207,7 @@
u3_noun u3qf_help(u3_noun, u3_noun);
u3_noun u3qf_hike(u3_noun, u3_noun);
u3_noun u3qf_look(u3_noun, u3_noun);
u3_noun u3qf_loot(u3_noun, u3_noun);
u3_noun u3qf_slot(u3_atom, u3_noun);
u3_noun u3qf_type(u3_noun);
@ -282,6 +283,7 @@
u3_noun u3qz_help(u3_noun, u3_noun);
u3_noun u3qz_hike(u3_noun, u3_noun);
u3_noun u3qz_look(u3_noun, u3_noun);
u3_noun u3qz_loot(u3_noun, u3_noun);
u3_noun u3qz_slot(u3_atom, u3_noun);
u3_noun u3qz_type(u3_noun);

View File

@ -236,6 +236,7 @@
u3_noun u3wf_help(u3_noun);
u3_noun u3wf_hike(u3_noun);
u3_noun u3wf_look(u3_noun);
u3_noun u3wf_loot(u3_noun);
u3_noun u3wfl_bunt(u3_noun);
u3_noun u3wfl_whip(u3_noun);
@ -291,6 +292,7 @@
u3_noun u3wz_help(u3_noun);
u3_noun u3wz_hike(u3_noun);
u3_noun u3wz_look(u3_noun);
u3_noun u3wz_loot(u3_noun);
u3_noun u3wzl_bunt(u3_noun);
u3_noun u3wzl_whip(u3_noun);

View File

@ -626,6 +626,7 @@ static u3j_core _146_hex_d[] =
static u3j_harm _146_pen_fork_a[] = {{".2", u3wz_fork}, {}};
static u3j_harm _146_pen_hike_a[] = {{".2", u3wz_hike}, {}};
static u3j_harm _146_pen_look_a[] = {{".2", u3wz_look}, {}};
static u3j_harm _146_pen_loot_a[] = {{".2", u3wz_loot}, {}};
static u3j_harm _146_pen__ut_burn_a[] = {{".2", u3wzu_burn}, {}};
static u3j_harm _146_pen__ut_conk_a[] = {{".2", u3wzu_conk}, {}};
@ -696,6 +697,7 @@ static u3j_core _146_pen_d[] =
{ "help", _146_pen_help_a },
{ "hike", _146_pen_hike_a },
{ "look", _146_pen_look_a },
{ "loot", _146_pen_loot_a },
// { "ap", _146_pen__ap_a },
// { "al", _146_pen__al_a },

View File

@ -109,6 +109,8 @@
}
/* functions
*/
u3_noun

133
jets/z/loot.c Normal file
View File

@ -0,0 +1,133 @@
/* j/6/loot.c
**
*/
#include "all.h"
/* internals
*/
static u3_noun
_loot_in(u3_noun cog,
u3_noun dom,
u3_atom axe)
{
if ( u3_nul == dom ) {
return u3_nul;
}
else {
u3_noun n_dom, l_dom, r_dom;
u3r_trel(dom, &n_dom, &l_dom, &r_dom);
if ( c3n == u3du(n_dom) ) {
return u3m_bail(c3__fail);
}
else {
u3_noun qqn_dom = u3t(u3t(n_dom));
u3_noun yep = u3qz_look(cog, qqn_dom);
if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) {
if ( u3_nul == yep ) {
return u3_nul;
} else {
u3_noun u_yep = u3t(yep);
u3_noun pro;
pro = u3nt(u3_nul, u3qc_peg(axe, u3h(u_yep)), u3k(u3t(u_yep)));
u3z(yep);
return pro;
}
}
else if ( (u3_nul == l_dom) ) {
if ( u3_nul == yep ) {
u3_noun nax = u3qc_peg(axe, 3);
u3_noun pro;
pro = _loot_in(cog, r_dom, nax);
u3z(nax);
return pro;
}
else {
u3_noun u_yep = u3t(yep);
u3_noun nax = u3qc_peg(axe, 2);
u3_noun pro;
pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep)));
u3z(nax);
u3z(yep);
return pro;
}
}
else if ( (u3_nul == r_dom) ) {
if ( u3_nul == yep ) {
u3_noun nax = u3qc_peg(axe, 3);
u3_noun pro;
pro = _loot_in(cog, l_dom, nax);
u3z(nax);
return pro;
}
else {
u3_noun u_yep = u3t(yep);
u3_noun nax = u3qc_peg(axe, 2);
u3_noun pro;
pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep)));
u3z(nax);
u3z(yep);
return pro;
}
}
else {
if ( u3_nul == yep ) {
u3_noun nax = u3qc_peg(axe, 6);
u3_noun pey;
pey = _loot_in(cog, l_dom, nax);
u3z(nax);
if ( u3_nul != pey ) {
return pey;
}
else {
u3_noun nax = u3qc_peg(axe, 7);
u3_noun pro;
pro = _loot_in(cog, r_dom, nax);
u3z(nax);
return pro;
}
}
else {
u3_noun u_yep = u3t(yep);
u3_noun nax = u3qc_peg(axe, 2);
u3_noun pro;
pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep)));
u3z(nax);
u3z(yep);
return pro;
}
}
}
}
}
/* functions
*/
u3_noun
u3qz_loot(u3_noun cog,
u3_noun dom)
{
return _loot_in(cog, dom, 1);
}
u3_noun
u3wz_loot(u3_noun cor)
{
u3_noun cog, dom;
if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &dom, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qz_loot(cog, dom);
}
}

View File

@ -26,7 +26,7 @@
}
case 1: {
u3_noun cok = _cqzu_conk(van, sut, u3t(u3t(got)));
u3_noun nux = u3nc(u3_nul, u3k(u3h(u3t(got))));
u3_noun nux = u3k(u3h(u3t(got)));
u3_noun ret = u3qz_face(nux, cok);
u3z(nux);

View File

@ -171,7 +171,7 @@
return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
else {
u3_noun zem = u3qz_look(u3t(q_heg), qrq_sut);
u3_noun zem = u3qz_loot(u3t(q_heg), qrq_sut);
if ( (u3_nul != zem) && (0 != p_heg) ) {
u3_noun ped;

View File

@ -181,13 +181,52 @@
}
}
static u3_noun
_mint_hope(u3_noun van,
u3_noun sut,
u3_noun dom)
{
if ( (u3_nul == dom) ) {
return 0;
}
else {
u3_noun n_dom, l_dom, r_dom;
u3r_trel(dom, &n_dom, &l_dom, &r_dom);
if ( c3n == u3du(n_dom) ) {
return u3m_bail(c3__fail);
}
else {
u3_noun qqn_dom = u3t(u3t(n_dom));
u3_noun dov;
dov = _mint_harp(van, sut, qqn_dom);
if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) {
return dov;
}
else if ( (u3_nul == l_dom) ) {
return u3nc(dov, _mint_hope(van, sut, r_dom));
}
else if ( (u3_nul == r_dom) ) {
return u3nc(dov, _mint_hope(van, sut, l_dom));
}
else {
return u3nt(dov,
_mint_hope(van, sut, l_dom),
_mint_hope(van, sut, r_dom));
}
}
}
}
static u3_noun
_mint_grow(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_atom mel,
u3_noun ruf,
u3_noun dab)
u3_noun dom)
{
u3_noun dan = _mint_in(van, sut, c3__noun, ruf);
u3_noun p_dan = u3h(dan);
@ -196,14 +235,14 @@
u3nt(c3__gold,
u3k(p_dan),
u3nc(u3_nul,
u3k(dab))));
u3_noun dez = _mint_harp(van, toc, dab);
u3k(dom))));
u3_noun dez = _mint_hope(van, toc, dom);
u3_noun zod = u3nc(1, dez);
u3_noun cot = _mint_core(u3k(p_dan),
u3nt(mel,
u3k(p_dan),
u3nc(u3k(dez),
u3k(dab))));
u3k(dom))));
u3_noun ret = u3nc(_mint_nice(van, gol, cot),
u3qz_cons(zod, q_dan));
@ -619,13 +658,7 @@
case c3__tune: p_gen = u3t(gen);
_mint_used();
{
u3_noun nux = u3nc(u3_nul, u3k(p_gen));
u3_noun pro;
pro = u3nc(u3qz_face(nux, sut), u3nc(0, 1));
u3z(nux);
return pro;
return u3nc(u3qz_face(p_gen, sut), u3nc(0, 1));
}
case c3__burn: p_gen = u3t(gen);

View File

@ -131,6 +131,41 @@
}
}
static void
_mull_balk(u3_noun van,
u3_noun sut,
u3_noun dox,
u3_noun dom)
{
if ( u3_nul != dom ) {
u3_noun n_dom, l_dom, r_dom;
u3r_trel(dom, &n_dom, &l_dom, &r_dom);
if ( c3n == u3du(n_dom) ) {
u3m_bail(c3__fail);
}
else {
u3_noun qqn_dom = u3t(u3t(n_dom));
_mull_bake(van, sut, dox, qqn_dom);
if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) {
return;
}
else if ( (u3_nul == l_dom) ) {
_mull_balk(van, sut, dox, r_dom);
}
else if ( (u3_nul == r_dom) ) {
_mull_balk(van, sut, dox, l_dom);
}
else {
_mull_balk(van, sut, dox, l_dom);
_mull_balk(van, sut, dox, r_dom);
}
}
}
}
static u3_noun
_mull_grow(u3_noun van,
u3_noun sut,
@ -138,7 +173,7 @@
u3_noun dox,
u3_atom mel,
u3_noun ruf,
u3_noun dab)
u3_noun dom)
{
u3_noun dan = _mull_in(van, sut, c3__noun, dox, ruf);
u3_noun p_dan = u3h(dan);
@ -146,24 +181,24 @@
u3_noun p_toc = _mull_core(u3k(p_dan),
u3nt(c3__gold,
u3k(p_dan),
u3nc(u3_nul, u3k(dab))));
u3nc(u3_nul, u3k(dom))));
u3_noun q_toc = _mull_core(u3k(q_dan),
u3nt(c3__gold,
u3k(q_dan),
u3nc(u3_nul, u3k(dab))));
u3nc(u3_nul, u3k(dom))));
u3_noun p_ret = _mull_core(u3k(p_dan),
u3nt(u3k(mel),
u3k(p_dan),
u3nc(u3nc(u3_nul, u3_nul),
u3k(dab))));
u3k(dom))));
u3_noun q_ret = _mull_core(u3k(q_dan),
u3nt(u3k(mel),
u3k(q_dan),
u3nc(u3nc(u3_nul, u3_nul),
u3k(dab))));
u3k(dom))));
u3_noun ret = u3nc(_mull_nice(van, gol, p_ret), q_ret);
_mull_bake(van, p_toc, q_toc, dab);
_mull_balk(van, p_toc, q_toc, dom);
u3z(q_toc);
u3z(p_toc);
@ -585,14 +620,8 @@
case c3__tune: p_gen = u3t(gen);
_mull_used();
{
u3_noun nux = u3nc(u3_nul, u3k(p_gen));
u3_noun pro;
pro = u3nc(u3qz_face(nux, sut),
u3qz_face(nux, dox));
u3z(nux);
return pro;
return u3nc(u3qz_face(p_gen, sut),
u3qz_face(p_gen, dox));
}
case c3__burn: p_gen = u3t(gen);

View File

@ -13,7 +13,7 @@
_nest_dext(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun
_nest_clip(u3_noun van,
_nest_deep(u3_noun van,
u3_noun sut,
u3_noun tel,
u3_noun ref,
@ -33,8 +33,8 @@
u3x_trel(dab, &n_dab, &l_dab, &r_dab);
u3x_trel(hem, &n_hem, &l_hem, &r_hem);
if ( (c3n == _nest_clip(van, sut, tel, ref, l_dab, l_hem, gil)) ||
(c3n == _nest_clip(van, sut, tel, ref, r_dab, r_hem, gil)) )
if ( (c3n == _nest_deep(van, sut, tel, ref, l_dab, l_hem, gil)) ||
(c3n == _nest_deep(van, sut, tel, ref, r_dab, r_hem, gil)) )
{
return c3n;
}
@ -73,6 +73,43 @@
}
}
static u3_noun
_nest_dope(u3_noun van,
u3_noun sut,
u3_noun tel,
u3_noun ref,
u3_noun dom,
u3_noun vim,
u3_noun gil)
{
if ( u3_nul == dom ) {
return u3r_sing(u3_nul, vim);
} else if ( u3_nul == vim ) {
return c3n;
} else {
u3_noun n_dom, l_dom, r_dom;
u3_noun n_vim, l_vim, r_vim;
u3_noun pn_vim, pqn_vim, qqn_vim, pn_dom, pqn_dom, qqn_dom;
u3x_trel(dom, &n_dom, &l_dom, &r_dom);
u3x_trel(vim, &n_vim, &l_vim, &r_vim);
if ( (c3n == _nest_dope(van, sut, tel, ref, l_dom, l_vim, gil)) ||
(c3n == _nest_dope(van, sut, tel, ref, r_dom, r_vim, gil)) )
{
return c3n;
}
u3x_trel(n_dom, &pn_dom, &pqn_dom, &qqn_dom);
u3x_trel(n_vim, &pn_vim, &pqn_vim, &qqn_vim);
if ( c3n == u3r_sing(pn_dom, pn_vim) ) {
return c3n;
} else {
return _nest_deep(van, sut, tel, ref, qqn_dom, qqn_vim, gil);
}
}
}
static u3_noun
_nest_cong(u3_noun van,
u3_noun sut,
@ -134,7 +171,7 @@
u3nc(c3__gold,
u3k(u3t(q_ref))));
ret = _nest_clip(van, tus, tel, fer, qrq_sut, qrq_ref, zoc);
ret = _nest_dope(van, tus, tel, fer, qrq_sut, qrq_ref, zoc);
u3z(fer);
u3z(tus);
u3z(zoc);

View File

@ -364,13 +364,7 @@
case c3__tune: p_gen = u3t(gen);
_play_used();
{
u3_noun nux = u3nc(u3_nul, u3k(p_gen));
u3_noun pro;
pro = u3qz_face(nux, sut);
u3z(nux);
return pro;
return u3qz_face(p_gen, sut);
}
case c3__burn: p_gen = u3t(gen);

View File

@ -583,6 +583,10 @@ u3m_bail(u3_noun how)
abort();
}
if ( c3__fail == how ) {
abort();
}
#ifdef U3_PRINT_WATERMARK
if ( c3__meme == how ) {
fprintf(stderr, "u3R %p, parent %x\n", u3R, u3R->par_p);

78967
vere/ivory.c

File diff suppressed because it is too large Load Diff

View File

@ -224,7 +224,9 @@ _king_boot(u3_noun boot)
sys_c = u3r_string(sys_n);
u3z(sys_n);
fprintf(stderr, "boot %s %s\r\n", pax_c, sys_c);
if ( pax_c ) {
fprintf(stderr, "boot %s %s\r\n", pax_c, sys_c);
}
u3_pier_boot(pax_c, sys_c, pep_u);
}