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