Correct answer for this Java problem will get thumbs up and eternal thanks Problem Description Over…

Correct answer for this Java problem will get thumbs up and
eternal thanks
Problem Description
Over the course of this semester you will write a chess game
database that will import chess games in PGN
(http://www.saremba.de/chessgml/standards/pgn/pgn- complete.htm)
format. As a first step you will write code to read PGN games and
resolve board positions.
Solution Description
Write a class called PgnReader that contains the following
public static methods:
tagValue takes two String arguments: a tag name and a String
which contains a PGN-formatted game, and returns a String
containing the value from the tag name tag pair in the PGN game
text. If there is no tag name tag pair, return “NOT GIVEN” .

finalPosition takes a single String argument which contains a
PGN-formatted game and returns a String containing the game’s final
position in Forsyth-
Edwards Notation (FEN
(http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm#c16.1)).
Write a main method that reads the file named in the PgnReader
’s first command-line argument into a String and uses that String
as the argument to each method above in order to print game
information to the console. First, print the tag names and
associated values for the core seven tags of the PGN standard:
Event, Site, Date, Round, White, Black, Result. Then print a line
reading “Final Position:” and a line displaying the final game
position in FEN. Note that in this assignment we only care about
the piece placement data, not the other elements of FEN such as
active color or castling availability.
Each PGN file will contain a single game and you may assume that
the PGN files are valid, and the move text contains only moves, no
annotation text. Moves may end in check symbols (‘+’) or strength
judgements (‘!’, ‘?’).
As your program reads the moves in a game it will need to
maintain the state of the board, which you should store in a 2-d
array. You will also need to translate between the algebraic
notation used to represent moves in PGN, and the internal
representation you use for board state, e.g., array indices.
You may use this skeleton file which contains a completed main
method and code to read a file and return its content as a String :
PgnReader.java. This skeleton file also contains stubbed tagValue
and finalPosition methods. A stubbed method is a method that
returns a dummy type-correct value (if applicable) so that you can
successfully compile code that uses the method. Stubbed methods are
useful in incremental program development. You will want to write
many helper methods.

Grading
There are 20 bonus points on this assignment.
50 points for correctly extracting tag values.

10 points for correctly finding final position of simple games or
openings , scholars-mate.pgn

10 points for correctly finding final position of games that
contain castling moves

10 points for correctly finding final position of games that
contain pawn promotions

10 points for correctly finding final position of games that
contain en passant pawn captures

10 points for correctly finding final position of games that
contain moves requiring disambiguation of starting file or rank
(but not both) to distinguish between two pieces that could make
the same move

10 points for correctly finding final position of games that
contain moves requiring disambiguation of starting file and rank to
distinguish between two pieces that could make the same move

10 points for correctly finding final position of games that
require knowledge of tactics (e.g., pinned pieces) to disambiguate
to distinguish between two pieces that could make the same move

—————————————————————————————Necessary
files—————————————————————————————

—————————————————————————————PgnReader.java—————————————————————————————
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class PgnReader {

/**
* Find the tagName tag pair in a PGN game and return its value.
*
* @see http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm
*
* @param tagName the name of the tag whose value you want
* @param game a `String` containing the PGN text of a chess game
* @return the value in the named tag pair
*/
public static String tagValue(String tagName, String game) {
return “NOT GIVEN”;
}

/**
* Play out the moves in game and return a String with the game’s
* final position in Forsyth-Edwards Notation (FEN).
*
* @see http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm#c16.1
*
* @param game a `Strring` containing a PGN-formatted chess game or opening
* @return the game’s final position in FEN.
*/
public static String finalPosition(String game) {
return “”;
}

/**
* Reads the file named by path and returns its content as a String.
*
* @param path the relative or abolute path of the file to read
* @return a String containing the content of the file
*/
public static String fileContent(String path) {
Path file = Paths.get(path);
StringBuilder sb = new StringBuilder();
try (BufferedReader reader = Files.newBufferedReader(file)) {
String line = null;
while ((line = reader.readLine()) != null) {
// Add the n that’s removed by readline()
sb.append(line + “n”);
}
} catch (IOException e) {
System.err.format(“IOException: %s%n”, e);
System.exit(1);
}
return sb.toString();
}

public static void main(String[] args) {
String game = fileContent(args[0]);
System.out.format(“Event: %s%n”, tagValue(“Event”, game));
System.out.format(“Site: %s%n”, tagValue(“Site”, game));
System.out.format(“Date: %s%n”, tagValue(“Date”, game));
System.out.format(“Round: %s%n”, tagValue(“Round”, game));
System.out.format(“White: %s%n”, tagValue(“White”, game));
System.out.format(“Black: %s%n”, tagValue(“Black”, game));
System.out.format(“Result: %s%n”, tagValue(“Result”, game));
System.out.println(“Final Position:”);
System.out.println(finalPosition(game));

}
}

—————————————————————————————fegatello.pgn—————————————————————————————
[Event “Fegatello Attack”]
1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. Ng5 d5 5. exd5 Nxd5 6.
Nxf7

———————————————————————————————————————————————————————————————–
Using the fegatello.pgn (/fall2017/hw1/fegatello.pgn), a shell session with your program would look like this: $ java PgnReader fegatello.pgn Event: Fegatello Attack Site: NOT GIVEN Date: NOT GIVEN Round: NOT GIVEN White: NOT GIVEN Black: NOT GIVEN Result: NOT GIVEN Final Position: r1bqkb1r/ppp2Npp/2n5/3np3/2B5/8/PPPP1PPP/RNBOK2R Domain Knowledge You don’t need to know how to play chess, you only need to know how the pieces and pawns move and how to record chess moves. Use the following links for this purpose: Learn to Play Chess (http://www.chesscorner.com/tutorial/learn.htm) – You only need to read the information under “Rules of Chess.” Chess Notation (http://www.chesscorner.com/tutorial/basic/notation/notate.htm) look at abbreviated algebraic notation. And, of course, you need to know the PGN Standard (http://www.saremba.de/chessgm/standards/pgn/pgn-complete.htm). You only need sections 2.3, 8.1-8.2.3.6, 16.1.3.1 and 16.1.4. PGN is simple, and you can learn it well enough by simply looking at example PGN games.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more