From 99bd92bcb98c72980c15a228179d61fc19c7a678 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Mon, 6 Jul 2020 16:16:18 +0100 Subject: [PATCH] adding spaces in the output --- go/tests/prog/range_prog/main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/go/tests/prog/range_prog/main.go b/go/tests/prog/range_prog/main.go index 02053d61c..500658423 100644 --- a/go/tests/prog/range_prog/main.go +++ b/go/tests/prog/range_prog/main.go @@ -4,8 +4,6 @@ import ( "fmt" "os" "strconv" - - "lib" ) func main() { @@ -22,8 +20,14 @@ func main() { fmt.Println(err) return } - for _, i := range lib.IntRange(a, b) { - fmt.Print(i, " ") + fmt.Print(a) + for b != a { + if a < b { + a++ + } else { + a-- + } + fmt.Print(" ", a) } fmt.Println() }