Skip to content

Instantly share code, notes, and snippets.

@ichiban
Created March 30, 2016 08:02
Show Gist options
  • Save ichiban/a2682dc61d5e4baf025ce76b5bc00a9b to your computer and use it in GitHub Desktop.
Save ichiban/a2682dc61d5e4baf025ce76b5bc00a9b to your computer and use it in GitHub Desktop.
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
pic := make([][]uint8, dy)
for i := 0; i < dy; i++ {
row := make([]uint8, dx)
for j := 0; j < dx; j++ {
row[j] = uint8(i ^ j)
}
pic[i] = row
}
return pic
}
func main() {
pic.Show(Pic)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment