Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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.)

Java, Programming

  • Category:- Java
  • Reference No.:- M92396070
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Java

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As