This is individual work. You are not allowed to spend more than 6 hours on this test. This includes any reading that you do to help you solve the problems.
Make sure to write your name in the file(s) you submit. You may submit one or two files.
Use helper functions as needed.
All your functions (including all those you use
in big-bang
) must have documentation with the types of
parameters and results, a function description, and, whenever
possible, check-expect
tests.
When defining your own structures, clearly explain what all the fields mean.
Comments, helpful variable names, and good code style and formatting
are a very important part of your grade. You don't have to look for the
shortest solution, but you should eliminate unnecessary code repetition if
possible (use helper functions).
Write a function middle
that consumes a string
and
returns its middle character. If the string has even number of characters, the
one closer to the front is returned. The following are tests for the function.
Please make sure to write the signature and the (more precise) description.
(check-expect (middle "") "")
(check-expect (middle "a") "a")
(check-expect (middle "cat") "a")
(check-expect (middle "orange") "a")
(check-expect (middle "kiwi") "i")
Your goal is to implement a simple "game" with two players: Alex and Pat.
Alex and Pat both start with the score 0. The first player to get the score
of 20 or above wins.
The players names and scores are dispalyed in the upper half of the screen:
Alex to the left, Pat to the right.
Players scores can be increased in the following way:
Implement the die as a picture with the corresponding number of dots: https://en.wikipedia.org/wiki/Dice.
You need to clearly describe what your world state is. You also need to provide signatures an ddescriptions for all your functions (those used in the big-bang and helper functions). Choose informative names for your functions and constants.
If something is not working, please comment it out and write comments about why you think it's not working and how you would be going about fixing it if you had more time. Make sure that the code you submit runs, even if it doesn't implement all of the functionality.
Your work will be graded based on:
Submit all your files as attachements in an email to me. Please include your name and a task number at the beginning of each file, in a comment. In your email message please include any comments about what works and what doesn't, as well as thoughts on how you would've continued if you had more time (if you run out of time). Also please include the total time you spent on the test.