package board type Tile byte type jsonTile struct { X int `json:"x"` Y int `json:"y"` Type string `json:"type"` Player string `json:"player,omitempty"` } const ( Water Tile = '~' Ice Tile = '*' Rock Tile = '^' Iglo Tile = 'O' ) func (t Tile) String() string { switch t { case Water: return "~" case Rock: return "▲" case Ice: return "*" case Iglo: return "⌂" } panic("Unknown tile type") } func (t Tile) Name() string { switch t { case Water: return "WATER" case Rock: return "ROTS" case Ice: return "IJS" case Iglo: return "HUIS" } panic("Unknown tile type") }