feat: solved day 15 part 2
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
namespace WarehouseWoes;
|
||||
|
||||
static class PuzzleParser
|
||||
{
|
||||
public static (Map Map, List<Direction> Directions) Parse(string input)
|
||||
{
|
||||
var inputParts = input.Split($"{Environment.NewLine}{Environment.NewLine}");
|
||||
|
||||
var map = WarehouseMap.From(inputParts[0].Split(Environment.NewLine));
|
||||
|
||||
var directions = inputParts[1]
|
||||
.Where(character =>
|
||||
{
|
||||
var str = character.ToString();
|
||||
return str != "\r" && str != "\n" && str != "\r\n";
|
||||
})
|
||||
.Select(Direction.From)
|
||||
.ToList();
|
||||
|
||||
return (map, directions);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user