1
0
Fork 0

exercise the third

This commit is contained in:
Stephen M. McQuay 2012-08-02 15:04:24 -06:00
parent bdc7a5c44a
commit 42c1dddc1e
1 changed files with 18 additions and 0 deletions

18
exercise02/go.go Normal file
View File

@ -0,0 +1,18 @@
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
result := make([][]uint8, dy)
for j := 0; j < dy; j++ {
result[j] = make([]uint8, dx)
for i := 0; i < dx; i++ {
result[j][i] = uint8(i) ^ uint8(j)
}
}
return result
}
func main() {
pic.Show(Pic)
}