-
Notifications
You must be signed in to change notification settings - Fork 0
/
Challenge1.cs
138 lines (88 loc) · 3.93 KB
/
Challenge1.cs
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
public class Person
{
public string Name { get; set; }
public int posX { get; set; }
public int posY { get; set; }
public int health { get; set; }
// public Person(string name, int age)
// {
// Name = name;
// Age = age;
// }
// Other properties, methods, events...
}
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
class Player
{
static void Main(string[] args, Person[] heroes)
{
string[] inputs;
inputs = Console.ReadLine().Split(' ');
int baseX = int.Parse(inputs[0]); // The corner of the map representing your base
int baseY = int.Parse(inputs[1]);
int heroesPerPlayer = int.Parse(Console.ReadLine()); // Always 3
// game loop
while (true)
{
for (int i = 0; i < 2; i++)
{
inputs = Console.ReadLine().Split(' ');
int health = int.Parse(inputs[0]); // Each player's base health
int mana = int.Parse(inputs[1]); // Ignore in the first league; Spend ten mana to cast a spell
}
int entityCount = int.Parse(Console.ReadLine()); // Amount of heros and monsters you can see
for (int i = 0; i < entityCount; i++)
{
inputs = Console.ReadLine().Split(' ');
int id = int.Parse(inputs[0]); // Unique identifier
int type = int.Parse(inputs[1]); // 0=monster, 1=your hero, 2=opponent hero
int x = int.Parse(inputs[2]); // Position of this entity
int y = int.Parse(inputs[3]);
int shieldLife = int.Parse(inputs[4]); // Ignore for this league; Count down until shield spell fades
int isControlled = int.Parse(inputs[5]); // Ignore for this league; Equals 1 when this entity is under a control spell
int health = int.Parse(inputs[6]); // Remaining health of this monster
int vx = int.Parse(inputs[7]); // Trajectory of this monster
int vy = int.Parse(inputs[8]);
int nearBase = int.Parse(inputs[9]); // 0=monster with no target yet, 1=monster targeting a base
int threatFor = int.Parse(inputs[10]); // Given this monster's trajectory, is it a threat to 1=your base, 2=your opponent's base, 0=neither
// STORE HERI
if(type == 1 && x==0 && y==00){
Person person = new Person();
person.Name="MIGNON" + id;
person.posX=x;
person.posY=y;
Console.Error.WriteLine(person.Name);
Console.Error.Write(person);
}
}
for (int i = 0; i < heroesPerPlayer; i++)
{
// Find all Person instances
//Check Action todo
//Write in console the action
// Write an action using Console.WriteLine()
// To debug: Console.Error.WriteLine("Debug messages...");
// In the first league: MOVE <x> <y> | WAIT; In later leagues: | SPELL <spellParams>;
// Console.WriteLine("MOVE 4500 4500");
// Console.WriteLine("MOVE 2000 2000");
// Console.WriteLine("MOVE 6500 3000");
}
}
}
}
//Project: Crate 3 laners (bottom, top, middle)
// Define their zones
//MOVE INTO ZONE if Limit go backwards
// if One laner dies redfine two lanes for each laner left
// If one laner left retrat to base
//If one of our hero is protecting the safe zone, other hero can slay
// Else one hero has to retreat