OK, turing.

<- leave blank

Wed May 16 13:50:16 EDT 2018

#!/bin/awk -f
BEGIN {
	phases = 32;
	steps = 70;

	printf "bit step[%d], yield[%d];\n", phases, phases
	printf "step=-1;\n"
	printf "assume step != 0 && yield != 0;\n"
	printf "bit cany, canuv, yp[5], uvp[5], yi[6], uvi[6], ipos[2],
	opos[2];\n"
	printf "bit yp_[5], uvp_[5], yi_[6], uvi_[6], ipos_[2], opos_[2];\n"
	printf "yp = 0; uvp = 0; yi = 5; uvi = 0; ipos = 0; opos = 0;\n"
	for(i = 1; i <= steps; i++){
		printf "cany = ((step>>yp)[0] == 0 || ipos != 2 || yi >
		0) && ((yield>>yp)[0] == 0 || opos != 2);\n"
		printf "canuv = ((step>>uvp)[0] == 0 || ipos == 2 || uvi
		> 0) && ((yield>>uvp)[0] == 0 || opos == 2);\n"
		printf "yi_ = cany?((step>>yp)[0] && yi>0?yi-1:yi):canuv
		|| ipos==2?yi:yi+1;\n"
		printf "uvi_ = cany?uvi:canuv?((step>>uvp)[0] && uvi >
		0?uvi-1:uvi):ipos==2?uvi+1:uvi;\n"
		printf "ipos_ = cany?((step>>yp)[0] &&
		yi==0?ipos+1:ipos):canuv?((step>>uvp)[0] &&
		uvi==0?ipos+1:ipos):ipos+1;\n"
		printf "ipos_ = ipos_ == 3 ? 0 : ipos_;\n"
		printf "opos_ =
		cany?((yield>>yp)[0]?opos+1:opos):canuv?((yield>>uvp)[0]?opos+1:opos):opos;\n"
		printf "opos_ = opos_ == 3 ? 0 : opos_;\n"
		printf "yp_ = cany ? (yp == %d ? 0 : yp + 1) : yp;\n", phases - 1
		printf "uvp_ = !cany && canuv ? (uvp == %d ? 0 : uvp + 1) :
		uvp;\n", phases - 1
		printf "yp = yp_; uvp = uvp_; yi = yi_; uvi = uvi_; ipos = ipos_;
		opos = opos_;\n"
		printf "obviously yi_ <= 32;\n"
	}
}