2013-09-29 00:21:18 +04:00
|
|
|
/* j/6/flip.c
|
|
|
|
**
|
|
|
|
** This file is in the public domain.
|
|
|
|
*/
|
|
|
|
#include "all.h"
|
|
|
|
#include "../pit.h"
|
|
|
|
|
|
|
|
/* functions
|
|
|
|
*/
|
|
|
|
u2_noun // transfer
|
2014-04-22 05:22:11 +04:00
|
|
|
j2_mby(Pt6, flip)(u2_wire wir_r,
|
2013-09-29 00:21:18 +04:00
|
|
|
u2_noun hel) // retain
|
|
|
|
{
|
|
|
|
if ( u2_yes == u2_sing(u2_nock_1, u2_h(hel)) ) {
|
|
|
|
if ( (u2_yes == u2_t(hel)) ) {
|
|
|
|
return u2_bc(wir_r, u2_nock_1, u2_no);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
c3_assert((u2_no == u2_t(hel)));
|
|
|
|
|
|
|
|
return u2_bc(wir_r, u2_nock_1, u2_yes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return u2_bq
|
2014-04-22 05:22:11 +04:00
|
|
|
(wir_r, u2_nock_6,
|
2013-09-29 00:21:18 +04:00
|
|
|
u2_rx(wir_r, hel),
|
2014-04-22 05:22:11 +04:00
|
|
|
u2_bc(wir_r, u2_nock_1, u2_no),
|
2013-09-29 00:21:18 +04:00
|
|
|
u2_bc(wir_r, u2_nock_1, u2_yes));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
u2_noun // transfer
|
2014-04-22 05:22:11 +04:00
|
|
|
j2_mb(Pt6, flip)(u2_wire wir_r,
|
2013-09-29 00:21:18 +04:00
|
|
|
u2_noun cor) // retain
|
|
|
|
{
|
|
|
|
u2_noun hel;
|
|
|
|
|
|
|
|
if ( u2_none == (hel = u2_frag(u2_cv_sam, cor)) ) {
|
|
|
|
return u2_bl_bail(wir_r, c3__fail);
|
|
|
|
} else {
|
|
|
|
return j2_mby(Pt6, flip)(wir_r, hel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* structures
|
|
|
|
*/
|
2014-04-22 05:22:11 +04:00
|
|
|
u2_ho_jet
|
2013-09-29 00:21:18 +04:00
|
|
|
j2_mbj(Pt6, flip)[] = {
|
|
|
|
{ ".2", c3__hevy, j2_mb(Pt6, flip), Tier6_a, u2_none, u2_none },
|
|
|
|
{ }
|
|
|
|
};
|