Created
July 11, 2013 11:28
-
-
Save kakkun61/5974649 to your computer and use it in GitHub Desktop.
My answer for http://go-tour-jp.appspot.com/#35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
pic := make([][]uint8, dy) | |
for y := 0; y < dy; y++ { | |
pic[y] = make([]uint8, dx) | |
} | |
for y, pr := range pic { | |
for x := range pr { | |
pr[x] = uint8(x*y) | |
} | |
} | |
return pic | |
} | |
func main() { | |
pic.Show(Pic) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment