Lab 4: Hangman in Perl!

$24.99 $18.99

Aim: Write a program to play a word-guessing game like Hangman. Let’s get started! Create a directory structure to hold your work for this course and all the subsequent labs: Suggestion: CS202/Lab4 Introduction The word to guess is represented by a row of dashes, giving the number of letters in the word. If the player…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

Aim: Write a program to play a word-guessing game like Hangman.

Let’s get started!

    1. Create a directory structure to hold your work for this course and all the subsequent labs:

      • Suggestion: CS202/Lab4

Introduction

    1. The word to guess is represented by a row of dashes, giving the number of letters in the word.

  1. If the player suggests a letter which occurs in the word, it should write it in all its correct positions

  1. If the suggested letter does not occur in the word, it should draw one element of a hanged man stick figure as a tally mark

    1. The game is over when:

      • The player completes the word, or guesses the whole word correctly – Player Wins!

      • Number of tries exceeds a limit (completes the hangman diagram) – Player loses!

Game Simplified:

    1. It must randomly choose a word from a list of words.

  1. It must stop when all the letters are guessed correctly.

  1. It must give them limited tries and stop after they run out.

    1. It must display letters they have already guessed (either only the incorrect guesses or all guesses).

Suggestions:

    1. If you are familiar with OOP in Perl, use classes whenever/wherever possible to imitate real world objects

  1. If not, then try to modularize your program as much as possible into meaningful subroutines

  1. First get a simple text version of your game correct!!

  1. Then try drawing the hangman as shown in the examples.

ESample List of Words

“computer|radio|calculator|teacher|bureau|police|geometry|president|subject|country|en

viroment|classroom|animals|province|month|politics|puzzle|instrument|kitchen|language|

vampire|ghost|solution|service|software|virus25|security|phonenumber|expert|website|ag

reement|support|compatibility|advanced|search|triathlon|immediately|encyclopedia|endur

ance|distance|nature|history|organization|international|championship|government|popula

rity|thousand|feature|wetsuit|fitness|legendary|variation|equal|approximately|segment|

priority|physics|branche|science|mathematics|lightning|dispersion|accelerator|detector

|terminology|design|operation|foundation|application|prediction|reference|measurement|

concept|perspective|overview|position|airplane|symmetry|dimension|toxic|algebra|illust

ration|classic|verification|citation|unusual|resource|analysis|license|comedy|screenpl ay|production|release|emphasis|director|trademark|vehicle|aircraft|experiment”;

Submitting your work:

  1. All source files and class files as one tar-gzipped archive.

    • When unzipped, it should create a directory with your ID. Example: 2008CSB1001 (NO OTHER FORMAT IS ACCEPTABLE!!! Case sensitive!!!)

  1. Source files should include the following: (Case-Sensitive file names!!)

    • Hangman.pl

    • Any other supporting or required files

  1. Negative marks for any problems/errors in running your programs

  1. If any aspect of the game / rules are confusing, make an assumption and state it clearly in your README file!

  1. README file should also have instructions on how to use/run your program!

  1. Submit/Upload it to Google Classroom

  1. Marks Allocation

    • Correct Text Version [10 points]

    • Graphic Version [+5 points]

    • Coding Style [2 points]

    • README [3 points]

Lab 4: Hangman in Perl!
$24.99 $18.99