00001
00002
00003
00004
00005 #include "osl/search/sortCaptureMoves.h"
00006 #include "osl/state/numEffectState.h"
00007 #include "osl/move_generator/allMoves.h"
00008 #include "osl/effect_util/effectUtil.h"
00009 #include "osl/apply_move/applyMove.h"
00010 #include "osl/record/csaRecord.h"
00011 #include "osl/container/moveVector.h"
00012
00013 #include <iostream>
00014 #include <cstdlib>
00015 #include <cstdio>
00016 #include <unistd.h>
00017
00018 using namespace osl;
00019
00020 int main(int argc, char **argv)
00021 {
00022 const char *program_name = argv[0];
00023 bool error_flag = false;
00024 bool verbose = false;
00025 const char *kisenFilename = 0;
00026
00027 extern char *optarg;
00028 extern int optind;
00029 char c;
00030 size_t num_records = 1;
00031 while ((c = getopt(argc, argv, "vh")) != EOF) {
00032 switch(c)
00033 {
00034 case 'v': verbose = true;
00035 break;
00036 default: error_flag = true;
00037 }
00038 }
00039 argc -= optind;
00040 argv += optind;
00041
00042 if (error_flag)
00043 return 1;
00044
00045 try {
00046 nice(20);
00047 size_t record_processed = 0;
00048
00049 for (int i=0; i<argc; ++i) {
00050 CsaFile file(argv [i]);
00051 const Record record = file.getRecord();
00052 NumEffectState state(record.getInitialState());
00053
00054 MoveVector moves;
00055 GenerateAllMoves::generate(state.getTurn(), state, moves);
00056 search::SortCaptureMoves::sortByTakeBack(state, moves);
00057 std::cout << state << moves << "\n";
00058 }
00059 }
00060 catch (std::exception& e) {
00061 std::cerr << e.what() << "\n";
00062 return 1;
00063 }
00064 }
00065
00066
00067
00068
00069