show-ipx-result.cc
Go to the documentation of this file.
00001 #include "osl/record/kisen.h"
00002 #include <boost/lexical_cast.hpp>
00003 #include <vector>
00004 #include <iostream>
00005 
00006 using namespace osl;
00007 
00008 int main(int argc, char **argv)
00009 {
00010   std::vector<size_t> results(9, 0);
00011 
00012   for (int i=1; i<argc; ++i) {
00013     KisenIpxFile ipx(argv[i]);
00014     for (size_t j=0; j<ipx.size(); ++j) {
00015       const int result = ipx.getResult(j);
00016       results[result] = results.at(result) + 1; 
00017     }
00018   }
00019 
00020   std::cout << "BY_PARITY       " << boost::lexical_cast<std::string>(results.at(0)) << std::endl;
00021   std::cout << "BLACK_WIN       " << boost::lexical_cast<std::string>(results.at(1)) << std::endl;
00022   std::cout << "WHITE_WIN       " << boost::lexical_cast<std::string>(results.at(2)) << std::endl;
00023   std::cout << "SENNNICHITE     " << boost::lexical_cast<std::string>(results.at(3)) << std::endl;
00024   std::cout << "JISHOGI         " << boost::lexical_cast<std::string>(results.at(4)) << std::endl;
00025   std::cout << "BLACK_WIN_256   " << boost::lexical_cast<std::string>(results.at(5)) << std::endl;
00026   std::cout << "WIHTE_WIN_256   " << boost::lexical_cast<std::string>(results.at(6)) << std::endl;
00027   std::cout << "SENNNICHITE_256 " << boost::lexical_cast<std::string>(results.at(7)) << std::endl;
00028   std::cout << "JISHOGI_256     " << boost::lexical_cast<std::string>(results.at(8)) << std::endl;
00029 
00030   return 0;
00031 }
00032 
00033 /* ------------------------------------------------------------------------- */
00034 // ;;; Local Variables:
00035 // ;;; mode:c++
00036 // ;;; c-basic-offset:2
00037 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines