ktts evolution complete.

This commit is contained in:
C. Guy Yarvin 2013-12-20 17:02:26 -08:00
parent b4ee7e4916
commit 6198be7529
5 changed files with 11 additions and 135 deletions

View File

@ -12,42 +12,6 @@
u2_noun van, // retain
u2_noun sut, // retain
u2_noun got) // retain
{
if ( u2_yes == u2ud(got) ) {
return j2_mby(Pt6, face)(wir_r, got, sut);
}
else {
u2_bean vet = u2_frag(j2_ut_van_vet, van);
u2_noun hed, tal, ret;
if ( u2_yes == vet ) {
u2_noun cel = u2nt(c3__cell, c3__noun, c3__noun);
if ( u2_no == j2_mcy(Pt6, ut, nest)(wir_r, van, cel, u2_yes, sut) ) {
return u2_bl_bail(wir_r, c3__fail);
}
u2z(cel);
}
hed = j2_mcy(Pt6, ut, peek)(wir_r, van, sut, c3__both, 2);
tal = j2_mcy(Pt6, ut, peek)(wir_r, van, sut, c3__both, 3);
ret = j2_mby(Pt6, cell)
(wir_r,
j2_mcx(Pt6, ut, conk)(wir_r, van, hed, u2h(got)),
j2_mcx(Pt6, ut, conk)(wir_r, van, tal, u2t(got)));
u2z(hed);
u2z(tal);
return ret;
}
}
u2_bean // transfer
j2_mcx(Pt6, ut, conq)(u2_wire wir_r,
u2_noun van, // retain
u2_noun sut, // retain
u2_noun got) // retain
{
if ( u2_yes == u2ud(got) ) {
return j2_mby(Pt6, face)(wir_r, got, sut);
@ -61,7 +25,7 @@
case 1: {
return j2_mby(Pt6, face)
(wir_r, u2h(u2t(got)),
j2_mcx(Pt6, ut, conq)(wir_r, van, sut, u2t(u2t(got))));
j2_mcx(Pt6, ut, conk)(wir_r, van, sut, u2t(u2t(got))));
}
case 2: {
u2_bean vet = u2_frag(j2_ut_van_vet, van);
@ -80,8 +44,8 @@
ret = j2_mby(Pt6, cell)
(wir_r,
j2_mcx(Pt6, ut, conq)(wir_r, van, hed, u2h(u2t(got))),
j2_mcx(Pt6, ut, conq)(wir_r, van, tal, u2t(u2t(got))));
j2_mcx(Pt6, ut, conk)(wir_r, van, hed, u2h(u2t(got))),
j2_mcx(Pt6, ut, conk)(wir_r, van, tal, u2t(u2t(got))));
u2z(hed);
u2z(tal);
@ -96,9 +60,6 @@
u2_ho_jet
j2_mcj(Pt6, ut, conk)[];
u2_ho_jet
j2_mcj(Pt6, ut, conq)[];
u2_noun // transfer
j2_mc(Pt6, ut, conk)(u2_wire wir_r,
u2_noun cor) // retain
@ -116,23 +77,6 @@
}
}
u2_noun // transfer
j2_mc(Pt6, ut, conq)(u2_wire wir_r,
u2_noun cor) // retain
{
u2_noun sut, got, van;
if ( (u2_no == u2_mean(cor, u2_cv_sam, &got,
u2_cv_con, &van,
0)) ||
(u2_none == (sut = u2_frag(u2_cv_sam, van))) )
{
return u2_bl_bail(wir_r, c3__fail);
} else {
return j2_mcx(Pt6, ut, conq)(wir_r, van, sut, got);
}
}
u2_bean
j2_mci(Pt6, ut, conk)(u2_wire wir_r,
u2_noun van, // retain
@ -162,35 +106,6 @@
}
}
u2_bean
j2_mci(Pt6, ut, conq)(u2_wire wir_r,
u2_noun van, // retain
u2_noun sut, // retain
u2_noun got) // retain
{
u2_weak hoc = u2_ds_look(wir_r, van, "conq");
if ( u2_none == hoc ) {
c3_assert(!"register conq");
return u2_none;
} else {
u2_weak von = u2_rl_molt(wir_r, van, u2_cv_sam, u2_rx(wir_r, sut), 0);
u2_weak gat = u2_nk_soft(wir_r, von, hoc);
u2_weak cor = u2_rl_molt(wir_r, gat,
u2_cv_sam, u2_rx(wir_r, got),
0);
if ( (u2_none == j2_mcj(Pt6, ut, conq)[0].xip) ) {
u2_noun xip = u2_ds_find(wir_r, cor);
c3_assert(u2_none != xip);
j2_mcj(Pt6, ut, conq)[0].xip = xip;
}
u2_rl_lose(wir_r, gat);
return cor;
}
}
u2_noun // transfer
j2_mcy(Pt6, ut, conk)(u2_wire wir_r,
u2_noun van, // retain
@ -218,33 +133,6 @@
}
}
u2_noun // transfer
j2_mcy(Pt6, ut, conq)(u2_wire wir_r,
u2_noun van, // retain
u2_noun sut, // retain
u2_noun got) // retain
{
u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, conq)[0];
if ( jet_j->sat_s == u2_jet_live ) {
return j2_mcx(Pt6, ut, conq)(wir_r, van, sut, got);
}
else {
u2_noun cor, fol, pro;
cor = j2_mci(Pt6, ut, conq)(wir_r, van, sut, got);
fol = u2_h(cor);
pro = u2_ho_use(wir_r, jet_j, cor, fol);
if ( u2_none == pro ) return u2_bl_bail(wir_r, c3__fail);
u2_rz(wir_r, cor);
u2_rz(wir_r, fol);
return pro;
}
}
/* structures
*/
u2_ho_jet
@ -253,9 +141,3 @@
{ }
};
u2_ho_jet
j2_mcj(Pt6, ut, conq)[] = {
{ ".2", c3__hevy, j2_mc(Pt6, ut, conq), Tier6_b, u2_none, u2_none },
{ }
};

View File

@ -599,7 +599,7 @@
ret = u2_bc
(wir_r,
j2_mcy(Pt6, ut, conq)(wir_r, van, u2h(vat), p_gen),
j2_mcy(Pt6, ut, conk)(wir_r, van, u2h(vat), p_gen),
u2_rx(wir_r, u2_t(vat)));
u2_rl_lose(wir_r, vat);
@ -612,7 +612,7 @@
ret = u2_bc
(wir_r,
j2_mcy(Pt6, ut, conq)(wir_r, van, u2h(vat), p_gen),
j2_mcy(Pt6, ut, conk)(wir_r, van, u2h(vat), p_gen),
u2_rx(wir_r, u2_t(vat)));
u2_rl_lose(wir_r, vat);

View File

@ -566,8 +566,8 @@
u2_noun vat = _mull_in(wir_r, van, sut, gol, dox, q_gen);
u2_noun ret =
u2_bc(wir_r,
j2_mcy(Pt6, ut, conq)(wir_r, van, u2_h(vat), p_gen),
j2_mcy(Pt6, ut, conq)(wir_r, van, u2_t(vat), p_gen));
j2_mcy(Pt6, ut, conk)(wir_r, van, u2_h(vat), p_gen),
j2_mcy(Pt6, ut, conk)(wir_r, van, u2_t(vat), p_gen));
u2_rz(wir_r, vat);
return ret;
@ -578,8 +578,8 @@
u2_noun vat = _mull_in(wir_r, van, sut, gol, dox, q_gen);
u2_noun ret =
u2_bc(wir_r,
j2_mcy(Pt6, ut, conq)(wir_r, van, u2_h(vat), p_gen),
j2_mcy(Pt6, ut, conq)(wir_r, van, u2_t(vat), p_gen));
j2_mcy(Pt6, ut, conk)(wir_r, van, u2_h(vat), p_gen),
j2_mcy(Pt6, ut, conk)(wir_r, van, u2_t(vat), p_gen));
u2_rz(wir_r, vat);
return ret;

View File

@ -307,7 +307,7 @@
_play_used(wir_r);
{
u2_noun boc = _play_x(wir_r, van, sut, q_gen);
u2_noun ret = j2_mcy(Pt6, ut, conq)(wir_r, van, boc, p_gen);
u2_noun ret = j2_mcy(Pt6, ut, conk)(wir_r, van, boc, p_gen);
u2_rz(wir_r, boc);
return ret;
@ -316,7 +316,7 @@
_play_used(wir_r);
{
u2_noun boc = _play_x(wir_r, van, sut, q_gen);
u2_noun ret = j2_mcy(Pt6, ut, conq)(wir_r, van, boc, p_gen);
u2_noun ret = j2_mcy(Pt6, ut, conk)(wir_r, van, boc, p_gen);
u2_rz(wir_r, boc);
return ret;

View File

@ -464,12 +464,6 @@
u2_noun sut, // retain
u2_noun got); // retain
u2_noun // transfer
j2_mcy(Pt6, ut, conq)(u2_wire wir_r,
u2_noun van, // retain
u2_noun sut, // retain
u2_noun got); // retain
u2_noun // transfer
j2_mcy(Pt6, ut, crop)(u2_wire wir_r,
u2_noun van, // retain