summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2020-01-13 23:18:53 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2020-01-13 23:18:53 -0500
commit66d16b332272316a7352e5a0a59d7378f2a406b4 (patch)
tree782a8b530223b35eb1c8cbd4f0be841681014a3b
parentec8b9d3d17edc79b348122601579cc0b312d2d34 (diff)
No more prints, Escape now quits (sort of)
-rw-r--r--main.go17
-rw-r--r--text.go2
2 files changed, 12 insertions, 7 deletions
diff --git a/main.go b/main.go
index e89e561..1bdf8a9 100644
--- a/main.go
+++ b/main.go
@@ -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()
}
}).
diff --git a/text.go b/text.go
index 5e9f426..f830811 100644
--- a/text.go
+++ b/text.go
@@ -13,7 +13,7 @@ Command mode:
q: quit
`
-const letters = "ABCDEFGHI"
+const letters = "ABCDEFGHIJ"
/* Boats Info:
|------------+--------+----------------|