Kaynağa Gözat

added potential windows fix

Kajetan Johannes Hammerle 3 yıl önce
ebeveyn
işleme
13f19e8002
1 değiştirilmiş dosya ile 13 ekleme ve 13 silme
  1. 13 13
      Game.cpp

+ 13 - 13
Game.cpp

@@ -24,23 +24,23 @@ void Game::reset() {
 
 void Game::reset(String& output) {
     reset();
-    output.append("Fanorona Game\n");
+    output.append("Fanorona Game\n\r");
     print(output);
-    output.append("Human Color: White(O)\nAIColor: Black(#)\nHuman turn\nselect stone: ");
+    output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\rHuman turn\n\rselect stone: ");
 }
 
 void Game::print(String& s) const {
-    s.append("\n  0 1 2 3 4 5 6 7 8\n");
+    s.append("\n\r  0 1 2 3 4 5 6 7 8\n\r");
     printLine(s, 0);
-    s.append("  |\\|/|\\|/|\\|/|\\|/|\n");
+    s.append("  |\\|/|\\|/|\\|/|\\|/|\n\r");
     printLine(s, 1);
-    s.append("  |/|\\|/|\\|/|\\|/|\\|\n");
+    s.append("  |/|\\|/|\\|/|\\|/|\\|\n\r");
     printLine(s, 2);
-    s.append("  |\\|/|\\|/|\\|/|\\|/|\n");
+    s.append("  |\\|/|\\|/|\\|/|\\|/|\n\r");
     printLine(s, 3);
-    s.append("  |/|\\|/|\\|/|\\|/|\\|\n");
+    s.append("  |/|\\|/|\\|/|\\|/|\\|\n\r");
     printLine(s, 4);
-    s.append('\n');
+    s.append("\n\r");
 }
 
 void Game::printLine(String& s, int index) const {
@@ -60,7 +60,7 @@ void Game::printLine(String& s, int index) const {
     } else {
         s.append(map[fields[8][index]]);
     }
-    s.append('\n');
+    s.append("\n\r");
 }
 
 void Game::parse(const String& input, String& output) {
@@ -93,7 +93,7 @@ void Game::markActive(int x, int y, String& output) {
     activeX = x;
     activeY = y;
     print(output);
-    output.append("Human Color: White(O)\nAIColor: Black(#)\nselect location to move: ");
+    output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\rselect location to move: ");
 }
 
 void Game::move(int x, int y, String& output) {
@@ -108,9 +108,9 @@ void Game::move(int x, int y, String& output) {
     activeX = x;
     activeY = y;
     print(output);
-    output.append("Human Color: White(O)\nAIColor: Black(#)\n");
+    output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\r");
     print(output);
-    output.append("Human Color: White(O)\nAIColor: Black(#)\nAI turn\n");
+    output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\rAI turn\n\r");
     activeX = -1;
     activeY = -1;
     botMove(output);
@@ -135,7 +135,7 @@ void Game::revertToSelection(String& output) {
     activeX = -1;
     activeY = -1;
     print(output);
-    output.append("Human Color: White(O)\nAIColor: Black(#)\nHuman turn\nselect stone: ");
+    output.append("Human Color: White(O)\n\rAIColor: Black(#)\n\rHuman turn\n\rselect stone: ");
 }
 
 void Game::removeLine(int x, int y, int x2, int y2, FieldState remove) {