Cryptic crosswords you have to decipher the clue to


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 haywire with the fodder storage (6)

The (6) 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. "Gale is" 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.

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 [A|P] dictionary letters

[A|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 dict.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 following output

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.

The solution I have for this assignment takes about 380 lines of code, including white space (blank lines), comments, code that Xcode generates, etc. As part of your subject workload assessment, it is estimated this assignment will take 25 hours to complete.

Solution Preview :

Prepared by a verified Expert
Software Engineering: Cryptic crosswords you have to decipher the clue to
Reference No:- TGS0634579

Now Priced at $45 (50% Discount)

Recommended (97%)

Rated (4.9/5)