Skip to content

Instantly share code, notes, and snippets.

@jsutlovic
Created July 13, 2014 01:38
Show Gist options
  • Save jsutlovic/d965c49da078eedf4f9c to your computer and use it in GitHub Desktop.
Save jsutlovic/d965c49da078eedf4f9c to your computer and use it in GitHub Desktop.
Go Tour #38
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
p := make([][]uint8, dy)
for y := range p {
p[y] = make([]uint8, dx)
for x := range p[y] {
p[y][x] = uint8((y ^ x))
}
}
return p
}
func main() {
pic.Show(Pic)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment