Question
2 1 0 3 1 6 1 0 8 8 8 8 0 1 6 6 2 9 8 2 9 6 6 6 1
2 1 0 3 1 6 1 0 8 8 8 8 0 1 6 6 2 9 8 2 9 6 6 6 1 1 9 1 2 3 6 1 4 0 7 3 4 4 6 4 0 7
The data above is given as a text file.
1-Write a java program that passes the text file into your program as a command line argument
2- (Pattern recognition: four consecutive equal numbers) write a that method print out the number of horizontal, vertical, and diagonal matches it found in the file, this method must test whether the data in this file has four consecutive numbers of the same value, either horizontally, vertically, or diagonally, and displays true if the array contains four consecutive numbers with the same value. Otherwise, display false.
3- "isConsecutiveFour" method must print out the number of horizontal , vertical , and diagonal matches it found in the file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started