Star Enigma
Star Enigma
Star Enigma
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace _04._Star_Enigma
{
class Star_Enigma
{
static void Main(string[] args)
{
byte noOfLines = byte.Parse(Console.ReadLine());
List<Planet> planets = new List<Planet>();
string splitter = @"@(?<planet>[A-Za-z]+)([^@\-!:>]*):(?<population>[0-
9]+)([^@\-!:>]*)!(?<attacType>[AD])!([^@\-!:>]*)->(?<solderCount>[0-9]+)";
for (int i = 0; i < noOfLines; i++)
{
string pl = splittedMessage.Groups["planet"].Value;
int pp = int.Parse(splittedMessage.Groups["population"].Value);
string atype = splittedMessage.Groups["attacType"].Value;
int sc = int.Parse(splittedMessage.Groups["solderCount"].Value);
return new Planet(pl, pp, atype, sc);
}
return lettersKey.Count();
}
}
class Planet
{
public Planet(string planetname, int planetpopulation, string attacktype,
int soldercount)
{
PlanetName = planetname;
PlanetPopulation = planetpopulation;
AttackType = attacktype;
SolderCount = soldercount;
}
public string PlanetName { get; set; }
public int PlanetPopulation { get; set; }
public string AttackType { get; set; }
public int SolderCount { get; set; }
}
}