6.11.0.4

Week 5 Set a

home work!

Programming Language BSL+

Due Date Mon at 9:00pm (Week 5)

Purpose It is time to evolve the turkey-gobble game program to deal with lists of turkeys. You may also have noticed that the finger exercises help with your actual exercises.

Finger Exercises

Exercise 1 Design the function smallest, which determines the smallest number on a non-empty list of numbers.

Graded Exercises

Exercise 2 Design the function closest. It consumes a non-empty list of Posns and produces the 0-based index (N) of the Posn that is closest to the origin. If there is more than one Posn that is closest, the function returns the index of the first (leftmost) Posn.

Exercise 3 Your software architect has approved your wish list from exercise 3, Week 4 Set c.

In case you have any doubts about your wish list, see a member of the staff during office hours and walk through at least one wish (name, signature, purpose, examples/tests). You must come as a pair.

Now add test cases that exploit the fact that the turkey game can deal with more than two turkeys.