Hello all, I'm going for my masters and for the first time ever I am having a hard time with a programming language. This scheme is incredibly hard for me for some reason. The assignment is as follows:
I have a list, make a function that returns false only if the parameter is a list which contains a subsequence of 2 atoms or 2 lists in a row.
So I need a function that goes through a list and returns true if the members alternate between list and atom.
I spent hours trying to use a cond statement, now I'm trying with Ifs. So I know I will need recursion obviously. Here is what I am thinking:
1.Make sure the paramter is a list.
2. If the car is an atom, then check the ctr, if this is an atom, return false.
3.If the car is a list(else)? I want to check the ctr, if it's a list then return false, if it's not a list then call the function again.
I just can't figure this out, I have read online and my notes and I have stared at it for hours trying to come up with something.