From 42c1dddc1e36dc8509783035968b8b786268cb94 Mon Sep 17 00:00:00 2001 From: "Stephen M. McQuay" Date: Thu, 2 Aug 2012 15:04:24 -0600 Subject: [PATCH] exercise the third --- exercise02/go.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 exercise02/go.go diff --git a/exercise02/go.go b/exercise02/go.go new file mode 100644 index 0000000..e75ce69 --- /dev/null +++ b/exercise02/go.go @@ -0,0 +1,18 @@ +package main + +import "code.google.com/p/go-tour/pic" + +func Pic(dx, dy int) [][]uint8 { + result := make([][]uint8, dy) + for j := 0; j < dy; j++ { + result[j] = make([]uint8, dx) + for i := 0; i < dx; i++ { + result[j][i] = uint8(i) ^ uint8(j) + } + } + return result +} + +func main() { + pic.Show(Pic) +}