Lecture overview -- Keyboard shortcut: 'u'  Previous page: Structured Programming -- Keyboard shortcut: 'p'  Next page: Observations about Structured Programming -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 3 : 22
Object-oriented Programming in C#
Introduction to Object-oriented Programming
A structured program: Hangman

A sketch of Hangman 2006 - seen as a structured program

In this lecture we start out by showing a structured program for the well-known Hangmang game. In the hangman game the player is supposed to guess the letters of word or word phrase outline. The game is similar to the TV-game Wheel of Fortune. Each erroneous guess in Hangman is punished. The ultimate punishment is to be sent to the gallows.

At the end of the lecture, we will outline an object-oriented version of the Hangman program.

/user/normark/oop-csharp-1/sources/other-sources/c/hangman-06/hangman.cThe main function of the Hangman program.


/user/normark/oop-csharp-1/sources/other-sources/c/hangman-06/hangman.cThe function getPlayerName of main.


/user/normark/oop-csharp-1/sources/other-sources/c/hangman-06/hangman.cThe function initHangman of main.


/user/normark/oop-csharp-1/sources/other-sources/c/hangman-06/hangman.cThe function askUser of main.


/user/normark/oop-csharp-1/sources/other-sources/c/hangman-06/hangman.cThe function playHangman of main.


/user/normark/oop-csharp-1/sources/other-sources/c/hangman-06/hangman.cThe function InitGame of playHangman.


/user/normark/oop-csharp-1/sources/other-sources/c/hangman-06/puzzles.cThe function getPuzzle of playHangman.


 

Etc., etc...

Go to exerciseHow did you program the Hangman game?