diff options
author | emkael <emkael@tlen.pl> | 2016-05-23 22:46:57 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-05-23 22:46:57 +0200 |
commit | 64142a33abeb873c248716fadcf527c621c8977b (patch) | |
tree | 8db45e537ef89aec9aa3ee8361cd0b03f94478d1 | |
parent | 07a273bf4d24cdf49521c9ca3c4c88662754e836 (diff) |
* simplified DD trick table validation
-rw-r--r-- | DDTable.cs | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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;
|