Click here to Skip to main content
15,892,797 members
Articles / Programming Languages / C#
Article

BullsAndMagpies

Rate me:
Please Sign up or sign in to vote.
1.80/5 (2 votes)
18 Jul 20062 min read 12.5K   8  
Bulls and Mags is a simple English word game played by two - One of the player must assume a four letter english word with unique letters and the other person attempts to guess the word assumed by trying out some words. Clues will be given based on the word by the player who had guessed the word.

Introduction

Bulls and Mags is a simple English word game played by two - One of the player must assume a four letter english word with unique letters and the other person attempts to guess the word assumed by trying out some words. Clues will be given based on the word by the player who had guessed the word.

Details

One of the player must assume a 4 letter english word that is in compliant to these laws: i.Must have unique alphabets - such as "real" ii.Must be a valid English word - no pronoun such as names of persons, places etc The basic aim of the game is to guess the word assumed by the other player by trying with some words. The player who is attempting to guess the word assumed by the other player can keep trying as many times as needed with the words and the player who has assumed the word will give away clues for each attempt. Here are the laws for the clue: Assume "real" is the chosen word. i. A "bull" is a clue if a letter in the tried word is in the same position as in the chosen word. For instance if "pest" is the tried word - then the letter "e" is in the same position as in the word "real" - so the clue given is "1 Bull." ii. If the tried word is "rest" then the clue is "2 bulls" for the letter "r" and the letter "e". 1ii. If "fake" is the tried word, then the clue is "2 Magpies" This is because the letters "a" and "e" are in both the words but in different positions. It is never possible for a same letter to be a "magpie" or a "bull" because each letter is unique. With these clues the player will have to guess the assumed word in least number of attempts.

Usage

This is a C# console application and can be launched from a DOS box. The system already contains a list of words which are in compliant with the rules of the game that will be chosen randomly. The user can start playing by entering the word and hitting enter for each attempt and the system would give clues. The user can enter 'iquit' to give up trying 'byebye' to exit 'helpme' to display read me.

Footnote

There is nothing great as such in the code and the purpose is just to play the game with the computer.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --