Subject Code : NIT2112
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.

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.

computer Science Assessment ANswer computer Science Assessment ANswer computer Science Assessment ANswer  computer Science Assessment Answer computer Science Assessment Answer computer Science Assessment Answer

This NIT2112: Computer Science Assignment has been solved by our Computer Science Experts at UniLearnO. 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.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Eureka! You've stumped our genius minds (for now)! This exciting new question has our experts buzzing with curiosity. We can't wait to craft a fresh solution just for you!

  • Uploaded By : Finn
  • Posted on : February 11th, 2019

Whatsapp Tap to ChatGet instant assistance