Decipher the clue to determine the word one of the standard


BACKGROUND

When doing cryptic crosswords, two problems often arise.

1. Letter Patterns

You cannot work out the clue but know a number of letters because of other words intersecting with the one you want to figure out.
For example, the clue might be "left handed" and you know the following pattern of letters

_O_T_P_W

The underscore represents the letters you don't know. See if you can figure it out. The answer is given further down.

2. Anagrams

In cryptic crosswords you have to decipher the clue to determine the word. One of the standard tricks of cryptic crossword creators is to use anagrams. That is, taking a word or set of words and rearranging the order to get a new word.

For example

Gale is going haywi re with the fodder storage

The says the answer is a single word 6 letters long. The hint here is the word "haywire", which is indicating we have to shuffle letters around to get the answer. "Gal e i s" is six letters long and an anagram of that is "silage", which is the storage of grain and fodder. We have our answer.

Unfortunately, it can often be quite difficult to work out the anagram if it uses a lot of letters and the word we want is obscure.

Create a simple command line program which will help solve these problems.

because decease defense despise genoese genoise pelisse pentose recluse relapse release remorse reprise repulse reverse ventose verbose Number of matching words found = 17

Example 3

Crossword A dict.txt arid

Will produce the following output

arid dari raid Number of matching words found = 3

ASSIGNMENT OBJECTIVES

The purpose of this assignment is to demonstrate competence in the following skills.

Program design

Array and string manipulation

NSFoundation classes including NSString, NSNumber, NSArray, NSMUtableArray

Command line arguments

File handling

Creating methods in Objective C

Creating classes in Objective C

These tasks reflect all the subject objectives.

STARTING THE PROGRAM

Your program must use command line arguments. Assuming your program has been compiled to crossword. exe you would run with the following command line arguments.

Crossword [AIP] dictionary letters

[Al P]
This says we must either supply the letter A or the letter P as part of the command line arguments.

A We are looking for words in the dictionary that are an anagram of the letters supplied.

P We are looking for words in the dictionary that match the pattern of letters supplied.

dictionary

In order to solve the problem you will need a dictionary of words to check your letters against, looking for possible matches. The dictionary will have one word per line of file. As part of the assignment I will supply a dictionary file called di ct . txt, which contains about 64000 words to test against. It can be assumed that the dictionary only contains alphabetical letters. It contains no spaces, digits or punctuation characters.
letters

Letters can be in two forms

1. A set of alphabetical letters. It contains no spaces, digits or other punctuation characters. The letters can be any case. This will be used with the A argument. Your program will find all words in the dictionary that are an anagram of the letters.

2. A set of alphabetical letters and underscores. It contains no spaces, digits or other punctuation characters. The letters can be any case. This will be used with the P argument. Your program will find all words in the dictionary that match the pattern of letters.

OUTPUT

The program will output all the words it finds matching the pattern/anagram plus a count of the words found.

Example 1

Crossword P dict.txt _O_T_P_W

Will produce the following output

southpaw

Number of matching words found = 1

Example 2

Crossword P dict.txt _e_se

Will produce the output

Solution Preview :

Prepared by a verified Expert
Programming Languages: Decipher the clue to determine the word one of the standard
Reference No:- TGS0641574

Now Priced at $70 (50% Discount)

Recommended (92%)

Rated (4.4/5)