Skip to content

Instantly share code, notes, and snippets.

@pyk
Last active September 7, 2015 09:34
Show Gist options
  • Save pyk/8c54534f7c6163e9178d to your computer and use it in GitHub Desktop.
Save pyk/8c54534f7c6163e9178d to your computer and use it in GitHub Desktop.
solution of exercise http://tour.golang.org/#38
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
ret := make([][]uint8, dy)
for i := range ret {
ret[i] = make([]uint8, dx)
for j := range ret[i] {
ret[i][j] = uint8(i^j)
}
}
return ret
}
func main() {
pic.Show(Pic)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment