Description
P6 exercises your understanding of the functional programming paradigm and Scheme.
Submitted programs must:
1) provide the requested functionality
2) be readable & documented (thorough but concise)
3) use Scheme appropriately (do NOT write a C-style program)
4) be relatively robust
ALL ASSUMPTIONS SHOULD BE REASONABLE AND CLEARLY STATED
Chicken- Scheme has been installed on cs1, see reference for implementation: http://wiki.call-cc.org/
csi is the interpreter. Experimentation with basic Scheme using the interpreter is recommended
csc is the compiler, which will be needed to test your program before submission.
Files are to be uploaded to both Canvas AND cs1
Every student has an account under dingle/submit/16sq3400/YourEmailHandle (-@seattleu.edu)
Submit your files under p6
Scheme reference texts abound, including: http://www.cs.rutgers.edu/~paull/LANG_SCHEME1.pdf
Construct Scheme code as follows:
1) implement at least two of the following functions
a. skewed multiple, given two values m & n and a list L of numbers:
i. multiple each element a of L by m, if a < n
ii. multiple each element a of L by (m-3), if a > n
b. skewed addition, given a value p and a list L of integers:
i. add p to each odd element a of L
c. skewed removal, given two values r & s, r != s, and a list L of integers:
i. remove each element a of L, where a is a multiple of r
ii. replace each element a of L with -1, where a is a multiple of s
2) implement at least one of the following functions
a. skewed concatenation, given two lists of numbers, L1 & L2:
i. tack L1 onto the end of L2, if L1 is smaller than L2
ii. insert L2 into the middle of L1, if L2 is smaller than L1
b. skewed merge, given two lists of numbers, L1 & L2:
i. merge L1 & L2
1. after swapping the first two elements of L1, if L1 is smaller than L2
2. after swapping the first two elements of L2, if L2 is smaller than L1
TEST YOUR PROGRAM BEFORE SUBMISSION
Name your Scheme file: P6.scm
upload to cs1 (as noted above) AND Canvas