Skip to content

Instantly share code, notes, and snippets.

@Querela
Created September 17, 2013 13:04
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 Querela/6594034 to your computer and use it in GitHub Desktop.
Save Querela/6594034 to your computer and use it in GitHub Desktop.
package main
//import "fmt"
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
r := make([][]uint8, dy)
for i := range r {
r[i] = make([]uint8, dx)
}
for y := range r {
for x := range r[y] {
// r[y][x] = uint8(x*y)
// r[y][x] = uint8((x+y)/2)
r[y][x] = uint8(x^y+10)
}
}
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