123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #include <iostream>
- #include "EngineInfo.h"
- #include "UciParser.h"
- #include "Search.h"
- using namespace std;
- using namespace chessy;
- /*!
- * entry point of the program.
- */
- auto main(int argc, char** argv) -> int
- {
- /*ChessGame cg;
- Perft p{ 2 , cg };
- cout << p.search() << endl;
- return 0;*/
- /*ChessGame cg{ "8/1pP5/3Qp2p/2K1P1P1/1p1p4/4p3/k2P3P/4b1n1 w - - 0 1" };
- auto printer = [](const MoveInfo& mi) {
- cout << mi.move.asString() << endl;
- };
- Search<decltype(printer)> search{ std::move(printer), cg };
- search.iterateAll<WHITE_SIDE>();
- cout << endl << endl;
- search.iterateAll<BLACK_SIDE>();
- cin.get();
- return 0;*/
- argc = popcount(argc);
- 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);
- try {
- cg.loadFromFen(line);
- cout << cg.generateFen() << endl;
- Bitboard whites = cg.getBoard().getWhites();
- Bitboard blacks = cg.getBoard().getBlacks();
-
- PawnPushGenerator<BLACK_SIDE> mg{ cg };
- for (auto push : mg) {
- cout << "pawn: " << push.asString() << endl;
- }
- PositionSet knights = cg.getBoard().getBlackKnights();
- for (auto knight : knights) {
- for (auto pos : KnightMoveGenerator{ knight, blacks }) {
- cout << "knight: " << Move(knight, pos).asString() << endl;
- }
- }
- PositionSet bishops = cg.getBoard().getBlackBishops();
- for (auto bishop : bishops) {
- for (auto pos : PrimitiveBishopMoveGenerator{ bishop, whites, blacks }) {
- cout << "bishop: " << Move(bishop, pos).asString() << endl;
- }
- }
- PositionSet rooks = cg.getBoard().getBlackRooks();
- for (auto rook : rooks) {
- for (auto pos : PrimitiveRookMoveGenerator{ rook, whites, blacks }) {
- cout << "rook: " << Move(rook, pos).asString() << endl;
- }
- }
- PositionSet queens = cg.getBoard().getBlackQueens();
- for (auto queen : queens) {
- for (auto pos : PrimitiveQueenMoveGenerator{ queen, whites, blacks }) {
- cout << "queen: " << Move(queen, pos).asString() << endl;
- }
- }
- Bitboard king = cg.getBoard().getBlackKings();
- Index kingIndex = king.getLeastSignificantBit();
- for (auto pos : KingMoveGenerator{ king, blacks }) {
- cout << "king: " << Move(kingIndex, pos).asString() << endl;
- }
- }
- catch (runtime_error& re) {
- cerr << re.what() << endl;
- return 1;
- }
- return 0;
- }
- */
|