Due Date: Friday, 16 March
Objectives
Familiarity with
- Separation of concerns between content, visual styles, and event handling code
- XHTML forms
- Event handling
- JavaScript
- Document object model (DOM)
- Cookies
- Automated testing
- Selenium testing IDE
Description
In this project, you will develop an interactive, browser-based Black Jack game, in which one player (the user) plays against the bank (the application).Functional Requirements (50%)
The rules of the game are as follows:- First, the player starts a new game. At that point, the player must first bid some money for this game.
- Next, the player and the bank receive two cards each.
- Now, after bidding, the player can either request another card or pass.
- If the player chooses to receive another card, then one of the following happens:
- If the player's score is within the limit, then the player can again request another card or pass.
- If the player's score exceeds the limit, then the player loses immediately.
- If the player passes, then the bank takes more cards until it decides to pass (using some algorithm) or exceeds the limit, and the following applies:
- If the bank's score is within the limit, then the player's score is compared with the bank's score; if the player's score is higher, then the player wins, else the player loses.
- If the bank's score exceeds the limit, then the player wins.
- After the game ends (player wins or loses), the player can start another new game.
- The application keeps track of the total number of games played and the number of times the player has won. This information is displayed each time the game ends (player wins or loses).
- In addition, this information (total played, total won) is stored in a client-side cookie so that it continues to be available even if the user closes the browser between games. The application also provides the option to reset this information.
Look and Feel (10%)
The look and feel of the application must be both attractive and effective. There should be no unnecessary reloading of pages. For example, when the user requests a new card, an image of the new card should show up immediately in the designated area of the window. You should use playing card images such as the ones available here.Nonfunctional Requirements (10%)
- All content must be valid XHTML 1.1 documents. You are advised to use a validating editor or the W3C Validation Service to ensure that your content is valid. For convenience, you may want to place a link on each document that runs the validation service on this document. Your document should state the correct document type at the top.
- All rendering styles must be provided using a single shared valid CSS2 style sheet. There must not be any rendering styles in the documents themselves. You are advised to use a validating editor or the W3C CSS Validation Service to verify that your style sheet is valid.
- All code must be provided in the form of external JavaScript source files. The code must be object-oriented; in particular, there must be a class for the event handling code and a separate class for the game model (domain-specific, UI-independent functionality). Any event handlers must be registered by the JavaScript code itself instead of using event handling attributes in the XHTML document.
Automated Testing (20%)
Use the Selenium testing IDE to develop tests that cover all of the various branches listed above. More details will be provided later.Documentation (10%)
The following documentation is required:- Sufficient inline documentation (comments) in your JavaScript code for me to comprehend your work
- A brief readme document (200-300 words, in XHTML) describing the overall approach and architecture
References
Submission
Please submit the complete URL of the home page of your project under project 2 in the assignments section in Blackboard.