-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
71 lines (42 loc) · 2.02 KB
/
Copy pathMain.java
File metadata and controls
71 lines (42 loc) · 2.02 KB
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
65
66
67
68
69
70
71
// Program: Gravity Simulation
// Course: COSC 460
// Description: This program simulates and graphically displays the
// interaction of entities under the influence of gravity
// in an infinite, two-dimensional space.
// (Assumes no other forces are present besides gravity)
// Author: Connor Sullivan
// Revised: December 2016
// Language: Java
// IDE: NetBeans 8.2
// *****************************************************************************
// *****************************************************************************
// Class: Main
// Description: Contains the main method for the program
class Main {
static KeyboardInputClass kb;
static Simulation s;
// *************************************************************************
// Method: main
// Description: Main method of the program
// Parameters: args
// Returns: Nothing
// Calls: KeyboardInputClass, Simulation
// Globals: kb, s
public static void main(String[] args) {
System.out.println("\n\nGravity Simulator: by Connor Sullivan\n");
kb = new KeyboardInputClass();
while (true) {
if (kb.getInteger(true, 1, 0, 1, "\nPress ENTER to launch new simulation (0 to exit program):") == 1) {
s = new Simulation();
s.addBodies();
s.simulationMenu();
} else {
System.out.println("\nExiting program...\n");
System.exit(0);
}
}
}
// *************************************************************************
}
// *****************************************************************************
// *****************************************************************************