diff options
Diffstat (limited to 'src/NameGame.cc')
| -rw-r--r-- | src/NameGame.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/NameGame.cc b/src/NameGame.cc index e18d419..5b79f87 100644 --- a/src/NameGame.cc +++ b/src/NameGame.cc | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | #include <fstream> | 1 | #include <fstream> |
| 2 | #include <iomanip> | ||
| 2 | #include <iostream> | 3 | #include <iostream> |
| 3 | #include <map> | 4 | #include <map> |
| 4 | #include <stdexcept> | 5 | #include <stdexcept> |
| @@ -96,9 +97,13 @@ void NameGame::runRound(int r) { | |||
| 96 | // Speaker chooses best strategy. | 97 | // Speaker chooses best strategy. |
| 97 | int strategy = best_move(speaker.GetId()); | 98 | int strategy = best_move(speaker.GetId()); |
| 98 | if (verbose_flag) { | 99 | if (verbose_flag) { |
| 99 | std::cout << "speaker (" << speaker.GetId() << " " | 100 | char s_committed = speaker().Val1 ? 'C' : 'U', |
| 100 | << std::boolalpha << speaker().Val1 | 101 | h_committed = hearer().Val1 ? 'C' : 'U'; |
| 101 | << ") chose: " << strategy << std::endl; | 102 | char oldfill = std::cout.fill('0'); |
| 103 | std::cout << "S" << std::setw(2) << speaker.GetId() | ||
| 104 | << '(' << s_committed << ") - H" << std::setw(2) << hearer.GetId() | ||
| 105 | << '(' << h_committed << "): " << strategy << std::endl; | ||
| 106 | std::cout.fill(oldfill); | ||
| 102 | } | 107 | } |
| 103 | 108 | ||
| 104 | // Hearer updates memory. | 109 | // Hearer updates memory. |
