Created
October 29, 2016 00:46
-
-
Save alexbosworth/19f2d8d7fe613f0a272b58a7c17e0af6 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 { | |
// Create pixels | |
pixels := make([][]uint8, dy) | |
for x := 0; x < dx; x++ { | |
pixels[x] = make([]uint8, dy) | |
for y := 0; y < dy; y++ { | |
pixels[x][y] = uint8(x ^ y) | |
} | |
} | |
return pixels | |
} | |
func main() { | |
pic.Show(Pic) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment