I'm trying to solve the slices exercise. My current solution is
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
picture := make([][]uint8, dy)
x := dx
for iy := 0; iy < dy; iy++ {
picture[iy] = make([]uint8, dx)
for ix := 0; ix < dx; ix++ {
x = (x+dy)/2
picture[iy][ix] = uint8(x)
}
}
return picture
}
func main() {
pic.Show(Pic(1,2))
}
But I'm getting the following error
tmp/sandbox931798243/main.go:23: cannot use Pic(1, 2) (type [][]uint8) as type func(int, int) [][]uint8 in argument to pic.Show
What am I doing wrong? Might that be a bug with the sandbox?