Created
November 12, 2017 16:58
-
-
Save jbranchaud/d2e09481a242401f5904aeb452e01a3d to your computer and use it in GitHub Desktop.
This file contains 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 picArray [][]uint8 | |
picArray = make([][]uint8, 0, dy) | |
for i := 0; i < dy; i++ { | |
var currX []uint8 | |
currX = make([]uint8, 0, dx) | |
for j := 0; j < dx; j++ { | |
currX = append(currX, uint8((i+j)/2)) | |
} | |
picArray = append(picArray, currX) | |
} | |
return picArray | |
} | |
func main() { | |
pic.Show(Pic) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment