Skip to content

Instantly share code, notes, and snippets.

@mmcfarland
Created March 13, 2013 02:13
Show Gist options
  • Save mmcfarland/5148864 to your computer and use it in GitHub Desktop.
Save mmcfarland/5148864 to your computer and use it in GitHub Desktop.
Go Lang Tour #35
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
outter := make([][]uint8, dy)
for i:=0; i < dy; i++ {
inner := make([]uint8, dx)
for f:=0; f<dx; f++ {
inner[f] = uint8((f*i/2)^(i+f));
}
outter[i] = inner;
}
return outter
}
func main() {
pic.Show(Pic)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment