Scheme Exercises
using the SchemeInterpreter engine by Joshua Chin

Exercise Groups

Exercise List

Name Description
FactorialThe archetypical recursive function.
FibonacciThe famous sequence
IncrementAdding one
Mean-2Average of 2 numbers
Circle-areaCalculate the area of a circle
Absolute valueThe absolute value of a number
Max2Largest of two numbers
sum2Sum of two numbers.
getOnesDigitExtract the ones digit from an integer.
DistanceCalculate the distance between two coordinates.
getTensDigitExtract the tens digit from an integer.
Max3Largest of 3 values
Max4Largest of 4 values
Two-part functionA function that has two parts, deciding between two alternative answers.
Three-part functionA function with three different behaviors
Multi-branch decisionExercise with "cond"
Three-part function (2)A function with three different behaviors (using cond)
getNthDigitRetrieve the nth digit of a number
getNthDigitFrom0version of getNthDigit, done recursively and counting the least significant digit as digit 0
List LengthImplement a recursive length function
Count Evens of ListCount the number of even integers in a list of integers.
rev3Reverse the elements of a 3-element list
explode3explode a 3-digit number into the list of its digits
implode3implode a 3-element list of digits into a number
remove-oneRemove one of the elements of a 3 element list
numdigitsCount the number of digits of a positive integer
sumDigitsAdd up the digits of a positive number
medianmedian will return the median of a sorted list of numbers
positionOfFind the position of the first occurrence of an element inside a list
lastPositionOfFind the position of the last occurrence of an element inside a list
myReverseReverse the order of the elements of a list
ChangeBaseChange a number from one base-representation to another base-representation
NextPrimeFind the next prime at or after a given number
Deep Reversereverse the order of elements even deep inside sublists
SequenceCreate a list -- an increasing sequence of integers
AllEven?Are all the numbers in the list even?
ExplodeExplode an integer into a list of its digits
ImplodeCreate a number from a list of its digits
Newton's GravityCalculate the force between two objects using Newton's Law of Gravity
discriminantCalculate the discriminant of a quadratic.
Quadratic Solver PlusFind a root of a quadratic equation!
Which QuadrantDetermine the quadrant of the specified point.
averageAverage of 3 numbers
parity-matchDo the two arguments have the same parity?
is-small-primeIs the given number between 2 and 10 a prime?
is-medium-primeIs the given number between 2 and 100 a prime?
closer-toIs the first number closer to the second number or to the third number?
Is between?Is the first number between the second and third?