-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyBot.cs
39 lines (31 loc) · 987 Bytes
/
MyBot.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
using System;
using System.Collections.Generic;
namespace Halite
{
public class MyBot
{
public const string MyBotName = "MyC#Bot";
public static void Main(string[] args)
{
Console.SetIn(Console.In);
Console.SetOut(Console.Out);
var map = Networking.GetInit();
Networking.SendInit(MyBotName); // Acknoweldge the init and begin the game
var random = new Random();
while (true)
{
Networking.GetFrame(map); // Update the map
var moves = new List<Move>();
foreach (var site in map.GetMySites())
{
moves.Add(new Move
{
Site = site,
Direction = (Direction)random.Next(5)
});
}
Networking.SendMoves(moves); // Send moves
}
}
}
}