Ask Computer Engineering Expert

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

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

Moving

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.

Attachment:- Assignment File.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92228583

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 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