Skip to content

Instantly share code, notes, and snippets.

View MAJA-Lin's full-sized avatar
💭
Looking for new opportunity

Scott Lin MAJA-Lin

💭
Looking for new opportunity
View GitHub Profile
@MAJA-Lin
MAJA-Lin / answer_pic.go
Last active August 29, 2015 14:18 — forked from tetsuok/answer_pic.go
From tetsuok/answer_pic.go An answer for [GO:Exercise: Slices] http://tour.golang.org/moretypes/14
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
// Allocate two-dimensioanl array.
a := make([][]uint8, dy)
for i := 0; i < dy; i++ {
a[i] = make([]uint8, dx)
}