Created
April 19, 2014 02:48
-
-
Save fjordan/11072374 to your computer and use it in GitHub Desktop.
Pic
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 { | |
slice := make([][]uint8, dy) | |
for idx := 0; idx < dy; idx++ { | |
x := make([]uint8, dx) | |
for i, _ := range x { | |
x[i] = uint8(idx^i) | |
} | |
slice[idx] = x | |
} | |
return slice | |
} | |
func main() { | |
pic.Show(Pic) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment