exercise the third
This commit is contained in:
parent
bdc7a5c44a
commit
42c1dddc1e
18
exercise02/go.go
Normal file
18
exercise02/go.go
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user