-
Notifications
You must be signed in to change notification settings - Fork 0
/
MarsLanderEpisode1.java
56 lines (50 loc) · 1.68 KB
/
MarsLanderEpisode1.java
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
/*
* Author: Robin Péricé (2018)
*/
package main.java.solutions.practice.classicPuzzles.easy;
import java.util.Scanner;
/**
* Auto-generated code below aims at helping you parse the standard input
* according to the problem statement.
**/
class Player {
public static void main(final String args[]) {
final Scanner in = new Scanner(System.in);
final int surfaceN = in.nextInt(); // the number of points used to draw
// the
// surface of Mars.
for (int i = 0; i < surfaceN; i++) {
final int landX = in.nextInt(); // X coordinate of a surface point.
// (0 to
// 6999)
final int landY = in.nextInt(); // Y coordinate of a surface point.
// By
// linking all the points together in a
// sequential fashion, you form the
// surface of Mars.
}
// game loop
while (true) {
final int X = in.nextInt();
final int Y = in.nextInt();
final int hSpeed = in.nextInt(); // the horizontal speed (in m/s),
// can be
// negative.
final int vSpeed = in.nextInt(); // the vertical speed (in m/s), can
// be
// negative.
final int fuel = in.nextInt(); // the quantity of remaining fuel in
// liters.
final int rotate = in.nextInt(); // the rotation angle in degrees
// (-90 to
// 90).
final int power = in.nextInt(); // the thrust power (0 to 4).
// Write an action using System.out.println()
// To debug: System.err.println("Debug messages...");
// 2 integers: rotate power. rotate is the desired rotation angle
// (should be 0 for level 1), power is the desired thrust power (0
// to 4).
System.out.println(Math.abs(vSpeed) >= 40 ? "0 4" : "0 0");
}
}
}