Created
March 30, 2016 08:02
-
-
Save ichiban/a2682dc61d5e4baf025ce76b5bc00a9b to your computer and use it in GitHub Desktop.
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 "golang.org/x/tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
pic := make([][]uint8, dy) | |
for i := 0; i < dy; i++ { | |
row := make([]uint8, dx) | |
for j := 0; j < dx; j++ { | |
row[j] = uint8(i ^ j) | |
} | |
pic[i] = row | |
} | |
return pic | |
} | |
func main() { | |
pic.Show(Pic) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment