From 4fb21cb2b5ea27805f8a422b2e64c1dc6ccdd25e Mon Sep 17 00:00:00 2001 From: Agony5757 Date: Thu, 17 Mar 2022 14:44:24 +0800 Subject: [PATCH] update Readme(CN).md --- "\350\257\273\346\210\221.md" | 57 ++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git "a/\350\257\273\346\210\221.md" "b/\350\257\273\346\210\221.md" index 7ad61dd..da7cb80 100644 --- "a/\350\257\273\346\210\221.md" +++ "b/\350\257\273\346\210\221.md" @@ -63,35 +63,42 @@ python setup.py install int main() { Table t; + t.set_write_log(true); t.game_init(); - while (t.get_phase() != Table::GAME_OVER) - { - print("{}\n", t.to_string()); - print("{} is making selection.\n", t.who_make_selection()); - if (t.get_phase() <= 4) - { - print("SelfAction phase.\n"); - - auto& actions = t.get_self_actions(); - /* inspect all available actions here */ - - int selection; - /* replace this with your selection method */ - t.make_selection(selection); - } - else + try { + while (t.get_phase() != Table::GAME_OVER) { - print("Response Action phase.\n"); - - auto& actions = t.get_response_actions(); - /* inspect all available (response) actions here */ - - int selection; - /* replace this with your selection method */ - t.make_selection(selection); + fmt::print("{}\n", t.to_string()); + fmt::print("{} is making selection.\n", t.who_make_selection()); + if (t.get_phase() < 4) + { + fmt::print("SelfAction phase.\n"); + + auto& actions = t.get_self_actions(); + /* inspect all available actions here */ + + int selection; + /* replace this with your selection method */ + t.make_selection(selection); + } + else + { + fmt::print("Response Action phase.\n"); + + auto& actions = t.get_response_actions(); + /* inspect all available (response) actions here */ + + int selection; + /* replace this with your selection method */ + t.make_selection(selection); + } } + fmt::print("Result: \n{}", t.get_result().to_string()); + } + catch (std::exception& e) { + // output replay & debug codes + t.print_debug_replay(); } - print("Result: \n{}", t.get_result().to_string()); return 0; }