Level | 4 or 5 | |
---|---|---|
Learning Objectives | Class, Property, Constructor, private/public, UI separation, algorithm | . |
Prior knowledge required | Method, GUI, Basic Types, If. | |
Challenge Type | Programming, Algorithm. |
Gallows is a game where a player must guess the word than the computer has in mind. Assignment: write gallows and use the object-oriented capabilities of C#
.
classes
to be programmed: Word
and Form1
(form).property
to be programmed in the class
Word: Number ofLetters.method
in the class
Word: pool IsGood(string word)
.classes
to be programmed: Word, PlayStatus, Form1.properties
in the class
Word: Number ofLetters (read-only property
).methods
in the class
Word: pool IsGood(string word)
.property
in the class
PlayStatus: TheWord of the type
Word (that is, NOT of the type string
).class
PlayStatus you can add methods
and/or properties
that track the status of the game such as the number of letters guessed.class
Player and make sure that two people can play the game against each other (against the computer).Class
Player has a property
of the type
PlayStatus and various methods
that you invent yourself. The form gets 2 Player objects and no other objects.