Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by roywe on 9/3/2017.
- */
- import java.util.*;
- public class Main {
- public static void main(String []args)
- {
- boolean run = true;
- System.out.println("Enter amount of cubes");
- Scanner UI = new Scanner(System.in);
- Cube[] cube = new Cube[UI.nextInt()];
- CubeTower ct = new CubeTower(cube.length, 0, cube);
- while(run) {
- System.out.println("Choose an action");
- System.out.println("1 - Add cube");
- System.out.println("2 - Remove cube");
- System.out.println("0 - Quit");
- switch (UI.nextInt()) {
- case 1:
- ct.addCube();
- break;
- case 2:
- ct.minusCube();
- break;
- case 0:
- run = false;
- break;
- default:
- break;
- }
- System.out.println("There are " + ct.getCubes() + " cubes");
- }
- }
- }
Add Comment
Please, Sign In to add comment