Skip to content

Instantly share code, notes, and snippets.

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