From 64142a33abeb873c248716fadcf527c621c8977b Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 23 May 2016 22:46:57 +0200 Subject: * simplified DD trick table validation --- DDTable.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'DDTable.cs') diff --git a/DDTable.cs b/DDTable.cs index 31bbd82..7ba8568 100644 --- a/DDTable.cs +++ b/DDTable.cs @@ -32,14 +32,11 @@ namespace BCDD private int[,] validateTable(int[,] table) { - for (int i = 0; i < 4; i++) + foreach (int t in table) { - for (int j = 0; j < 5; j++) + if (t > 13 || t < 0) { - if (table[i, j] > 13 || table[i, j] < 0) - { - throw new DDTableInvalidException("Invalid number of tricks: " + table[i, j].ToString()); - } + throw new DDTableInvalidException("Invalid number of tricks: " + t.ToString()); } } return table; -- cgit v1.2.3