Created
March 29, 2014 04:58
-
-
Save sglyon/9848763 to your computer and use it in GitHub Desktop.
Gotour
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 { | |
a := make([][]uint8, dy) | |
// allocate inner dimension | |
for i:=0; i < dy; i++ { | |
a[i] = make([]uint8, dx) | |
} | |
// Fill it in | |
for i:=0; i < dy; i++ { | |
for j:=0; j < dx; j++ { | |
a[i][j] = uint8(i^j) | |
} | |
} | |
return a | |
} | |
func main() { | |
pic.Show(Pic) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment