ジャワ8、スコア:360 358 319 271 233(240から7)バイト
interface J<O>{O f(O x,O y,J...j);}J t=(x,y,j)->x;J f=(x,y,j)->y;J n=(x,y,j)->j[0].f(y,x);J a=(x,y,j)->j[0].f(j[1].f(x,y),y);J o=(x,y,j)->j[0].f(x,j[1].f(x,y));J x=(x,y,j)->j[0].f(j[1].f(y,x),j[1].f(x,y));J i=(x,y,j)->j[0].f(j[1].f(x,y),x);
これは、開始時に思ったよりも達成するのが難しいものでしたimplies。とにかく、それは動作します。多分あちこちでゴルフをすることができます。編集:OK、関数を再利用せず、同じアプローチを複製するだけで、Javaのバイトカウントの点ではるかに安価になります。また、関数をまったく使用しないことで、完全な-7ボーナスが得られます。
オンラインでお試しください。
説明:
// Create an interface J to create lambdas with 2 Object and 0 or more amount of optional
// (varargs) J lambda-interfaces, which returns an Object:
interface J<O>{O f(O x,O y,J...j);}
// True: with parameters `x` and `y`, always return `x`
J t=(x,y,j)->x;
// False: with parameters `x` and `y`, always return `y`
J f=(x,y,j)->y;
// Not: with parameters `x`, `y`, and `j` (either `t` or `f`), return: j(y, x)
J n=(x,y,j)->j[0].f(y,x);
// And: with parameters `x`, `y`, and two times `j` (either `t` or `f`), return:
// j1(j2(x,y), y);
J a=(x,y,j)->j[0].f(j[1].f(x,y),y);
// Or: with parameters `x`, `y`, and two times `j` (either `t` or `f`), return:
// j1(x, j2(x,y))
J o=(x,y,j)->j[0].f(x,j[1].f(x,y));
// Xor: with parameters `x`, `y`, and two times `j` (either `t` or `f`), return:
// j1(j2(y,x), j2(x,y))
J x=(x,y,j)->j[0].f(j[1].f(y,x),j[1].f(x,y));
// Implies: with parameters `x`, `y`, and two times `j` (either `t` or `f`), return:
// j1(j2(x,y), x)
J i=(x,y,j)->j[0].f(j[1].f(x,y),x);