Cryptic crosswords - create a simple command line program

Assignment Help Programming Languages
Reference no: EM13302882

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

Reference no: EM13302882

Questions Cloud

Determine the required width a of the plate : A steel plate 5/16" thick is embedded in a horizontal concrete slab and is used to anchor a high-strength cable as shown. The diameter of the hole in the plate is 3/4", the ultimate strength of the steel used is 36 ksi
Obtain the activity of the radioactive material : A device used in radiation therapy for cancer contains 6.20×10-1 g of cobalt 2760Co (59.9333819 u). Determine the activity of the radioactive material
Is this a profitable agreement for wrc : If WRC's cost of capital is 12% per year, is this a profitable agreement for WRC?
Determine the allowable load p for the safety factor : a plane truss is subjected to a loads 2P and P at joints B and C, respectively, as shown in figure part a.The truss bars are made of two L102 x 76 x 6.4 stell angles having an ultimate stress tension equal to 390 MPa (cross-sectional are of the tw..
Cryptic crosswords - create a simple command line program : Decipher the clue to determine the word. One of the standard tricks of cryptic crossword creators is to use anagrams
Determine the half-life of this isotope : The isotope 88224Ra of radium has a decay constant of 1.19×10-6 per second. What is the half-life (in days) of this isotope
What is the average accounts receivable figure : Size of Accounts Receivable- Tidwell, Inc., has weekly credit sales of $19,400, and the average collection period is 34 days. The cost of product is 75 percent of the selling price. What is the average accounts receivable figure?
Determine the specfic discharge and average linear velocity : The potentiometric surface elevations at two observation wells 1000 m apart are 52.35 m and 56.90 m. If the horizontal hydraulic conductivity of the auquifer is 25 m/ day determine the specfic discharge, and average linear veolicity of the flow as..
Find the half-life of the material : In 9.00 days the number of radioactive nuclei decreases to one-eight the number present initially

Reviews

Write a Review

Programming Languages Questions & Answers

  Applying constraints in program

You will require to set up constants in program for given: number of square feet per square yard.

  Design psuedocode program to calculate amount

Design a psuedocode program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day.

  Create program that asks user to enter series of numbers

Create a program which asks the user to enter a series of 20 numbers. The program must determine whether number is valid by comparing it to following list of valid charge account numbers:

  General layout for a web-based source document

Suggest the general layout for web-based source document that prospective sellers could use to explain their antiques. Information must include the user ID, password, item, dimensions, origin, condition, and asking price.

  Write program which accepts input values-store tem in array

Write a program which accepts five input values and stores them into array. Program must display those five numbers in reverse order.

  Program to help gymnasium help desk associate

Write a program that helps a gymnasium help desk associate to answer questions about membership cost. The rates are as follows.

  Describe purpose of keyword super in programs

Describe purpose of keyword 'super' in programs

  Design an appropriate set of classes to solve the problem

The purpose of this project is for you to demonstrate your understanding of object oriented software development in practice.

  Write program to compute integer remainder

Write program segments which accomplish each of the following:  Compute the integer part of quotient when integer a is divided by integer b.

  Develop the application to show coffee customer orders

Develop the application which shows the total pounds of coffee customer orders, sales tax, and total price of order. Write down the name the solution, project, and form file Jason Coffee Solution, Jason Coffee Project.

  Write program to calculate amount a person earn

Write a program that calculates the amount a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day.

  Define four user-defined exceptions

You will need to define four user-defined exceptions; one for unknown movies, one for unknown member, one for unknown payment method.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd