Created
November 14, 2013 11:57
-
-
Save nanto/7465646 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 "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
ret := make([][]uint8, dy) | |
for y := range(ret) { | |
ret[y] = make([]uint8, dx) | |
for x := range(ret[y]) { | |
if x % 8 == 0 || y % 8 == 0 { | |
ret[y][x] = 0 | |
} else { | |
ret[y][x] = 255 | |
} | |
} | |
} | |
return ret | |
} | |
func main() { | |
pic.Show(Pic) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment