1
0
gotour-notes/exercises/02-pic/go.go
2012-08-02 15:24:14 -06:00

19 lines
299 B
Go

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)
}