Skip to content

Instantly share code, notes, and snippets.

@espaciomore
Created January 1, 2017 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save espaciomore/26fb5053599e42c66465eec14ab7147a to your computer and use it in GitHub Desktop.
Save espaciomore/26fb5053599e42c66465eec14ab7147a to your computer and use it in GitHub Desktop.
Go Tour - Pic
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
var p [][]uint8 = make([][]uint8, dy)
for i:=0;i<dy;i++ {
p[i] = make([]uint8, dx)
for j:=0;j<dx;j++ {
p[i][j] = uint8((j*i)/10)
}
}
return p
}
func main() {
pic.Show(Pic)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment