Skip to content

Instantly share code, notes, and snippets.

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