code strat avant match 2, strat inversée OK normalement

Fork of CRAC-Strat_2017_fin_premier_match by CRAC Team

Revision:
1:116040d14164
Parent:
0:ad97421fb1fb
Child:
4:88431b537477
--- a/Instruction/Instruction.cpp	Wed Apr 13 22:04:54 2016 +0000
+++ b/Instruction/Instruction.cpp	Fri Apr 15 10:49:40 2016 +0000
@@ -75,14 +75,14 @@
     char instructionPrecision;
     char instructionNextActionType;
     char instructionJumpAction;
-    
+    int errorCode = 0;
     /*
     Info sur la fonction sscanf
     %d -> Entier signé
     %u -> Entié non signé
     %c -> char
     */
-    sscanf(line, "%d,%c,%c,%u,%u,%d,%c,%c,%c,%u,%u,%d,%d",
+    errorCode = sscanf(line, "%d,%c,%c,%u,%u,%d,%c,%c,%c,%u,%u,%d,%d",
         &instruction.lineNumber,
         &instructionOrder,
         &instructionDirection,
@@ -97,6 +97,10 @@
         &instruction.nextLineOK,
         &instruction.nextLineError
     );
+    /*
+    if(errorCode != 13) {
+        errorInstructionLoop();//L'instruction est pas bonne !!  
+    }*/
     
     instruction.order           = charToInstructionType(instructionOrder);
     instruction.direction       = charToInstructionDirection(instructionDirection);
@@ -121,6 +125,9 @@
     while (fgets(LineBuffer, SIZE, testFile) != NULL)  {
         instruction = stringToInstruction(LineBuffer);
         strat_instructions[nb_instructions] = instruction;
+        if(strat_instructions[nb_instructions].order == UNKNOWN) {
+            errorInstructionLoop();//L'instruction est pas bonne !!   
+        }
         //printf(LineBuffer);
         //debug_Instruction(instruction);
         nb_instructions++;