diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2020-01-12 17:57:24 -0500 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2020-01-12 17:57:24 -0500 |
commit | 6fc22d9f6dd22ef1a9fc5f1d091f79c4b67726b2 (patch) | |
tree | 640e611ef7699568862c98d72f6154951f786175 /backend.go | |
parent | 42e7425f98abf04ff770c7ad51b5494a6dfc6238 (diff) |
The player sees his own boats
Diffstat (limited to 'backend.go')
-rw-r--r-- | backend.go | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -75,7 +75,6 @@ type player struct { // - HitStatus: // 0: Unhit // 1: Hit - // target [10][10][2]int // Target Boat Tile Vector // [ hit, id ] @@ -91,12 +90,12 @@ type player struct { } func (plyr *player) InitBoard(opponent *player) { + // Sets the players' opponent plyr.prey = opponent - - for i := 0; i < 10; i++ { - for j := 0; j < 10; j++ { - plyr.primary[i][j] = [3]int{6, 0, 0} - plyr.target[i][j] = [2]int{0, 6} + for r := 0; r < 10; r++ { + for c := 0; c < 10; c++ { + plyr.primary[r][c] = [3]int{6, 0, 0} + plyr.target[r][c] = [2]int{0, 6} } } |