X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ships%2FAlu.ship;h=67effe4388a294bc59d9c3df5265048747f36e1d;hb=45976f3a79fa5d572b907ac716350b75d15e978a;hp=29293e45276cd5c3752e4e3ddc2aee0861a9e4b6;hpb=14b564dc318c7cdd43b8998da4ec6fd38ec63f52;p=fleet.git diff --git a/ships/Alu.ship b/ships/Alu.ship index 29293e4..67effe4 100644 --- a/ships/Alu.ship +++ b/ships/Alu.ship @@ -14,6 +14,9 @@ data in: inOp constant DROP1: 7 constant DROP2: 8 constant MAXMERGE: 9 + constant AND: 10 + constant OR: 11 + constant XOR: 12 data out: out @@ -88,25 +91,27 @@ public void service() { b = box_in2.removeDataForShip(); box_out.addDataFromShip(a-b); // SUB break; - case 9: + + case 9: // MAXMERGE if (box_in1.peekDataForShip()<0 && box_in2.peekDataForShip()<0) { a = box_in1.removeDataForShip(); b = box_in2.removeDataForShip(); box_out.addDataFromShip(a, false); break; } - // fall through + // fall through to MAX case 4: a = box_in1.peekDataForShip(); b = box_in2.peekDataForShip(); box_out.addDataFromShip(Math.max(a,b), !(a>b)); // MAX - if (ab) box_in1.removeDataForShip(); else box_in2.removeDataForShip(); break; + case 5: a = box_in1.peekDataForShip(); b = box_in2.peekDataForShip(); box_out.addDataFromShip(Math.min(a,b), a>b); // MIN - if (a>b) box_in1.removeDataForShip(); else box_in2.removeDataForShip(); + if (a