exercise the third
This commit is contained in:
parent
bdc7a5c44a
commit
42c1dddc1e
|
@ -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