diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2020-01-13 23:18:53 -0500 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2020-01-13 23:18:53 -0500 |
commit | 66d16b332272316a7352e5a0a59d7378f2a406b4 (patch) | |
tree | 782a8b530223b35eb1c8cbd4f0be841681014a3b | |
parent | ec8b9d3d17edc79b348122601579cc0b312d2d34 (diff) |
No more prints, Escape now quits (sort of)
-rw-r--r-- | main.go | 17 | ||||
-rw-r--r-- | text.go | 2 |
2 files changed, 12 insertions, 7 deletions
@@ -63,11 +63,12 @@ func main() { playerOne.Hit(4, 8) // (E,8) playerOne.Hit(9, 2) // (I,2) - // Display both primary boards in stdout - fmt.Println("Player One (vue de ses propres pièces):", playerOne.DisplayPrimary()) - fmt.Println("Player Two (vue de ses propres pièces):", playerTwo.DisplayPrimary()) - fmt.Println("Player One (vue des pièces de son ennemi):", playerOne.DisplayTarget()) - fmt.Println("Player Two (vue des pièces de son ennemi):", playerTwo.DisplayTarget()) + // // Display both primary boards in stdout + // fmt.Println("Player One (vue de ses propres pièces):", playerOne.DisplayPrimary()) + // fmt.Println("Player Two (vue de ses propres pièces):", playerTwo.DisplayPrimary()) + // fmt.Println("Player One (vue des pièces de son ennemi):", playerOne.DisplayTarget()) + // fmt.Println("Player Two (vue des pièces de son ennemi):", playerTwo.DisplayTarget()) + } /* TVIEW UI SETUP: @@ -138,7 +139,7 @@ func main() { var log string = "Game Started!" // Until Somedody Wins: - for win := false; win == false; { + for winner := currentPlayer; !(winner.gains == [5]bool{true, true, true, true, true}); { currentPlayer.Hit(9, 9) // Make the loop toggle between both players @@ -187,6 +188,10 @@ func main() { SetDoneFunc(func(key tc.Key) { if key == tc.KeyEscape { // TODO: change this for a dopdown prompt "Are you sure? (Y/N)" + for i := 0; i < 5; i++ { + currentPlayer.prey.gains[i] = true + currentPlayer.gains[i] = true + } app.Stop() } }). @@ -13,7 +13,7 @@ Command mode: q: quit ` -const letters = "ABCDEFGHI" +const letters = "ABCDEFGHIJ" /* Boats Info: |------------+--------+----------------| |