Java game development jump it

Assignment Help Basic Computer Science
Reference no: EM13829605

Problem:

"Jump It" Game

The game "Jump It" consists of a board with n positive integers in a row, except for the first column, which always contains zero. These numbers represent the cost to enter each column. Here is a sample game board with n set to 6:

0   3   80   6   57   10

The objective of the game is to move from the first column to the last column with the lowest total cost. The number in each column represents the cost to enter that column. You always start the game in the first column and have two types of moves. You can either move to the adjacent column or jump over the adjacent column to land two columns over. The cost of a game is the sum of the costs of the visited columns.

In the board shown above, there are several ways to get to the end. Starting in the first column, our cost so far is 0. We could jump to 80, ten jump to 57, then move to 10 for a total cost of 80+57+10=147. However, a cheaper path would be to move to 3, jump to 6, then jump to 10, for a total cost of 3+6+10=19.

Write a recursive solution to this problem that computes the lowest cost of the game and outputs this value for an arbitrary large game board represented as an array. Your program does not have to output the actual sequence of jumps but only the lowest cost of this sequence. After making sure that your solution works on small arrays, test your solution on larger boards with larger values of n to get a feel for the scalability and efficiency of your solution.

Implement the game in a separate class Game. Write a driver that makes use of a Game object in a public class GameDriver that has the main method.

Additional Information:

This question is from Computer Science as well as it explains about developing the game called Jump It. The game is about moving from first column to last column with lowest total cost. This game requires to be developed using Java.

Reference no: EM13829605

Questions Cloud

Statement review makes it lawful for a man to kill a thief : Statement Review makes it lawful for a man to kill a thief
Writing java program which can develop anagrams : An anagram is a rearrangement of the letters of a word or phrase into a new word or phrase. Some of them can be quite amusing or apt. For example:
Class hierarchy to represent geometric figures : Design, build and test a class hierarchy to represent geometric figures including circles, triangles, squares, rectangles, polygons, and hexagons. Implement just minimum number of methods per each class to reflect a distinctive characteristic of a..
Statement review the dictum that truth always triumphs : Statement review the dictum that truth always triumphs
Java game development jump it : The game "Jump It" consists of a board with n positive integers in a row, except for the first column, which always contains zero. These numbers represent the cost to enter each column. Here is a sample game board with n set to 6:
Write an essay on copying of computer software : The problem is belongs to Sociology and the problem is describe about writing an essay on copying of computer software and its de-criminalization.
What are the internal rates of return for the projects : what are the internal rates of return for the following projects?
Polymorphic class hierarchy for sets and bags : Implement the following Set class. A set is a collection of items with no duplicates. The following class implements a set of integers.
What means do you use to develop supporting ideas : Is there a time of day when you're more effective? Do you prefer working in isolation or in the company of others? Are you more productive composing at a keyboard or with pen and paper?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What happens when you assign

What happens when you assign 340,282,343,598.33 to a Single variable? Assuming that the variable in question is named sngNumber and you execute the statement MessageBox.Show

  Which ease of learning conflicted with ease of use

Consider at least two (2) software products that you use or have used in the past. Provide at least two (2) examples in which ease of learning conflicted with ease of use. Propose a solution to the conflicts that you have indicated. Justify your resp..

  Explain dispatcher and data access object design

Prepare a two page paper comparing and contrasting five of design. Dispatcher - controls client access and re-directs or dispatches client requests to proper party which can be located on same or different tier.

  Write an expression that returns a random value

Write an expression that returns a random value between 1 and 100. The values 1 and 100 must be included in the values that can be returned.

  Common information security threats

Common Information Security Threats

  Choose one of special walks: euler circuit

Choose one of special walks: Euler circuit, Hamiltonian cycles, or shortest path tree. Provide an example of how the walk can be used to identify an issue on a network or to solve a routing problem.

  Write a recursive method

Write a recursive method that converts an integer into its English language Equivalent. intToEnglish(4500007) -> four million five hundred thousand seven

  What is the order of the public key?

the weaknesses that arise in Elgamal encryption if a public key of small order is used. We look at the following example. Assume Bob uses the group Z ? 29 with the primitive element ?= 2. His public key is ?= 28.

  Explain the difference between data and information

Give your own best definition of information, and explain the difference between data and information. Your response should be at least 200 words in length. You are required to use at least your textbook as source material for your response. All sour..

  Which of these conditions returns true

Which of these conditions returns true? Check the Java documentation for the inheritance patterns.

  Are robots remotely controlled by humans really robots

Are robots remotely controlled by humans really robots?

  Find the big theta for execution time of recurrence

How to find the big theta for execution time of recurrence algorithm and the big theta for memory.

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