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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

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

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