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

Fork of CRAC-Strat_2017_fin_premier_match by CRAC Team

Revision:
4:88431b537477
Parent:
1:116040d14164
Child:
11:ed13a480ddca
--- a/Instruction/Instruction.cpp	Sun Apr 17 08:31:59 2016 +0000
+++ b/Instruction/Instruction.cpp	Sun Apr 17 14:03:03 2016 +0000
@@ -66,7 +66,10 @@
     } 
 }
 
-
+/****************************************************************************************/
+/* FUNCTION NAME: stringToInstruction                                                   */
+/* DESCRIPTION  : Conversion d'une ligne du fichier de strat en instruction             */
+/****************************************************************************************/
 struct S_Instruction stringToInstruction(char line[]) {
     struct S_Instruction instruction;
     
@@ -112,6 +115,12 @@
     return instruction;
 }
 
+/****************************************************************************************/
+/* FUNCTION NAME: loadAllInstruction                                                    */
+/* DESCRIPTION  : Charger toutes les instructions du fichier de stratégie               */
+/*  Il faut utiliser strcpy(cheminFileStart,"/local/strat.txt");                        */
+/*   pour indiquer le fichier à utiliser                                                */
+/****************************************************************************************/
 void loadAllInstruction(void) {
     
     struct S_Instruction instruction;
@@ -136,3 +145,18 @@
     fclose(testFile);
     
 }
+
+/****************************************************************************************/
+/* FUNCTION NAME: FileExists                                                            */
+/* DESCRIPTION  : Permet de vérifier si un fichier existe                               */
+/****************************************************************************************/
+int FileExists(const char *fname)
+{
+    FILE *file;
+    if (file = fopen(fname, "r"))
+    {
+        fclose(file);
+        return 1;
+    }
+    return 0;
+}