00001
00004 #include "osl/state/numEffectState.h"
00005 #include "osl/move_generator/allMoves.h"
00006 #include "osl/move_action/store.h"
00007 #include "osl/move_classifier/check_.h"
00008 #include "osl/record/csaString.h"
00009 #include "osl/misc/perfmon.h"
00010 #include <iostream>
00011 using namespace osl;
00012
00013 int main(int argc,char **argv)
00014 {
00015
00016
00017 char c;
00018 while ((c = getopt(argc, argv, "vh")) != EOF)
00019 {
00020 switch(c)
00021 {
00022 default:
00023 std::cerr << "unknown option\n";
00024 return 1;
00025 }
00026 }
00027
00028 NumEffectState state((CsaString(
00029 "P1-KY * * * -KY * -FU-KE * \n"
00030 "P2 * * * * -OU * * * * \n"
00031 "P3 * * * -FU-FU+RY * * -KY\n"
00032 "P4-FU * * -GI * * * * * \n"
00033 "P5 * * * * * * * * * \n"
00034 "P6+FU * * +RY * * +FU * * \n"
00035 "P7 * +FU * +FU+FU+FU * * * \n"
00036 "P8 * * +OU * -TO * * * * \n"
00037 "P9+KY * * * * * * +KE * \n"
00038 "P+00KI00GI00GI00GI00KE00KE00FU00FU00FU00KI\n"
00039 "P-00KA00KA00KI00FU00FU00FU00FU00KI\n"
00040 "-\n").getInitialState()));
00041
00042 MoveVector moves;
00043 move_action::Store store(moves);
00044 move_generator::AllMoves<NumEffectState,move_action::Store>::
00045 generateMoves(state.getTurn(),state,store);
00046
00047 int count = 0;
00048 misc::PerfMon clock;
00049 for (size_t i=0; i<moves.size(); ++i)
00050 {
00051 if (move_classifier::Check<WHITE>::isMember
00052 (state, moves[i].ptype(), moves[i].from(), moves[i].to()))
00053 ++count;
00054 }
00055 clock.stop("total", moves.size());
00056 std::cerr << "checks " << count << " / " << moves.size() << "\n";
00057 }
00058
00059
00060
00061