Due date: 2/4 @ noon
Objective: to implement interfaces; to develop additional interfaces
Your first task is to translate other use cases for Carcassonne into refinements of the graph interface and additional, new interfaces.
Task 1: Specifically, exploit the take-a-turn use case to develop an interface for the game administrator and the player. [POINTS: 4]
Task 2: Your second task is to study the end-of-game use case. Develop new interfaces, if needed, and refine existing interfaces with new entries. [POINTS: 4]
My description of the "take a turn" use case follows:
start turn administrator grants player a turn including a placeable tile player requests possible places for tile player chooses one of these feasible places administrator evaluates a player's tile placement: did the placement of the tile complete any regions? if so, score each region (how many of whose followers are in each newly compeleted region) if so, return followers to players player may receive call-back returning followers player may also be informed of a score player now checks whether a follower is available if so, request places where follower could be placed then decide whether/where to place follower player chooses one of these feasible places or skips end of turn
Here is a collection of Scheme class interfaces and data definitions for the representation of the central classes of data of this game:
I chose Scheme because it is a neutral language for most of you and because most of the signatures (contracts, purposes) are actually expressed informally. That means those of you who choose a scripting language see how to use the design recipe, and those of you who choose a typed language can still translate these statements into typed method signatures and interface-like expressions.
Task 3: Your task is to implement classes in your chosen programming language. Your implementation must be faithful. In particular, we must be able to plug someone else's class into your program, and your program should at least compile and mostly run. NOTE 1: There is no question that the informal purpose statements are open to interpretation or that the plugged-in class is faulty. Still, it should be possible to plug in other people's code and get things to run. That's the real world. NOTE 2: The POINT comments with the interfaces tell you how much the implementation of each interface counts. You will need all of them eventually but if you are running out of time, you may restrict the scope of the project with trivial implementations of peripheral things and focus on the others instead. Of, vice versa, you can try to get as many points from the easy interfaces, and get the rest done later.
Task 4: Your last task is to ponder the following question:
Why do the methodsAs you may know, I am a (non-radical) "functional programmer" who prefers to return values rather than modifying them where possible. It is thus possible that I just went too far here. [POINTS: 3]
Product: Mail a tar bundle with two subdirectories labeled Interfaces (tasks 1 and 2) and Carcassonne (task 3). Place the relevant pieces into the subdirectories and add a README file to make sure your graders can compile and run the program. If you answer the question in task 4, include the answer in the README file and specify as such.
|last updated on Tue Jun 9 22:03:19 EDT 2009||generated with PLT Scheme|