Browse Source

Fix test (for real this time)

pull/655/head
xpetit 4 years ago
parent
commit
a18dc001f0
No known key found for this signature in database
GPG Key ID: 97C60669182C17A5
  1. 15
      go/tests/prog/reverserange_prog/main.go

15
go/tests/prog/reverserange_prog/main.go

@ -3,10 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"os" "os"
"sort"
"strconv" "strconv"
"lib"
) )
func main() { func main() {
@ -23,10 +20,14 @@ func main() {
fmt.Println(err) fmt.Println(err)
return return
} }
suite := lib.IntRange(a, b) fmt.Print(b)
sort.Sort(sort.Reverse(sort.IntSlice(suite))) for a != b {
for _, i := range suite { if b < a {
fmt.Print(i) b++
} else {
b--
}
fmt.Print(" ", b)
} }
fmt.Println() fmt.Println()
} }

Loading…
Cancel
Save