goship/square.go

14 lines
228 B
Go
Raw Normal View History

2024-06-17 22:34:04 +02:00
package main
type square struct {
status uint8 //0 is empty, 1 is missed, 2 is alive, 3 is destroyed
ship *ship
}
func (square *square) hit() uint8 {
if square.status%2 == 0 {
square.status++
}
return square.status
}