Skip to content

Instantly share code, notes, and snippets.

@wlaurance
Created May 11, 2014 01:50
Show Gist options
  • Save wlaurance/24f07aa2205bf1026a43 to your computer and use it in GitHub Desktop.
Save wlaurance/24f07aa2205bf1026a43 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 {
image := make([][]uint8, dy)
for i := range image {
image[i] = make([]uint8, dx)
for x,_ := range image[i] {
image[i][x] = uint8(x^2 * x)
}
}
return image
}
func main() {
pic.Show(Pic)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment