Skip to content

Instantly share code, notes, and snippets.

@tossmilestone
Created June 29, 2017 06:32
Show Gist options
  • Save tossmilestone/9a6d4f89d7daae8138de46b20cad3218 to your computer and use it in GitHub Desktop.
Save tossmilestone/9a6d4f89d7daae8138de46b20cad3218 to your computer and use it in GitHub Desktop.
Answer of pic in go tour
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
z := make([][]uint8, dy)
for i := range z {
z[i] = make([]uint8, dx)
for j := range z[i] {
z[i][j] = uint8(i*j)
}
}
return z
}
func main() {
pic.Show(Pic)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment