From 74ced229ca6bf25d3d8cb8cdb82bdeca34856604 Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 23 May 2016 15:58:18 +0200 Subject: * parsing and printing double-dummy trick table --- Program.cs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'Program.cs') diff --git a/Program.cs b/Program.cs index e0a7149..814edce 100644 --- a/Program.cs +++ b/Program.cs @@ -18,6 +18,37 @@ namespace BCDD { Console.WriteLine("Analyzing " + filename); PBNFile file = new PBNFile(filename); + foreach (PBNBoard board in file.Boards) + { + DDTable table = new DDTable(board); + String boardNo; + try + { + boardNo = board.GetNumber(); + } + catch (FieldNotFoundException) + { + boardNo = "?"; + } + try + { + int[,] ddTable = table.GetDDTable(); + if (ddTable != null) + { + Console.WriteLine("Board " + boardNo); + DDTable.PrintTable(ddTable); + } + else + { + Console.WriteLine("ERROR: unable to determine DD table for board " + boardNo); + } + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Console.WriteLine(e.StackTrace); + } + } } Console.WriteLine("Press any key to continue..."); Console.ReadLine(); -- cgit v1.2.3