Last active
December 11, 2017 17:56
-
-
Save youchen/40efdf4640e36ab7a8d88cd7e64a2870 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 "golang.org/x/tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
pic := make([][]uint8, dy) | |
for i := range pic { | |
pic[i] = make([]uint8, dx) | |
for ii := range pic[i] { | |
pic[i][ii] = uint8(i ^ ii) | |
} | |
} | |
return pic | |
} | |
func main() { | |
pic.Show(Pic) | |
} |
Author
youchen
commented
Dec 11, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment