| 1234567891011121314151617 |
- package game
- func (game *Game) shipPlace(ship pieces, x int, y int, orientation int) {
- for v := range ship.length {
- switch orientation {
- case updown:
- for i := 0; i < v; i++ {
- game.leftShips[x][y+1] = ship.abreviation
- }
- case leftright:
- for i := 0; i < v; i++ {
- game.leftShips[x+1][y] = ship.abreviation
- }
- }
- }
- }
|