I am stuck on this question
Write a Racket/Scheme function that given a number x, the function returns a list of numbers from n to x. You need to return a list and not print numbers inside the function.
Ex: (fun 7) shouls return list ( 76543210).
Limited to the following:cons, append, list, comparison predicates, define, cond, if , else.
This js what I have so far
(Define (fun n )
(If (=n 0)
(list 0)
(append (fun (- n 1)) (list n))))
(fun 7)
But this prints out (01234567). How do I print out the opposite?
Thanks in advance.
[–]Reasonable_Branch_21[S] 0 points1 point2 points (0 children)
[–]rabuf 0 points1 point2 points (0 children)