Write an application that reads integer values from keyboard

Write an application that reads integer values from keyboard

Computer Engineering
GUI and Recursion

Read all instructions in this document before starting any coding!

In this assignment, we wrap up the 2048 project. In the third and fourth assignment, you implemented the backend of the game. Now, we will implement the front-end to add some pretty visual effects. This assignment will also include another topic, recursion.

For this assignment you will have two weeks to complete both parts of the assignment. However, this is certainly NOT an assignment intended for one week. Get started early! The GUI implementation can be quite tricky.

Part 1: Reverse Recurse

Write an application that reads integer values from the keyboard into an array whose size is specified by the user (the user may enter fewer integers than the size specified, but not more?) and reverse the elements in the array via two different recursive methods. One method directly modifies the original array.

The other method returns a new array with the elements reversed preserving the original array. Both will use an “ends-and-middle” or “edges-and-center” recursion.

Though the tester code offers a quite complete testing for your code, it doesn’t guarantee that your code will receive a 100% score if it passes the tester (though you can assume your code will receive a pretty high score). So you should also design your own edge cases if possible, and test against your code.

Part 2: GUI 2048

After completing this assignment you will have a fully functioning, graphical 2048 game which you can show off to all of your friends and family. You may even want to show a recruiter or two. You will be graded on look and feel of your final game.

For this assignment you will be utilizing the 2048 backend which you completed in PSA4 (Board.java). While we won’t be grading you on the correctness of your Board.java file we encourage you to fix any bugs you may still have so that you can have a bug free 2048 game by the end of this PSA. One thing you’ll have to make sure you do is place the call to your board’s saveBoard() method inside of a try catch statement (since it currently throws an IOException).

GUI

Your GUI is required to show the score, the name of the game (2048), the tiles with values (and colors which change with values). It is also required to display “Game Over” when the game ends.

Events

You will need to be able to handle keyboard events that occur while focused on your Gui Window. Based on the key pressed you will need to either move (if one of the arrow keys is pressed) or save the board if the “s” key is pressed?. Here is the relevant documentation on key code:

https://docs.oracle.com/javafx/2/api/javafx/scene/input/KeyCode.html

In addition to either moving or saving, you will need to print out (to the terminal)? that you are saving by printing:

Saving Board to <filename>

When an arrow key is pressed AND the move was successful? then you will print:

Moving <Direction>

For example, if the right key was pressed but none of the tiles could move right then “Moving Right” would not print.

Part 3: README.md & Short Response

Remember that the audience of the README description is anyone who knows no programming or computer science. As a rule of thumb, write as if you were writing for an impatient 5-year old boy or a non-computer scientist grandmother. This means use absolutely no Java or CSE terms but high-level terms are fine. Ensure you discuss how you tested the program to ensure it was working as expected.

Order from us and get better grades. We are the service you have been looking for.