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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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