NIT2112: Object Oriented Programming - Victoria University - Mine Puzzle CLI Programming - Computer Science Assessment Answer

Download Solution Order New Solution
Subject Code: NIT2112 Internal Code: 1AIDEJ 

Computer Science Assessment Answer

Assignment Task: Problem Description You are being asked to code the Mine Puzzle game where the coal miners (the coloured circles in the diagram below) walk from the lift on the left of the long, narrow underground tunnel to the coal face on the right. In the middle of the tunnel, there is a small square cave with a space to fit one person only. A blue group of miners walking from the lift towards the coal face meet in the middle of the tunnel orange group of miners walking back towards the lift. The tunnel is too narrow for the miners to pass each other. You are the only player in the game which begins by the computer randomly selecting one to four miners for each group, for example, the diagram shows four blue and three orange miners computer Science assessment Answer Miners can move back a short distance but not all the way to the lift or to the coal face, just far enough for the first or last miner to enter the cave. Only the miner from either end of the combined miner group can enter the cave and conversely, the miner in the cave can only join miners in the tunnel at either end of queue. The miner group nearest the cave always stops at the approach edge of the cave. The challenge for the player is to work out how the two groups of miners can pass each other in the tunnel, in the least number of moves. Player (user) solves the puzzle by instructing the computer to move the miners according to the game’s rules. Part 1 Create a Command Line Interface (CLI) application MinePuzzleCLI that prints to the screen a mine tunnel with the random number of blue and random number orange miners. You will need to do two tasks:
  1. Design and create a class to represent the tunnel with the appropriate attributes and methods. (a) Write the MineTunnel constructor. (b) Write a method of choosing a random number of miners (one to four per group). (c) Write four methods to move the miners to right, left of the cave and to enter or leave the cave. (d) Write other methods as required.
2. Write a class to provide the Command Line interface that will allow the user to play the puzzle game. A sample of a dialogue (menu) follows: computer Science Assessment Answer computer Science Assessment Answer computer Science Assessment Answer computer Science Assessment computer Science Assessment Answer Choose GUI components that reduce user error and provide feedback for the player. “left” and “right” buttons move miners to the left/right of the cave. Button “in” moves a miner into the cave and button “out” returns the miner from the cave to the tunnel. Consider the following as a minimum requirement:
  • Reuse CLI class MineTunnel in GUI Java application.
  • Implement the four action buttons above.
  • One button to reset the game,
  • Text field to display messages such as “Game over”
  • Text field to show the number of moves made.
Red oval around the “in” button shows the last pressed button. Miner was already in the cave so clicking “in” button caused the error message “Cave occupied”. computer Science Assessment Sample Screen Shots The full game is completed in at least 3 moves. Moving blue minors through the cave would require 12 moves. Code Help: Write code marked with stars (//*****) computer Science Assessment ANswer computer Science Assessment ANswer computer Science Assessment ANswer The complete working code for TunnelDrawing class is given here. computer Science Assessment Answer computer Science Assessment Answer computer Science Assessment Answer
This Computer Science Assessment has been solved by our Computer Science experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.