6.7

Assignment 10

home work!

Programming Language BSL or BSL+

Due Date Thurs 2/16 at 11:59pm

Possible Points 106

Purpose To design a large program.

Typaholic!

Your assignment this week is to implement Typaholic! in big-bang. Typaholic! is a type-training video game in which words fall from the sky and stack up as they reach the bottom. If you enter a word as it falls the word is cleared from the screen. Once it has reached the bottom, though, it is stuck there. The game ends when a newly-generated falling word overlaps with a stuck word. Here is a link to a sample video of gameplay.

If you would like your game to look like the one in the video, the following are the graphical constants that were used:
(define GRID-HEIGHT 40)
(define GRID-WIDTH 40)
(define CELL-HEIGHT 15)
(define CELL-WIDTH 15)
(define ACTIVE-COLOR "green")
(define TYPING-COLOR "purple")
(define STUCK-COLOR "red")
(define SCENE-HEIGHT (* GRID-HEIGHT CELL-HEIGHT))
(define SCENE-WIDTH (* GRID-WIDTH CELL-WIDTH))
(define SCENE (empty-scene SCENE-WIDTH SCENE-HEIGHT))

Details:

Feel free to extend the game with additional functionality (down arrow speeding up the game, a loading menu, words moving sideways, being able to use left/right arrows when typing, etc.) but no extra credit will be given unless all of the above specifications are met and the design recipe is followed.

Hints:
  • The output of big-bang is the last state the world was in before someone quits or stop-when returns #true. Use this last state to compute the score.

  • on-tick is the most complex part of this game. Break it down into the steps it takes and use helpers. Keep in mind every function should have one job (this is always true). Take care in the order you call the helper functions, too, so you don’t do something like move falling words before you check whether or not they need to become stuck words.

  • We recommend adding the following two functions to your wishlist:
    ; maybe-generate-new-moving-word : ? -> ?
    ; Maybe generate a new moving word if it's the appropriate time
     
    ; generate-new-moving-word/text : ? String -> ?
    ; Generate a new moving word with this text
    where ? is your data definition for the world.

  • Start early.

  • Test thouroughly.

  • Adhere to the design recipe the entire way through.

  • Come to office hours if you need any help or just want to check that you’re on the right track.

Note: This homework, unlike every other this semester, is designed to be equivalent to two assignments (which is why we did not have a Monday assignment this week). Because of this, it will be graded as two homework assignments. For example, if the grade received is 93/106, the student will receive a 53/53 and a 40/53. This is done so that the "drop the lowest grade" policy cannot be abused. It will have ultimately little effect on students who complete the assignment. Beware the grade displayed on blackboard will be out of 106. This splitting calculation will be done at the end of the semester by the course staff.