-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestRobot.java
More file actions
31 lines (22 loc) · 901 Bytes
/
TestRobot.java
File metadata and controls
31 lines (22 loc) · 901 Bytes
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
package com.example;
import com.example.robot.Robot;
public class TestRobot {
public static void main(String[] args) {
Robot robot1 = new Robot(1, 0, 0);
Robot robot2 = new Robot(2, 2, 3);
Robot robot3 = new Robot(3, -1, -1);
int totalRobots2 = Robot.getCount();
System.out.println("Nombre total de robots (via un objet Robot) : " + totalRobots2);
robot1.Avancer(2);
robot2.Tourner(1);
robot3.Avancer(3);
robot3.Tourner(12);
robot1.Affiche();
System.out.println("Numéro du robot : " + robot1.getNum());
robot2.Affiche();
System.out.println("Numéro du robot : " + robot2.getNum());
robot3.Affiche();
System.out.println("Numéro du robot : " + robot3.getNum());
System.out.println("Nombre total de robots (via la classe Robot) : " + Robot.getCount());
}
}