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

  Design and implement a graphical user interface program

Design and implement a Graphical User Interface (GUI) program in Java. Use several classes from the AWT and Swing graphics packages.

  Java socket hello i need to this assignment done in net

hello i need to this assignment done in net beans . and i want comment in code .also screen shots of running program

  Traditionally-nutrition programs were targeted to indigent

Traditionally, nutrition programs were targeted to the indigent and poor populations in developing countries. Many of today's Americans are malnourished also, but they are glutted with a wealth of unhealthy foods and require a multidisciplinary appro..

  Write paper about focuses on the popularity of java

You will write a 4-5-page research-oriented paper in APA format that focuses on the "Popularity of Java"

  Simulate the transactions of a checking account

create a base class, called CBankAccount, and two additional classes (each derived from CBankAccount), called CSavingsAccount and CCheckingAccount.

  Write a simulation of the memory management

CO2017 - Exercise 2 - Java Threads. You will write a simulation of the memory management component of an operating system. The system will use simple direct memory management

  What should a comment at the class level contain

How do you identify a comment so the Javadoc tool will recognize it and what should a comment at the class level contain?

  Create your own short and simple jdbc java code

Create your own short and simple JDBC Java code example that inserts 2 records into an Oracle table of your creation. Post your fully functional code along with screen shots demonstrating the successful running of it.

  Question hierarchy of section

Add a class AnyCorrectChoiceQuestion to the question hierarchy of Section 9.1 that allows multiple correct choices. The respondent should provide any one of the cor- rect choices. The answer string should contain all of the correct choices, separa..

  Writing a program to manage a student database

Writing a program to manage a student database. The interface to the program should be a GUI that looks similar to the following: A combo box should allow the user to select one of the three database actions shown

  Create an application with a jframe and five labels

Create an application with a "JFrame" and five labels that contain the names of five friends. Every time the user clicks a "JButton", remove one of the labels and add a different one. Save the file ass JDisappearingFriends.java

  Establish a connection to the mycustomers database

Write a Java program to establish a connection to the MyCustomers database using the JDBC driver to retrieve the entire Customers and Orders table.

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