From 143ceb6293911b6dda32ade4f8d08147ba4de938 Mon Sep 17 00:00:00 2001 From: Inanc Gumus Date: Wed, 6 Mar 2019 01:14:01 +0300 Subject: [PATCH] add: notes for the prettyslice pkg to adv. slice ops exercises --- 16-slices/exercises/25-add-lines/main.go | 7 +++++++ 16-slices/exercises/25-add-lines/solution/main.go | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/16-slices/exercises/25-add-lines/main.go b/16-slices/exercises/25-add-lines/main.go index 01a677d..fef3b27 100644 --- a/16-slices/exercises/25-add-lines/main.go +++ b/16-slices/exercises/25-add-lines/main.go @@ -4,6 +4,13 @@ import ( s "github.com/inancgumus/prettyslice" ) +// +// ! NOTE If the program does not work, please update your +// local copy of the prettyslice package: +// +// go get -u github.com/inancgumus/prettyslice +// + // --------------------------------------------------------- // EXERCISE: Add newlines to the lyric sentences // diff --git a/16-slices/exercises/25-add-lines/solution/main.go b/16-slices/exercises/25-add-lines/solution/main.go index 815a74d..127d0d7 100644 --- a/16-slices/exercises/25-add-lines/solution/main.go +++ b/16-slices/exercises/25-add-lines/solution/main.go @@ -14,6 +14,13 @@ import ( s "github.com/inancgumus/prettyslice" ) +// +// ! NOTE If the program does not work, please update your +// local copy of the prettyslice package: +// +// go get -u github.com/inancgumus/prettyslice +// + func main() { // // YOU DON'T NEED TO TOUCH THIS @@ -24,7 +31,7 @@ func main() { // s.Colors(false) // if your editor is light colored then enable this s.PrintBacking = true // prints the backing arrays s.MaxPerLine = 15 // prints max 15 elements per line - s.SpaceCharacter = "*" // print this instead of printing a newline (for debugging) + s.SpaceCharacter = '⏎' // print this instead of printing a newline (for debugging) lyric := strings.Fields(`yesterday all my troubles seemed so far away now it looks as though they are here to stay oh i believe in yesterday`)