I could not find a similar problem here, but I'm trying to write a program in scheme for a class so hints would be very well appreciated! I'm basically confused as to how to implement this but here is an example on how it's supposed to work. (index 5)
is supposed to return the list (1 2 3 4 5)
. I have a couple of ideas, could they work?
I make the argument a global variable which I increment each time I call the function recursively. the problem I've had with this so far is that using set! returns a list but the output would look something like this (#value #value....)
program a simple recursive function that gives the list (5 4 3 2 1) and then reverse it, but would I be able to do that?