-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRandomBot.cs
39 lines (31 loc) · 928 Bytes
/
RandomBot.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 RandomBot
{
public const string RandomBotName = "RandomC#Bot";
public static void Main(string[] args)
{
Console.SetIn(Console.In);
Console.SetOut(Console.Out);
var map = Networking.GetInit();
Networking.SendInit(RandomBotName);
var random = new Random();
while (true)
{
Networking.GetFrame(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
}
}
}
}