%face to %fuss. Next change back.

This commit is contained in:
C. Guy Yarvin 2016-02-02 17:50:34 -08:00
parent 27ff65f81f
commit 0838818881
13 changed files with 244 additions and 4 deletions

View File

@ -165,6 +165,7 @@
u3_noun u3qf_core(u3_noun, u3_noun);
u3_noun u3qf_cube(u3_noun, u3_noun);
u3_noun u3qf_face(u3_noun, u3_noun);
u3_noun u3qf_fuss(u3_noun, u3_noun);
u3_noun u3qf_fine(u3_noun, u3_noun, u3_noun);
u3_noun u3qf_fitz(u3_noun, u3_noun);
u3_noun u3qf_flan(u3_noun, u3_noun);

View File

@ -195,6 +195,7 @@
u3_noun u3wf_core(u3_noun);
u3_noun u3wf_cube(u3_noun);
u3_noun u3wf_face(u3_noun);
u3_noun u3wf_fuss(u3_noun);
u3_noun u3wf_fine(u3_noun);
u3_noun u3wf_fitz(u3_noun);
u3_noun u3wf_flan(u3_noun);

View File

@ -1,4 +1,4 @@
/* j/6/face.c
/* j/6/fuss.c
**
*/
#include "all.h"
@ -13,9 +13,13 @@
if ( c3__void == tip ) {
return c3__void;
}
else return u3nt(c3__face,
else if ( c3y == u3du(sag) ) {
return u3m_bail(c3__fail);
} else {
return u3nt(c3__fuss,
u3k(sag),
u3k(tip));
}
}
u3_noun
u3wf_face(u3_noun cor)
@ -28,3 +32,28 @@
return u3qf_face(sag, tip);
}
}
/* functions
*/
u3_noun
u3qf_fuss(u3_noun sag,
u3_noun tip)
{
if ( c3__void == tip ) {
return c3__void;
}
else return u3nt(c3__fuss,
u3k(sag),
u3k(tip));
}
u3_noun
u3wf_fuss(u3_noun cor)
{
u3_noun sag, tip;
if ( c3n == u3r_mean(cor, u3x_sam_2, &sag, u3x_sam_3, &tip, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qf_fuss(sag, tip);
}
}

View File

@ -32,6 +32,9 @@
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
}
case c3__fuss: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
}
case c3__fork: p_sut = u3t(sut);
{
}

View File

@ -113,6 +113,7 @@
return ret;
}
}
case c3__fuss:
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return _burn_in(van, q_sut, gil);

View File

@ -150,6 +150,14 @@
u3z(foz);
return ret;
}
case c3__fuss: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun foz = _crop_dext(van, q_sut, ref, bix);
u3_noun ret = u3qf_fuss(p_sut, foz);
u3z(foz);
return ret;
}
case c3__fork: p_sut = u3t(sut);
{
u3_noun yed = u3qdi_tap(p_sut, u3_nul);
@ -196,6 +204,7 @@
default: return u3m_bail(c3__fail);
case c3__core:
case c3__fuss:
case c3__face: u3x_cell(u3t(ref), &p_ref, &q_ref);
{
return _crop_dext(van, sut, q_ref, bix);

View File

@ -27,6 +27,23 @@
0));
}
static u3_noun
u3qfu_fund(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun gen)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "fund");
return u3n_kick_on(u3i_molt(gat,
u3x_sam_2,
u3k(way),
u3x_sam_3,
u3k(gen),
0));
}
static u3_noun
u3qfu_fine(u3_noun van,
u3_noun sut,
@ -399,6 +416,78 @@
return ret;
}
static u3_noun
_find_buck_fuss_next(u3_noun van,
u3_noun sut,
u3_noun q_sut,
u3_noun qp_sut,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
if ( u3_nul == qp_sut ) {
u3_noun nol = u3nc(u3_nul, u3k(lon));
u3_noun ret = _find_buck(van, q_sut, way, p_heg, q_heg, axe, nol, gil);
u3z(nol);
return ret;
}
else {
u3_noun iqp_sut = u3h(qp_sut); // twig
u3_noun tiv = u3qfu_mint // (pair span nock)
(van, sut, c3__noun, iqp_sut);
u3_noun tqp_sut = u3t(qp_sut); // (list (pair span nock))
u3_noun p_tiv = u3h(tiv); // span
u3_noun q_tiv = u3t(tiv); // nock
u3_noun fid = _find_buck // pony
(van, p_tiv, way, p_heg, q_heg, 1, u3_nul, u3_nul);
if ( u3_nul == fid ) {
u3z(tiv);
return u3_nul;
}
else if ( (c3n == u3h(fid)) && (c3y == u3h(u3t(fid))) ) {
u3_noun ret;
ret = _find_buck_fuss_next
(van, sut, q_sut, tqp_sut, way, p_heg, q_heg, u3t(u3t(fid)), lon, gil);
u3z(fid);
u3z(tiv);
return ret;
}
else {
u3_noun tor; // port
u3_noun vat; // (pair span nock)
u3_noun ret;
u3_noun dog = u3nc(0, u3k(axe)); // nock
if ( c3y == u3h(fid) ) {
tor = u3k(fid);
} else {
tor = u3nc(c3n, u3k(u3t(u3t(fid))));
}
u3z(fid);
vat = u3qfu_fine(van, q_sut, tor);
u3z(tor);
ret = u3nq
(c3n,
c3n,
u3k(u3h(vat)),
u3qf_comb(u3t(vat), u3qf_comb(dog, q_tiv)));
u3z(vat);
u3z(dog);
u3z(tiv);
return ret;
}
}
}
static u3_noun
_find_buck_face_next(u3_noun van,
u3_noun q_sut,
@ -465,6 +554,95 @@
}
}
static u3_noun
_find_buck_fuss(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
u3_noun p_sut, q_sut;
u3x_cell(u3t(sut), &p_sut, &q_sut);
if ( u3_nul == q_heg ) {
return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil);
}
else {
u3_noun uq_heg = u3t(q_heg); // term
if ( c3y == u3ud(p_sut) ) {
if ( c3y == u3r_sing(p_sut, uq_heg) ) {
return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil);
}
else {
return _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
}
else {
u3_noun pp_sut = u3h(p_sut); // (map term (unit port))
u3_noun qp_sut = u3t(p_sut); // (list (pair span nock))
u3_noun tyr = u3qdb_get(pp_sut, uq_heg); // (unit (unit port))
if ( u3_nul == tyr ) {
return _find_buck_fuss_next
(van, sut, q_sut, qp_sut, way, p_heg, q_heg, axe, lon, gil);
}
else {
u3_noun u_tyr = u3t(tyr); // (unit port)
if ( u3_nul == u_tyr ) {
u3_noun nol = u3nc(u3_nul, u3k(lon));
u3_noun dep = u3qa_inc(p_heg);
u3_noun ret = _find_buck
(van, q_sut, way, dep, q_heg, axe, nol, gil);
u3z(dep);
u3z(nol);
u3z(tyr);
return ret;
}
else {
u3_noun uu_tyr = u3t(u_tyr);
u3_noun tor = u3qfu_fund(van, sut, way, uu_tyr);
if ( c3y == u3h(tor) ) {
u3_noun p_tor = u3t(tor); // (pair vein opal)
u3_noun pp_tor = u3h(p_tor); // vein
u3_noun qp_tor = u3t(p_tor); // opal
u3_noun nol = // vein
u3nt(u3_nul, u3nc(u3_nul, u3k(axe)), u3k(lon));
u3_noun ret;
ret = u3nt(c3y, u3qb_weld(pp_tor, nol), u3k(qp_tor));
u3z(nol);
u3z(tor);
u3z(tyr);
return ret;
}
else {
u3_noun p_tor = u3t(tor); // (pair span nock)
u3_noun pp_tor = u3h(p_tor); // span
u3_noun qp_tor = u3t(p_tor); // nock
u3_noun dog = u3nc(0, u3k(axe)); // nock
u3_noun ret;
ret = u3nq(c3n, c3n, u3k(pp_tor), u3qf_comb(dog, qp_tor));
u3z(dog);
u3z(tor);
u3z(tyr);
return ret;
}
}
}
}
}
}
static u3_noun
_find_buck_face(u3_noun van,
u3_noun sut,
@ -596,6 +774,11 @@
// fprintf(stderr, "face\r\n");
return _find_buck_face(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
case c3__fuss:
{
// fprintf(stderr, "face\r\n");
return _find_buck_fuss(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
case c3__fork:
{
// fprintf(stderr, "fork\r\n");

View File

@ -92,6 +92,7 @@
case c3__core: {
return u3nc(0, 0);
}
case c3__fuss:
case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);

View File

@ -132,6 +132,14 @@
u3z(vot);
return ret;
}
case c3__fuss: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun vot = _fuse_in(van, q_sut, ref, bix);
u3_noun ret = u3qf_fuss(p_sut, vot);
u3z(vot);
return ret;
}
case c3__fork: p_sut = u3t(sut);
{
u3_noun yed = u3qdi_tap(p_sut, u3_nul);

View File

@ -246,6 +246,7 @@
else return _nest_sint(van, sut, tel, ref, seg, reg, gil);
}
}
case c3__fuss:
case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
@ -409,6 +410,7 @@
u3z(gam);
return hiv;
}
case c3__fuss:
case c3__face: {
if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) {
return u3m_bail(c3__fail);

View File

@ -105,6 +105,7 @@
return pro;
}
}
case c3__fuss:
case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);

View File

@ -34,6 +34,7 @@
return u3nt(c3__cell, c3__noun, u3k(p_sut));
}
}
case c3__fuss:
case c3__face: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) {
return u3m_bail(c3__fail);

View File

@ -349,7 +349,7 @@ static u3j_harm _mood__hoon__ut_burn_a[] = {{".2", u3wfu_burn}, {}};
static u3j_harm _mood__hoon__ut_conk_a[] = {{".2", u3wfu_conk}, {}};
static u3j_harm _mood__hoon__ut_crop_a[] = {{".2", u3wfu_crop}, {}};
// static u3j_harm _mood__hoon__ut_fire_a[] = {{".2", u3wfu_fire}, {}};
// static u3j_harm _mood__hoon__ut_fond_a[] = {{".2", u3wfu_fond}, {}};
static u3j_harm _mood__hoon__ut_fond_a[] = {{".2", u3wfu_fond}, {}};
static u3j_harm _mood__hoon__ut_fish_a[] = {{".2", u3wfu_fish}, {}};
static u3j_harm _mood__hoon__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}};
static u3j_harm _mood__hoon__ut_mint_a[] = {{".2", u3wfu_mint}, {}};
@ -367,7 +367,7 @@ static u3j_core _mood__hoon__ut_d[] =
{ "burn", _mood__hoon__ut_burn_a },
{ "conk", _mood__hoon__ut_conk_a },
{ "crop", _mood__hoon__ut_crop_a },
// { "fond", _mood__hoon__ut_fond_a },
{ "fond", _mood__hoon__ut_fond_a },
// { "fire", _mood__hoon__ut_fire_a },
{ "fish", _mood__hoon__ut_fish_a },
{ "fuse", _mood__hoon__ut_fuse_a },