-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetInput.jack
64 lines (64 loc) · 2.92 KB
/
getInput.jack
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
class getInput {
function void getInput() {
var int num;
var int ax1, ay1, ax2, ay2, bx1, by1, bx2, by2, cx1, cy1, cx2, cy2, dx1, dy1, dx2, dy2;
do Board.newInstance();
do Output.moveCursor(0, 0);
let ax1 = Keyboard.readInt("Enter row start value for 3 block ship 1: ");
let ay1 = Keyboard.readInt("Enter column start value for 3 block ship 1: ");
do Output.moveCursor(0, 43);
do Output.backSpace();
do Output.moveCursor(1, 46);
do Output.backSpace();
do Output.moveCursor(0, 0);
let ax2 = Keyboard.readInt("Enter row end value for 3 block ship 1: ");
let ay2 = Keyboard.readInt("Enter column end value for 3 block ship 1: ");
do Output.moveCursor(0, 43);
do Output.backSpace();
do Output.moveCursor(1, 46);
do Output.backSpace();
do Output.moveCursor(0, 0);
let bx1 = Keyboard.readInt("Enter row start value for 2 block ship 2: ");
let by1 = Keyboard.readInt("Enter column start value for 2 block ship 2: ");
do Output.moveCursor(0, 43);
do Output.backSpace();
do Output.moveCursor(1, 46);
do Output.backSpace();
do Output.moveCursor(0, 0);
let bx2 = Keyboard.readInt("Enter row end value for 2 block ship 2: ");
let by2 = Keyboard.readInt("Enter column end value for 2 block ship 2: ");
do Output.moveCursor(0, 43);
do Output.backSpace();
do Output.moveCursor(1, 46);
do Output.backSpace();
do Output.moveCursor(0, 0);
let cx1 = Keyboard.readInt("Enter row start value for 3 block ship 3: ");
let cy1 = Keyboard.readInt("Enter column start value for 3 block ship 3: ");
do Output.moveCursor(0, 43);
do Output.backSpace();
do Output.moveCursor(1, 46);
do Output.backSpace();
do Output.moveCursor(0, 0);
let cx2 = Keyboard.readInt("Enter row end value for 3 block ship 3: ");
let cy2 = Keyboard.readInt("Enter column end value for 3 block ship 3: ");
do Output.moveCursor(0, 43);
do Output.backSpace();
do Output.moveCursor(1, 46);
do Output.backSpace();
do Output.moveCursor(0, 0);
let dx1 = Keyboard.readInt("Enter row start value for 2 block ship 4: ");
let dy1 = Keyboard.readInt("Enter column start value for 2 block ship 4: ");
do Output.moveCursor(0, 43);
do Output.backSpace();
do Output.moveCursor(1, 46);
do Output.backSpace();
do Output.moveCursor(0, 0);
let dx2 = Keyboard.readInt("Enter row end value for 2 block ship 4: ");
let dy2 = Keyboard.readInt("Enter column end value for 2 block ship 4: ");
do Screen.clearScreen();
do Board.newInstance();
do Ships.newInstance(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2, cx1, cy1, cx2, cy2, dx1, dy1, dx2, dy2);
do Output.moveCursor(0, 0);
return;
}
}