42 lines
751 B
Plaintext
42 lines
751 B
Plaintext
$ENTRY Go {
|
|
= <Prout <Gen 30 All Pow3 (1)>>
|
|
<Prout <Gen 30 Evil Iota (0)>>
|
|
<Prout <Gen 30 Odious Iota (0)>>;
|
|
};
|
|
|
|
Gen {
|
|
0 s.Fil s.Gen (s.State) = ;
|
|
s.N s.Fil s.Gen (s.State),
|
|
<Mu s.Gen s.State>: (s.Next) s.Item,
|
|
<Mu s.Fil s.Item>: {
|
|
T = s.Item <Gen <- s.N 1> s.Fil s.Gen (s.Next)>;
|
|
F = <Gen s.N s.Fil s.Gen (s.Next)>;
|
|
};
|
|
};
|
|
|
|
Popcount {
|
|
0 = 0;
|
|
s.N, <Divmod s.N 2>: (s.R) s.B = <+ s.B <Popcount s.R>>;
|
|
};
|
|
|
|
Pow3 {
|
|
s.N = (<* 3 s.N>) <Popcount s.N>;
|
|
};
|
|
|
|
Evil {
|
|
s.N, <Mod <Popcount s.N> 2>: {
|
|
0 = T;
|
|
1 = F;
|
|
};
|
|
};
|
|
|
|
Odious {
|
|
s.N, <Mod <Popcount s.N> 2>: {
|
|
0 = F;
|
|
1 = T;
|
|
};
|
|
};
|
|
|
|
All { s.X = T; }
|
|
Iota { s.N = (<+ 1 s.N>) s.N; }
|