Homework 2: Letter Guessing Game

Short Description:

Develop a program that plays a hangman like game.

This assignment is worth 25 points.

Goals

When you finish this homework, you should

Formal Description

Write a program that plays a hangman like game. This program should work in a web browser and be written in a combination of html and javascript.

You should have a hard coded array of words. You may not make all of these words the same length. Each game will start by having the program select one of these words at random as the goal word. The goal word is the word the player is trying to guess. The game should then build a gameboard.

The game board consists of three areas.

  1. The upper left-hand quadrant is for drawing the "score" for the game. This will contain the image from homework 1 if the player loses the game. It should start with any "support" graphics such as the gallows.
  2. The upper right hand quarter of the board should contain the 26 letters of the alphabet. They should be colored as follows The letters should be arranged in a 5x5 grid, with the letter z in the sixth row, directly under the letter x. The
  3. The bottom half of the board should display one blank for each letter in the goal word. The line of blanks should be centered vertically. Each blank should be evenly spaced across the board. As the player correctly guesses letters, the letters should be displayed centered on the appropriate blank. The blanks should be 30% wider than the widest letter.

Your program should include a simple user interface. You should have an input area that requests a guessed letter, and a button that submits the guess. You may make this more fancy if you wish, but these are the minimum requirements.

Guess a letter (a-z) :

Discussion

Documentation

Your main web page should contain instructions for playing your game, as well as identification information and any documentation needed to understand your program.

Additional Requirements/Comments

Submission

When you have finished your assignment, please submit a tar file containing all files needed for this project. Please do not post your project on line until after grades have been assigned.

If you have created any javascript text files that are included in your program, please make sure that the file extension is not .js. Mail clients will reject tar files containing files with a .js extension. Please use the extension .prog.

Submit your tar file as an attachment to a message to dbennett@endinboro.edu. Please include your name, and the fact that this is homework 1 in the title of the message.