Frog jets installed; still not generating frogs.

This commit is contained in:
C. Guy Yarvin 2016-01-10 16:27:36 -08:00
parent 05c2ec8a01
commit 921aef5e29
11 changed files with 191 additions and 2 deletions

View File

@ -407,6 +407,7 @@
# define c3__frez c3_s4('f','r','e','z')
# define c3__frit c3_s4('f','r','i','t')
# define c3__from c3_s4('f','r','o','m')
# define c3__frog c3_s4('f','r','o','g')
# define c3__fron c3_s4('f','r','o','n')
# define c3__fry c3_s3('f','r','y')
# define c3__fuge c3_s4('f','u','g','e')

View File

@ -172,6 +172,7 @@
u3_noun u3qf_flip(u3_noun);
u3_noun u3qf_flor(u3_noun, u3_noun);
u3_noun u3qf_fork(u3_noun, u3_noun);
u3_noun u3qf_frog(u3_noun);
u3_noun u3qf_hike(u3_noun, u3_noun);
u3_noun u3qf_look(u3_noun, u3_noun);
u3_noun u3qf_slot(u3_atom, u3_noun);

View File

@ -201,6 +201,7 @@
u3_noun u3wf_flip(u3_noun);
u3_noun u3wf_flor(u3_noun);
u3_noun u3wf_fork(u3_noun);
u3_noun u3wf_frog(u3_noun);
u3_noun u3wf_hike(u3_noun);
u3_noun u3wf_look(u3_noun);

View File

@ -33,3 +33,31 @@
return u3qf_fork(hoz, bur);
}
}
u3_noun
u3qf_frog(u3_noun yed)
{
u3_noun lez = u3_nul;
while ( u3_nul != yed ) {
u3_noun i_yed = u3h(yed);
if ( c3__void != i_yed ) {
lez = u3kdi_put(lez, u3k(u3h(yed)));
}
yed = u3t(yed);
}
if ( u3_nul == lez ) {
return c3__void;
}
else if ( (u3_nul == u3h(u3t(lez))) && (u3_nul == u3t(u3t(lez))) ) {
u3_noun ret = u3k(u3h(lez));
u3z(lez);
return ret;
}
else {
return u3nc(c3__frog, u3kdi_tap(lez, u3_nul));
}
}

View File

@ -54,6 +54,10 @@
{
return _burn_in(van, p_sut, gil);
}
case c3__frog: p_sut = u3t(sut);
{
return _burn_in(van, u3h(p_sut), gil);
}
case c3__hold: p_sut = u3t(sut);
{
if ( (c3y == u3qdi_has(gil, sut)) ) {

View File

@ -34,6 +34,32 @@
}
}
static u3_noun
_crop_dext_frog(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix)
{
if ( u3_nul == p_sut ) {
return u3_nul;
}
else {
return u3nc(_crop_dext(van, u3h(p_sut), ref, bix),
_crop_dext_frog(van, u3t(p_sut), ref, bix));
}
}
static u3_noun
_crop_sint_frog(u3_noun van, u3_noun sut, u3_noun p_ref, u3_noun bix)
{
if ( u3_nul == p_ref ) {
return u3k(sut);
}
else {
u3_noun tuz = _crop_dext(van, sut, u3h(p_ref), bix);
u3_noun zat = _crop_sint_frog(van, tuz, u3t(p_ref), bix);
u3z(tuz);
return zat;
}
}
static u3_noun
_crop_dext(u3_noun van,
u3_noun sut,
@ -135,6 +161,11 @@
u3z(dat);
return ret;
}
case c3__frog: p_sut = u3t(sut);
{
return u3qf_frog(_crop_dext_frog(van, p_sut, ref, bix));
}
case c3__hold: p_sut = u3t(sut);
{
u3_noun hud = u3nc(u3k(sut), u3k(ref));
@ -185,6 +216,10 @@
u3z(hin);
return ret;
}
case c3__frog: p_ref = u3t(ref);
{
return _crop_sint_frog(van, sut, p_ref, bix);
}
case c3__hold: p_ref = u3t(ref);
{
u3_noun rep = u3qfu_repo(van, ref);

View File

@ -6,6 +6,30 @@
/* functions
*/
static u3_noun
_fish_in(u3_noun, u3_noun, u3_atom, u3_noun);
static u3_noun
_fish_frog(u3_noun van,
u3_noun p_sut,
u3_atom axe,
u3_noun vit)
{
if ( u3_nul == p_sut ) {
return u3nc(1, 1);
}
else {
u3_noun hed = _fish_in(van, u3h(p_sut), axe, vit);
u3_noun tal = _fish_frog(van, u3t(p_sut), axe, vit);
u3_noun pro = u3qf_flor(hed, tal);
u3z(hed);
u3z(tal);
return pro;
}
}
static u3_noun
_fish_in(u3_noun van,
u3_noun sut,
@ -91,6 +115,10 @@
return pro;
}
}
case c3__frog: {
p_sut = u3t(sut);
return _fish_frog(van, p_sut, axe, vit);
}
case c3__hold: {
p_sut = u3t(sut);
{

View File

@ -32,6 +32,18 @@
}
}
static u3_noun
_fuse_in_frog(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix)
{
if ( u3_nul == p_sut ) {
return u3_nul;
}
else {
return u3nc(_fuse_in(van, u3h(p_sut), ref, bix),
_fuse_in_frog(van, u3t(p_sut), ref, bix));
}
}
static u3_noun
_fuse_in(u3_noun van,
u3_noun sut,
@ -131,6 +143,10 @@
u3z(dat);
return ret;
}
case c3__frog: p_sut = u3t(sut);
{
return _fuse_in_frog(van, p_sut, ref, bix);
}
case c3__hold: p_sut = u3t(sut);
{
u3_noun hud = u3nc(u3k(sut), u3k(ref));

View File

@ -278,6 +278,32 @@
_nest_dext(van, q_sut, c3n, ref, seg, reg, gil));
}
}
case c3__frog: p_sut = u3t(sut);
{
if ( c3n == u3du(ref) ) switch ( ref ) {
default: return _nest_sint(van, sut, tel, ref, seg, reg, gil);
case c3__noun:
break;
}
else switch ( u3h(ref) ) {
default: return _nest_sint(van, sut, tel, ref, seg, reg, gil);
case c3__atom:
case c3__cell:
case c3__core:
break;
}
while ( u3_nul != p_sut ) {
if ( c3y == _nest_dext(van, u3h(p_sut), c3n, ref, seg, reg, gil) ) {
return c3y;
} else {
p_sut = u3t(p_sut);
}
}
return c3n;
}
case c3__hold: p_sut = u3t(sut);
{
if ( c3y == u3qdi_has(seg, sut) ) {
@ -405,11 +431,23 @@
}
case c3__fork: {
if ( (c3y == u3r_mean(ref, 6, &p_ref, 7, &q_ref, 0)) ) {
return c3a(_nest_dext(van, sut, c3n, p_ref, seg, reg, gil),
_nest_dext(van, sut, c3n, q_ref, seg, reg, gil));
return c3a(_nest_dext(van, sut, tel, p_ref, seg, reg, gil),
_nest_dext(van, sut, tel, q_ref, seg, reg, gil));
}
else return u3m_bail(c3__fail);
}
case c3__frog: {
p_ref = u3t(ref);
while ( u3_nul != p_ref ) {
if ( c3n == _nest_dext(van, sut, c3n, u3h(p_ref), seg, reg, gil) ) {
return c3n;
} else {
p_ref = u3t(p_ref);
}
}
return c3y;
}
case c3__hold: {
if ( c3y == u3qdi_has(reg, ref) ) {
return c3y;

View File

@ -9,6 +9,21 @@
u3_noun
_cqfu_peek(u3_noun, u3_noun, u3_noun, u3_atom);
static u3_noun
_peek_in(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun);
static u3_noun
_peek_frog(u3_noun van, u3_noun p_sut, u3_noun way, u3_noun axe, u3_noun gil)
{
if ( u3_nul == p_sut ) {
return u3_nul;
}
else {
return u3nc(_peek_in(van, u3h(p_sut), way, axe, gil),
_peek_frog(van, u3t(p_sut), way, axe, gil));
}
}
static u3_noun
_peek_in(u3_noun van,
u3_noun sut,
@ -112,6 +127,11 @@
return pro;
}
}
case c3__frog: {
p_sut = u3t(sut);
return _peek_frog(van, p_sut, way, axe, gil);
}
case c3__hold: {
p_sut = u3t(sut);
if ( (c3y == u3qdi_has(gil, sut)) ) {

View File

@ -3,6 +3,19 @@
*/
#include "all.h"
static u3_noun _cqfu_wrap(u3_noun, u3_noun, u3_noun);
static u3_noun
_wrap_frog(u3_noun van, u3_noun p_sut, u3_noun yoz)
{
if ( u3_nul == p_sut ) {
return u3_nul;
}
else {
return u3nc(_cqfu_wrap(van, u3h(p_sut), yoz),
_wrap_frog(van, u3t(p_sut), yoz));
}
}
static u3_noun
_cqfu_wrap(u3_noun van,
@ -40,6 +53,10 @@
return u3qf_fork(_cqfu_wrap(van, p_sut, yoz),
_cqfu_wrap(van, q_sut, yoz));
}
case c3__frog: p_sut = u3t(sut);
{
return u3qf_frog(_wrap_frog(van, p_sut, yoz));
}
case c3__hold:
{
u3_noun fop = u3qfu_repo(van, sut);