On this page:
1 Preparation
2 Finger Exercises with Abstraction
3 Abstract invader
4 Many More Invaders
5 Project submission
6.10

Assignment 7: Abstract Invasion!

Due: Monday, October 23, 11:59:59 PM EST. (extended!)

The following should be completed in cooperation with your latest assigned partner. (Partner assignments are listed on Piazza.) You may not share code for this assignment with anyone but your partner.

You must use the design recipe and The Style guidelines to receive full credit.

We’ve created an assignment skeleton assign7.zip for you to edit, please download the archive and edit the files you find inside. You must not change any file names – we will only grade the files named in the skeleton.

1 Preparation

Make sure you have read and studied Chapters 14, 15, and 16 of Part III of HtDP2e.

2 Finger Exercises with Abstraction

Edit the file abs.rkt for this part of the assignment. Add your information to the standard file header at the top of the file.

Complete exercises 250–255 from HtDP2e Part 3.

3 Abstract invader

Copy your code from the invaders-shoot.rkt in assignment 6 into the provided file invaders-abs.rkt for this part of the assignment. Edit the standard file header at the top of the file. Submit only invaders-abs.rkt for this part of the assignment, not the original invader-shoot.rkt.

Update: you may start from a canonical solution to assignment 6 if you’d prefer: invaders-shoot-dvanhorn-abourg.rkt.

Keeping exactly the same functionality as in assignment 6, rewrite your program in ISL using the list abstraction functions we’ve seen so far, such as filter, map, foldr, andmap, and ormap.

4 Many More Invaders

Continue this section in the same file as the last section (invaders-abs.rkt).

Our TAs still complain that the single-row-of-invaders version of the game is too easy for them. Modify your game to support multiple rows of an arbitrary number of invaders that can all shoot at the base.

Note:
  • It should be easy to modify the program to change the number of rows of invaders.

  • Only the bottom row of invaders can shoot at the base.

  • Once the bottom row has been eliminated, the next row up becomes the bottom (and can start shooting).

  • Each invader can shoot at its own regular interval. These intervals should vary invader-to-invader to make the game interesting.

Your final version should also use list abstraction functions wherever appropriate (but you may find it easier to first design the enhanced game without them).

5 Project submission

You should submit both of the provided files: abs.rkt and invaders-abs.rkt.

Submit your files directly to the submit server by uploading them. Select each of these files individually using the “Browse” button. Once you have selected all the files, press the “Submit project!” button. You do not need to put them in a zip file.