You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Xavier Petit 08b3df53e0
Improve range & reverse subjects & correct implementations
4 years ago
..
README.md Improve range & reverse subjects & correct implementations 4 years ago

README.md

reverserange

Instructions

Write a program that takes two numbers as arguments and prints the consecutive values that begins at the second number and end at the first number (including the values of those numbers !).

Errors should be handled.

If the number of arguments is different from 2 the program prints nothing.

Usage :

student@ubuntu:~/reverserange$ go build
student@ubuntu:~/reverserange$ ./reverserange 1 3
3 2 1
student@ubuntu:~/reverserange$ ./reverserange -1 2 | cat -e
2 1 0 -1$
student@ubuntu:~/reverserange$ ./reverserange 0 0
0
student@ubuntu:~/reverserange$ ./reverserange 0 -3
-3 -2 -1 0
student@ubuntu:~/reverserange$ ./reverserange 0 nan | cat -e
strconv.Atoi: parsing "nan": invalid syntax$
student@ubuntu:~/reverserange$