Created
March 13, 2013 02:13
-
-
Save mmcfarland/5148864 to your computer and use it in GitHub Desktop.
Go Lang Tour #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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