Create a computer program

Assignment Help JAVA Programming
Reference no: EM131587356

CS 251 Intermediate Programming - Word Search Solver

Program Description

For this project, you will create a computer program that can solve word search puzzles.

Your main class (the one with the main method of the program) should be named "Word- Search". It is possible, though very much not recommended, to write your entire program inside of WordSearch.java. I expect most of you will break up the program into multi- ple classes and may have additional main methods used for testing those classes. This is fine, but make sure the actual main method for us to use to run your program is in the WordSearch.java file.

Command Line Arguments
Your program will take two command line arguments.

1. The first argument is the name of the file containing the words your program may find in the puzzle.
Each word will be on a separate line of the file. Make no assumptions about the order of the words. (That is, we may test your program with a word list that is not alphabetized.)
2. The second argument is the name of the file containing the puzzle itself.
The first line of the file contains two numbers separated by a space. The first number is the number of rows in the puzzle and the second is the number of columns in the puzzle.
The remaining lines in the file are the rows of word search puzzle, with no spaces between the letters.

Program Output
Your program will print all the words from the dictionary found in the puzzle, checking all eight possible directions from each spot. It is possible for words to overlap so if, for example,

the puzzle contains the word "catalog", your solution will also include "cat", "at", and "log", as well as "catalog", assuming those words are all in the word list file.
Each line of output will consist of a word found in the puzzle, the row and column where the word started, and the direction from that starting position where the word continues, each separated by spaces.

- When specifying row numbers, the top row of the puzzle is row 0 with row numbers increasing as you move down.
- When specifying columns, the leftmost column is column 0 with column numbers increasing as you move right.
- When specifying directions, we'll use compass directions, so N is up, E is to the right, SW is diagonally down and left, etc.

It is possible that the same word may appear multiple times in the puzzle and, indeed, may even appear twice starting from the same position, so order the lines of output as follows:
- If the words differ, output them in lexicographic order. (That is, just use the natural comparison from the String class to order them.)
- If the words are the same, compare the row numbers and output the line with lower number first.
- If words and row numbers are the same, compare the column numbers and output the line with the lower number first.
- If word, row, and column are the same, compare the direction and order them according to the following: N, NE, E, SE, S, SW, W, NW
These puzzles have very large expected output which would be infeasible to verify man- ually when grading, so your output must match the sample output exactly, including order of the output lines, whitespace, capitalization, etc.

Testing Your Program
I am providing you with several word list files and several puzzle files along with their expected output for testing. The graders will test your code with some of these files as well as some unknown test files.

As I said before, the output for all but the smallest of puzzles is to much to verify by eye, so you should output redirection to capture your programs standard output in a file and then use a utility like diff to compare it with the expected output. (Alternatively, you can use the M-x diff command in emacs to compare them, or some other text comparison program.)

Reference no: EM131587356

Questions Cloud

Weighted average cost of capital for skye corporation : What is the weighted average cost of capital for SKYE Corporation given the following information?
Specific example of technology : Take a specific example of technology and explain how these two have been or might be combined.
Define identify each sentence as passive or active : Identify each sentence as passive or active. Explain why they are passive or active
The stages of organizational growth presents : Discuss which of the first four (4) stages of organizational growth presents the greatest single challenge and why.
Create a computer program : Create a computer program that can solve word search puzzles - Your program will print all the words from the dictionary found in the puzzle.
What is the total manufacturing cost assigned to job : Mickley Company's predetermined overhead rate is $21.00 per direct labor-hour, What is the total manufacturing cost assigned to Job A-500
Discuss the properties of the primitive binomial : Let G be a ring graph with n = 3 vertices and q edges. If G is 2-connected and has no triangles, then q = 2(n - 2) ? Let G be a graph with q edges and P(G).
Provide example of oneway anova that is use in everyday life : Think about the world around you. Provide an example of one-way ANOVA that is used in everyday life, in business, or in science.
What the impact on the business and consumers would be : Choose one of the two bills and tell us what the legislation mandates, what the impact on the business and consumers would be, and whether you agree with it.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Update your website to include a simple web form

Update your website to include a simple web form as discussed in your design document. Use JavaScript to validate the form contents and display the results of that validation to the user in a popup window

  Write a java program consisting of pigdriver and pig

You will write a Java program consisting of PigDriver and Pig.java, that must Display a welcome message, "Let's Play Pig", Display a blank line and Prompt for the name of the human player.

  Java classes that are implementations of the rectangle class

Write a Java application that enables the user to specify the length, width and location of two instances of a PlaneRectangle and check whether the first lies completely within the second.

  String as input and returns the reverse of that string

Write a method that takes a String as input and returns the reverse of that String. Then write a second method that uses the first method to test whether or not an input String is a palindrome.

  Write java program to print price of table-furniture company

Write down the Java program for furniture company. Ask user to select P for Pine, O for Oak or M for Mahogany. Illustrate the price of table produced with chosen wood.

  Java program which handles events from different sources

how to setup a program to respond to events from any one of these sources. How do you create the necessary listener class? How do you associate the listener object with the event source?

  Default and parameterized constructors

Create a class Count with a data member current_count with proper access specifier. Create another tester class (which has main method) to instantiate two counters of Count class.

  String that contains at least five letters

Write an application that prompts the user for a String that contains at least five letters and at least five digits. Continuously reprompt the user until a valid String is entered. Display a message indicating whether the user was successful or did ..

  Write a script that inputs three integers

Write a script that inputs three integers from the user and displays the sum, average, product, smallest and largest of the numbers in an alert dialog2

  Explain auto backup for android applications

Explain Auto Backup for Android Applications. After creating a database, how do you access a database?

  Calculates the cost of a mortgage

Write a class called Mortgage that calculates the cost of a mortgage. Prompt the user to enter the principal amount, the term in years, and the interest rate per year.

  Explain where the following method invocations

Explain where the following method invocations are most likely to be found in a program for dealing with census data organized using the Model, View, Controller (MVC) design pattern. Choices are zero or more of Model, View, and Controller. Be sure to..

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