X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ships%2FAlu.ship;h=67effe4388a294bc59d9c3df5265048747f36e1d;hb=aee85d3dd0435554e14e03b97f268752843a441f;hp=6157fc120c101be1cd5ffb7f7e71e636ed44cecf;hpb=caa93dc7618f95e403b52ea834fa1f136d26e43d;p=fleet.git diff --git a/ships/Alu.ship b/ships/Alu.ship index 6157fc1..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,31 +91,58 @@ public void service() { b = box_in2.removeDataForShip(); box_out.addDataFromShip(a-b); // SUB break; + + 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 to MAX case 4: a = box_in1.peekDataForShip(); b = box_in2.peekDataForShip(); - box_out.addDataFromShip(Math.max(a,b)); // MAX - box_out.flag_c = !(a>b); - if (ab)); // MAX + if (a>b) 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)); // MIN - box_out.flag_c = a>b; - if (a>b) box_in1.removeDataForShip(); else box_in2.removeDataForShip(); + box_out.addDataFromShip(Math.min(a,b), a>b); // MIN + if (a