Explorar el Código

added some information and version to the engine

nicolaswinkler hace 7 años
padre
commit
055b467b97
Se han modificado 2 ficheros con 25 adiciones y 7 borrados
  1. 7 5
      src/BitBoard.h
  2. 18 2
      src/main.cpp

+ 7 - 5
src/BitBoard.h

@@ -173,11 +173,13 @@ struct chessy::Bitboard
     inline Bitboard seOne       (void)      { return (bits >> 7) & ~aColumn; }
 
     template<Side side>
-    inline void     pushOne     (void);
-    template<>
-    inline void     pushOne<WHITE_SIDE>(void) { moveNorthOne(); }
-    template<>
-    inline void     pushOne<BLACK_SIDE>(void) { moveSouthOne(); }
+    inline void     pushOne(void)
+    {
+        if (side == WHITE_SIDE)
+            moveNorthOne();
+        else
+            moveSouthOne();
+    }
 
     inline void     operator &= (const Bitboard& b)         { bits &= b.bits; }
     inline void     operator |= (const Bitboard& b)         { bits |= b.bits; }

+ 18 - 2
src/main.cpp

@@ -1,18 +1,33 @@
 #include <iostream>
+#include "EngineInfo.h"
 #include "UciParser.h"
-#include "ChessGame.h"
-#include "MoveGeneration.h"
 
 using namespace std;
 using namespace chessy;
 
+
+/*!
+ * entry point of the program.
+ */
 auto main(int argc, char** argv) -> int
 {
+    if (argc > 1 && (string(argv[1]) == "-h" || string(argv[1]) == "--help")) {
+        cout << info::helpText << endl;
+        return 0;
+    }
+
+    // display welcome message
+    cout << info::welcomeText << endl;
+
+    // run uci
     UciParser uciParser;
     uciParser.parse(cin, cout);
+
     return 0;
 
+}
 
+/*
     ChessGame cg;
     string line;
     getline(cin, line);
@@ -67,3 +82,4 @@ auto main(int argc, char** argv) -> int
     }
     return 0;
 }
+*/