-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarsLander.cs
More file actions
48 lines (41 loc) · 1.93 KB
/
Copy pathMarsLander.cs
File metadata and controls
48 lines (41 loc) · 1.93 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
string[] inputs;
int surfaceN = int.Parse(Console.ReadLine()); // the number of points used to draw the surface of Mars.
for (int i = 0; i < surfaceN; i++)
{
inputs = Console.ReadLine().Split(' ');
int landX = int.Parse(inputs[0]); // X coordinate of a surface point. (0 to 6999)
int landY = int.Parse(inputs[1]); // 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)
{
inputs = Console.ReadLine().Split(' ');
int X = int.Parse(inputs[0]);
int Y = int.Parse(inputs[1]);
int hSpeed = int.Parse(inputs[2]); // the horizontal speed (in m/s), can be negative.
int vSpeed = int.Parse(inputs[3]); // the vertical speed (in m/s), can be negative.
int fuel = int.Parse(inputs[4]); // the quantity of remaining fuel in liters.
int rotate = int.Parse(inputs[5]); // the rotation angle in degrees (-90 to 90).
int power = int.Parse(inputs[6]); // the thrust power (0 to 4).
// Write an action using Console.WriteLine()
// To debug: Console.Error.WriteLine("Debug messages...");
if (vSpeed <= -40)
Console.WriteLine("0 4");
else
Console.WriteLine("0 0");
// 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).
}
}
}
}