|
//|---------------------------------------------------------------|
//| HANGMAN GAME |
//| Developed by Yewondwossen Tadesse(Wonde) |
//| Version 1.0.0.0 |
//| Copyright © 2010 |
//|---------------------------------------------------------------|
//| HANGMAN GAME |
//|---------------------------------------------------------------|
using System;
using System.Collections.Generic;
using System.Text;
namespace Hangman_Game
{
/// <summary>
/// Class which holds a collection of words for the hangman game
/// </summary>
public class Words : List<Word>
{
/// <summary>
/// Class which holds a collection of words for the hangman game
/// </summary>
public Words()
{
this.Add(new Word("COMPLY"));
this.Add(new Word("THREE"));
this.Add(new Word("VACATION"));
this.Add(new Word("INFORMATION"));
this.Add(new Word("TECHNOLOGY"));
this.Add(new Word("ORLANDO"));
this.Add(new Word("COMPUTER"));
this.Add(new Word("ROUTER"));
this.Add(new Word("PRINTER"));
this.Add(new Word("BUDGE"));
this.Add(new Word("SOFTWARE"));
this.Add(new Word("HARDWARE"));
this.Add(new Word("OBJECTIVE"));
this.Add(new Word("FIlE"));
this.Add(new Word("EMPLOYEE"));
this.Add(new Word("SECURITY"));
this.Add(new Word("DATA"));
this.Add(new Word("REPORT"));
this.Add(new Word("PROPERTY"));
this.Add(new Word("OWNERSHIP"));
}
/// <summary>
/// Pick a random word
/// </summary>
/// <returns></returns>
public Word Pick
{
get
{
Random RandomPick = new Random();
int index = (int)(RandomPick.NextDouble() * this.Count);
Word word = this[index];
word.Content = word.Content.ToUpper();
return word;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
MSCS, MCTS, Senior Software Engineer,
Architect, Craftsman, The Ultimate DEV ...
Azure Series