Skip to content

Instantly share code, notes, and snippets.

@ignaciomosca
Last active November 25, 2019 23:04
Show Gist options
  • Save ignaciomosca/849c82550414fbc0bcca3231dc1bc85a to your computer and use it in GitHub Desktop.
Save ignaciomosca/849c82550414fbc0bcca3231dc1bc85a to your computer and use it in GitHub Desktop.
package main
import "fmt"
type ChessPiece struct {
row int
col int
piece rune
}
type Board struct {
rows int
cols int
pieces [5]ChessPiece
}
func main() {
chessPiece := ChessPiece {1,1,'R'}
chessPiece2 := ChessPiece {1,1,'R'}
itwerks := make(map[ChessPiece]bool)
board := Board {7,7, itwerks}
boards := make(map[Board] bool)
itwerks[chessPiece] = true
itwerks[chessPiece2] = true
numberOfPieces := len(itwerks)
fmt.Println(numberOfPieces) //it would return 1 but it doesn't because it does not compile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment