- full ruleset
This commit is contained in:
weiss
2020-04-10 10:11:45 +02:00
parent 3e8a95a6b1
commit 149e4173d0
4 changed files with 91 additions and 47 deletions

View File

@@ -32,14 +32,16 @@ exports.parseInput = function(numSites) {
for (let i = 0; i < numSites; i++) {
var inputs = readline().split(' ');
var siteId = parseInt(inputs[0]);
var ignore1 = parseInt(inputs[1]); // used in future leagues
var ignore2 = parseInt(inputs[2]); // used in future leagues
var mineGold = parseInt(inputs[1]); // The total number of gold remaining to be mined from this site (-1 if unknown)
var maxMineSize = parseInt(inputs[2]); // The maximum rate that a mine can extract gold from this site (-1 if unknown)
var structureType = parseInt(inputs[3]); // -1 = No structure, 2 = Barracks
var owner = parseInt(inputs[4]); // -1 = No structure, 0 = Friendly, 1 = Enemy
var param1 = parseInt(inputs[5]);
var param2 = parseInt(inputs[6]);
sites.push({
id: siteId,
gold: mineGold,
maxMineSize,
structureType,
owner,
param1,

View File

@@ -23,7 +23,9 @@ type SiteInfo =
type ProtoSite =
{ id :: Int
, structureType :: Int -- -1 No structure, 2 Barracks
, gold :: Int -- The total number of gold remaining to be mined from this site (-1 if unknown)
, maxMineSize :: Int -- The maximum rate that a mine can extract gold from this site (-1 if unknown)
, structureType :: Int -- -1 No structure, 0 Goldmine, 1 Tower, 2 Barracks
, owner :: Int -- -1 No structure, 0 friendly, 1 enemy
, param1 :: Int -- -1 No structure, else turns till training
, param2 :: Int -- -1 No structure, barracks: 0 knight 1 archer
@@ -34,6 +36,8 @@ type Site =
, x :: Int
, y :: Int
, radius :: Int
, gold :: Int
, maxMineSize :: Int
, structureType :: Int
, owner :: Int
, param1 :: Int