box-o-sand/gotime/gotour-artifacts/exercise-slices/main.go

21 lines
284 B
Go
Raw Normal View History

package main
import (
2012-11-06 02:00:35 +00:00
"code.google.com/p/go-tour/pic"
)
func Pic(dx, dy int) [][]uint8 {
2012-11-06 02:00:35 +00:00
cols := make([][]uint8, dy)
for i := range cols {
cols[i] = make([]uint8, dx)
for j := range cols[i] {
cols[i][j] = uint8(j ^ i)
}
}
return cols
}
func main() {
2012-11-06 02:00:35 +00:00
pic.Show(Pic)
}