// System: EC Flex /* Haftungsausschluss / Disclaimer Eine Haftung fuer die Richtigkeit der Implementierung des Systems wird NICHT uebernommen, der Download und der Einsatz des Systems erfolgt auf eigenes Risiko! A liability for the correctness of the implementation of the system will NOT be assumed, the download and use of the system is at your own risk! Ing. Thomas Froehlich (www.ing-froehlich.de) */ ST: MESSAGE ON; SZ STMAX(I(2)); SZ EI1(1); // Play with one piece SZ CO00(0); // define the states of the system - what should be done // 0,1,2 = Save EC of V0,VZ,GZ // 3,4,5 = Set the EC (step by step -> see Line 61) // 6 = reset counter SZ CO10(0),CO11(0),CO12(0); // 1= black, 2=red, 0= zero or nothing to set SZ CO20(0); // Loose Counter SZ CO30(0); // 0 = normal set - 10 = alternate set AL: // Check win or loose - after the first set IF CO00(4) AND IF GZ NOT IN AG(1) THEN SZ CO20(+1); // check first set if loose IF CO00(5) AND IF GZ NOT IN AG(1) THEN SZ CO20(+1); // check second set if loose IF CO00(5) AND IF GZ IN AG(1) THEN SZ CO20(0); // second set is a win - reset loose counter IF CO00(5) AND IF CO20(2) THEN SZ CO30(+10),CO00(6); // first and second is a loose - switch to alternate set IF CO00(5) THEN SZ CO20(0); // now the loose counter can be reset IF CO30(>10) THEN SZ CO30(0); // in case of switch back from alternate to normal run -> reset CO30 // save the EC state from the previous runs IF CO00(0) AND IF V0 IN EC03 THEN SZ CO10(1),CO00(1); IF CO00(0) AND IF V0 IN EC04 THEN SZ CO10(2),CO00(1); IF CO00(1) AND IF VZ IN EC03 THEN SZ CO11(1),CO00(2); IF CO00(1) AND IF VZ IN EC04 THEN SZ CO11(2),CO00(2); IF CO00(2) AND IF GZ IN EC03 THEN SZ CO12(1),CO00(3); IF CO00(2) AND IF GZ IN EC04 THEN SZ CO12(2),CO00(3); // three combo not ok (for example zero is in the combo) - reset to 'first' run IF CO00(<3) THEN SZ CO00(0); // First set IF CO00(3) AND IF CO10(1) AND IF CO30(0) THEN SZ EC03; IF CO00(3) AND IF CO10(1) AND IF CO30(10) THEN SZ EC04; // alternate IF CO00(3) AND IF CO10(2) AND IF CO30(0) THEN SZ EC04; IF CO00(3) AND IF CO10(2) AND IF CO30(10) THEN SZ EC03; // alternate IF CO00(4) AND IF CO11(1) AND IF CO30(0) THEN SZ EC03; IF CO00(4) AND IF CO11(1) AND IF CO30(10) THEN SZ EC04; // alternate IF CO00(4) AND IF CO11(2) AND IF CO30(0) THEN SZ EC04; IF CO00(4) AND IF CO11(2) AND IF CO30(10) THEN SZ EC03; // alternate IF CO00(5) AND IF CO12(1) AND IF CO30(0) THEN SZ EC03; IF CO00(5) AND IF CO12(1) AND IF CO30(10) THEN SZ EC04; // alternate IF CO00(5) AND IF CO12(2) AND IF CO30(0) THEN SZ EC04; IF CO00(5) AND IF CO12(2) AND IF CO30(10) THEN SZ EC03; // alternate IF CO00(>=1) THEN SZ CO00(+1); // increment state counter IF CO00(>=6) THEN SZ CO00(0),CO10(0),CO11(0),CO12(0); // run complete -> reset all counter