Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
CS 4700 Program 1 Ruby Programming (20 Points Check Eagle and class webpage for Due Date)
 

Summary: CS 4700 Program 1 Ruby Programming
(20 Points Check Eagle and class webpage for Due Date)

Guessing Game
For this game, the user will try to guess a word randomly selected from an online dictionary. Create a class to handle
the various functions of the game. The game consists of two parts. In phase 1, you try to guess the computer's secret
word. The game keeps track of the number of guesses it took you to guess the word. In phase 2, the computer tries to
guess your work, and keeps track of the number of guesses. The winner (you or the computer) is the one requiring the
fewest guesses.

Building the dictionary
You can use any dictionary you want. Call the dictionary you use "dictionary.txt". I used sowpods.txt which in an online
scrabble dictionary (google sowpods.txt). Assume the user wants to guess words of length GAMELENGTH. Allow the
user to select GAMELENGTH. I read in the dictionary and stored only the words of length GAMELENGTH. As you read
the words, convert all words to lowercase.

Phase 1
At the beginning of the game, the computer chooses a secret word. This may be any word found in an English dictionary
except those that start with a capital letter and those designated as foreign words.

  

Source: Allan, Vicki H. - Department of Computer Science, Utah State University

 

Collections: Computer Technologies and Information Sciences