Skip to content

Instantly share code, notes, and snippets.

@suzuken
Created March 8, 2014 06:25
Show Gist options
  • Save suzuken/9426232 to your computer and use it in GitHub Desktop.
Save suzuken/9426232 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 {
rec := make([][]uint8, dy)
for i := 0; i < len(rec); i++ {
x := make([]uint8, dx)
for j := 0; j < len(x); j++ {
x[j] = uint8(i * j)
}
rec[i] = x
}
return rec
}
func main() {
pic.Show(Pic)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment