Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A tour of Go exercise2
package main
import (
"code.google.com/p/go-tour/pic"
)
func Pic(dx, dy int) [][]uint8 {
image := make([][]uint8, dy)
for i := range(image) {
image[i] = make([]uint8, dx)
}
for i := 0 ; i < dy; i++ {
for j := 0 ; j < dx; j++ {
image[i][j] = uint8( i + j )
}
}
return image
}
func main() {
pic.Show(Pic)
}
@siisee11

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment