Skip to content

Instantly share code, notes, and snippets.

@ton-katsu
Created April 15, 2014 09:43
Show Gist options
  • Save ton-katsu/10718284 to your computer and use it in GitHub Desktop.
Save ton-katsu/10718284 to your computer and use it in GitHub Desktop.
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
picture := make([][]uint8, dy)
for i := range picture {
picture[i] = make([]uint8, dx)
y := uint8(i)
for j := 0; j < dx; j++ {
x := uint8(j)
picture[i][j] = x^y
}
}
return picture
}
func main() {
pic.Show(Pic)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment