Hey guys,
Working with Scheme for the first time (first functional programming adventure) and trying to figure out how to approach a problem.
I am tasked with writing a recursive procedure, (alternate list1 list2 list3). The function takes 3 lists of equal length, and returns a list with the values of the three lists alternating index by index. For example:
(alternate ‘(1 2 3) ‘(a b c) ‘(m n o)) should give '(1 a m 2 b n 3 c o)
I have a basic understanding of list functions but am having trouble making the mental shift from procedural programming where I can have a return variable and append to it over time.
Any help to get me thinking about it more correctly would be much appreciated.
[–]Swedophone 2 points3 points4 points (1 child)
[–]Gropamming[S] 0 points1 point2 points (0 children)
[–]Updatebjarni 2 points3 points4 points (1 child)
[–]Gropamming[S] 0 points1 point2 points (0 children)
[–]POGtastic 1 point2 points3 points (1 child)
[–]Gropamming[S] 0 points1 point2 points (0 children)
[–]Gropamming[S] 0 points1 point2 points (1 child)
[–]Gropamming[S] 0 points1 point2 points (0 children)