Created
January 1, 2017 16:54
-
-
Save espaciomore/26fb5053599e42c66465eec14ab7147a to your computer and use it in GitHub Desktop.
Go Tour - Pic
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 "golang.org/x/tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
var p [][]uint8 = make([][]uint8, dy) | |
for i:=0;i<dy;i++ { | |
p[i] = make([]uint8, dx) | |
for j:=0;j<dx;j++ { | |
p[i][j] = uint8((j*i)/10) | |
} | |
} | |
return p | |
} | |
func main() { | |
pic.Show(Pic) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment