trackler 2.2.1.14 → 2.2.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/c/docs/INSTALLATION.md +1 -1
- data/tracks/csharp/exercises/binary-search/BinarySearchTest.cs +2 -2
- data/tracks/csharp/exercises/poker/Example.cs +69 -20
- data/tracks/csharp/exercises/poker/PokerTest.cs +152 -82
- data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +4 -4
- data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +4 -4
- data/tracks/csharp/exercises/word-count/Example.cs +2 -2
- data/tracks/csharp/exercises/word-count/WordCount.cs +2 -2
- data/tracks/csharp/exercises/word-count/WordCountTest.cs +85 -87
- data/tracks/csharp/generators/Exercises/Pangram.cs +0 -1
- data/tracks/csharp/generators/Exercises/Poker.cs +19 -0
- data/tracks/csharp/generators/Exercises/RomanNumerals.cs +0 -1
- data/tracks/csharp/generators/Exercises/WordCount.cs +27 -0
- data/tracks/csharp/generators/Output/NameExtensions.cs +6 -4
- data/tracks/delphi/{docs → exercises/hello-world}/GETTING_STARTED_GUIDE.md +0 -0
- data/tracks/go/config.json +629 -618
- data/tracks/go/config/maintainers.json +33 -33
- data/tracks/go/exercises/accumulate/README.md +0 -3
- data/tracks/go/exercises/hello-world/example.go +0 -2
- data/tracks/go/exercises/hello-world/hello_test.go +0 -20
- data/tracks/go/exercises/hello-world/hello_world.go +1 -36
- data/tracks/go/exercises/leap/leap.go +0 -1
- data/tracks/go/exercises/leap/leap_test.go +7 -3
- data/tracks/go/exercises/two-fer/README.md +66 -0
- data/tracks/go/exercises/two-fer/example.go +9 -0
- data/tracks/go/exercises/{hello-world/example_helloworld_test.go → two-fer/example_two_fer_test.go} +9 -9
- data/tracks/go/exercises/two-fer/two_fer.go +15 -0
- data/tracks/go/exercises/two-fer/two_fer_test.go +20 -0
- data/tracks/go/gen/gen.go +11 -10
- data/tracks/python/exercises/change/change_test.py +7 -2
- data/tracks/rust/config.json +1 -0
- data/tracks/rust/docs/ABOUT.md +1 -1
- data/tracks/scala/exercises/nth-prime/example.scala +2 -2
- data/tracks/scala/exercises/nth-prime/src/test/scala/NthPrimeTest.scala +29 -0
- data/tracks/scala/testgen/src/main/scala/NthPrimeTestGenerator.scala +34 -0
- metadata +12 -7
- data/tracks/fsharp/appveyor.yml +0 -4
- data/tracks/fsharp/circle.yml +0 -16
- data/tracks/scala/exercises/nth-prime/src/test/scala/PrimeTest.scala +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99df2b52d78a5aa4268f1eefde99a24ab1f7fe7e
|
4
|
+
data.tar.gz: 0e9ee61d100bf9061d715d6d977740ace440822c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a827ac8f757cf694258e62f135d6c06e1ad0bfd44801cb8f3ce2f4b551aa876254c6f37a04173a43ba46eaacbd99d69bc2811fec894985e2abca8b322704ceaf
|
7
|
+
data.tar.gz: 34570f37ab0d07431fc589be29c96a9422538945f7eb2daa0c63b1187018673095ff6d1d24d30d6ab8c3bd560a0dbe052c364e17ab61a8e3466075d921eda1ed
|
data/lib/trackler/version.rb
CHANGED
@@ -28,7 +28,7 @@ MacOS users can install gcc or clang with [Homebrew](http://brew.sh/) via
|
|
28
28
|
#### Windows
|
29
29
|
|
30
30
|
Windows users can get [Visual Studio Community][vs], a free download
|
31
|
-
that will give you the Visual Studio
|
31
|
+
that will give you the Visual Studio 2017 IDE and the latest version of the
|
32
32
|
Microsoft Visual C compiler.
|
33
33
|
|
34
34
|
[vs]: http://visualstudio.com
|
@@ -61,7 +61,7 @@ public void Identifies_that_a_value_is_not_included_in_the_array()
|
|
61
61
|
}
|
62
62
|
|
63
63
|
[Fact(Skip = "Remove to run test")]
|
64
|
-
public void
|
64
|
+
public void A_value_smaller_than_the_arrays_smallest_value_is_not_included()
|
65
65
|
{
|
66
66
|
var array = new[] { 1, 3, 4, 6, 8, 9, 11 };
|
67
67
|
var sut = new BinarySearch(array);
|
@@ -69,7 +69,7 @@ public void A_value_smaller_than_the_array_s_smallest_value_is_not_included()
|
|
69
69
|
}
|
70
70
|
|
71
71
|
[Fact(Skip = "Remove to run test")]
|
72
|
-
public void
|
72
|
+
public void A_value_larger_than_the_arrays_largest_value_is_not_included()
|
73
73
|
{
|
74
74
|
var array = new[] { 1, 3, 4, 6, 8, 9, 11 };
|
75
75
|
var sut = new BinarySearch(array);
|
@@ -13,27 +13,43 @@ private struct Card
|
|
13
13
|
private struct Hand
|
14
14
|
{
|
15
15
|
public string Input;
|
16
|
+
public Scores Result;
|
17
|
+
}
|
18
|
+
|
19
|
+
private struct Scores
|
20
|
+
{
|
16
21
|
public int Score;
|
22
|
+
public int TieBreakerScore;
|
17
23
|
}
|
18
24
|
|
19
25
|
public static IEnumerable<string> BestHands(IEnumerable<string> hands)
|
20
26
|
{
|
21
27
|
var scoredHands = hands.Select(ParseHand).ToArray();
|
22
|
-
var maxScore = scoredHands.Max(h => h.Score);
|
23
|
-
|
28
|
+
var maxScore = scoredHands.Max(h => h.Result.Score);
|
29
|
+
var maxHands = scoredHands.Where(h => h.Result.Score == maxScore);
|
30
|
+
|
31
|
+
return maxHands
|
32
|
+
.Where(h => h.Result.TieBreakerScore == maxHands.Max(m => m.Result.TieBreakerScore))
|
33
|
+
.Select(s => s.Input)
|
34
|
+
.ToList();
|
24
35
|
}
|
25
36
|
|
26
|
-
private static Hand ParseHand(string hand) => new Hand { Input = hand,
|
37
|
+
private static Hand ParseHand(string hand) => new Hand { Input = hand, Result = ScoreHand(ParseCards(hand)) };
|
27
38
|
|
28
|
-
private static Card[] ParseCards(string hand) => hand
|
39
|
+
private static Card[] ParseCards(string hand) => hand
|
40
|
+
.Replace("10", "T")
|
41
|
+
.Split(' ')
|
42
|
+
.Select(ParseCard)
|
43
|
+
.OrderByDescending(c => c.Rank)
|
44
|
+
.ToArray();
|
29
45
|
|
30
46
|
private static Card ParseCard(string card) => new Card { Rank = ParseRank(card), Suit = ParseSuit(card) };
|
31
|
-
|
47
|
+
|
32
48
|
private static int ParseRank(string card) => "..23456789TJQKA".IndexOf(card[0]);
|
33
49
|
|
34
50
|
private static int ParseSuit(string card) => ".HSDC".IndexOf(card[1]);
|
35
|
-
|
36
|
-
private static
|
51
|
+
|
52
|
+
private static Scores ScoreHand(Card[] cards)
|
37
53
|
{
|
38
54
|
var cardsByRank = cards
|
39
55
|
.GroupBy(c => c.Rank)
|
@@ -46,7 +62,7 @@ private static int ScoreHand(Card[] cards)
|
|
46
62
|
.Select(g => g.Count())
|
47
63
|
.OrderByDescending(c => c)
|
48
64
|
.ToArray();
|
49
|
-
|
65
|
+
|
50
66
|
var ranks = cards.Select(c => c.Rank).ToArray();
|
51
67
|
var suits = cards.Select(c => c.Suit).ToArray();
|
52
68
|
|
@@ -54,43 +70,76 @@ private static int ScoreHand(Card[] cards)
|
|
54
70
|
{
|
55
71
|
ranks = new[] { 5, 4, 3, 2, 1 };
|
56
72
|
}
|
57
|
-
|
73
|
+
|
58
74
|
var flush = suits.Distinct().Count() == 1;
|
59
75
|
var straight = ranks.Distinct().Count() == 5 && ranks[0] - ranks[4] == 4;
|
60
|
-
|
76
|
+
|
61
77
|
if (straight && flush)
|
62
78
|
{
|
63
|
-
return
|
79
|
+
return new Scores
|
80
|
+
{
|
81
|
+
Score = 800 + ranks.First()
|
82
|
+
};
|
64
83
|
}
|
65
|
-
if (rankCounts.SequenceEqual(new
|
84
|
+
if (rankCounts.SequenceEqual(new[] { 4, 1 }))
|
66
85
|
{
|
67
|
-
return
|
86
|
+
return new Scores
|
87
|
+
{
|
88
|
+
Score = 700 + cardsByRank[0],
|
89
|
+
TieBreakerScore = cardsByRank[1]
|
90
|
+
};
|
68
91
|
}
|
69
92
|
if (rankCounts.SequenceEqual(new[] { 3, 2 }))
|
70
93
|
{
|
71
|
-
return
|
94
|
+
return new Scores
|
95
|
+
{
|
96
|
+
Score = 600 + cardsByRank[0],
|
97
|
+
TieBreakerScore = cardsByRank[1]
|
98
|
+
};
|
72
99
|
}
|
73
100
|
if (flush)
|
74
101
|
{
|
75
|
-
return
|
102
|
+
return new Scores
|
103
|
+
{
|
104
|
+
Score = 500 + ranks.First()
|
105
|
+
};
|
76
106
|
}
|
77
107
|
if (straight)
|
78
108
|
{
|
79
|
-
return
|
109
|
+
return new Scores
|
110
|
+
{
|
111
|
+
Score = 400 + ranks.First()
|
112
|
+
};
|
80
113
|
}
|
81
114
|
if (rankCounts.SequenceEqual(new[] { 3, 1, 1 }))
|
82
115
|
{
|
83
|
-
return
|
116
|
+
return new Scores
|
117
|
+
{
|
118
|
+
Score = 300 + cardsByRank[0],
|
119
|
+
TieBreakerScore = cardsByRank[1]
|
120
|
+
};
|
84
121
|
}
|
85
122
|
if (rankCounts.SequenceEqual(new[] { 2, 2, 1 }))
|
86
123
|
{
|
87
|
-
return
|
124
|
+
return new Scores
|
125
|
+
{
|
126
|
+
Score = 200 + cardsByRank[0] + cardsByRank[1],
|
127
|
+
TieBreakerScore = cardsByRank[2]
|
128
|
+
};
|
88
129
|
}
|
89
130
|
if (rankCounts.SequenceEqual(new[] { 2, 1, 1, 1 }))
|
90
131
|
{
|
91
|
-
return
|
132
|
+
return new Scores
|
133
|
+
{
|
134
|
+
Score = 100 + cardsByRank[0],
|
135
|
+
TieBreakerScore = 0
|
136
|
+
};
|
92
137
|
}
|
93
138
|
|
94
|
-
return
|
139
|
+
return new Scores
|
140
|
+
{
|
141
|
+
Score = ranks.Max(),
|
142
|
+
TieBreakerScore = cardsByRank[4]
|
143
|
+
};
|
95
144
|
}
|
96
145
|
}
|
@@ -1,160 +1,230 @@
|
|
1
|
-
|
1
|
+
// This file was auto-generated based on version 1.0.0 of the canonical data.
|
2
|
+
|
3
|
+
using Xunit;
|
2
4
|
|
3
5
|
public class PokerTest
|
4
6
|
{
|
5
7
|
[Fact]
|
6
|
-
public void
|
8
|
+
public void Single_hand_always_wins()
|
9
|
+
{
|
10
|
+
var actual = Poker.BestHands(new[] { "4S 5S 7H 8D JC" });
|
11
|
+
var expected = new[] { "4S 5S 7H 8D JC" };
|
12
|
+
Assert.Equal(expected, actual);
|
13
|
+
}
|
14
|
+
|
15
|
+
[Fact(Skip = "Remove to run test")]
|
16
|
+
public void Highest_card_out_of_all_hands_wins()
|
17
|
+
{
|
18
|
+
var actual = Poker.BestHands(new[] { "4D 5S 6S 8D 3C", "2S 4C 7S 9H 10H", "3S 4S 5D 6H JH" });
|
19
|
+
var expected = new[] { "3S 4S 5D 6H JH" };
|
20
|
+
Assert.Equal(expected, actual);
|
21
|
+
}
|
22
|
+
|
23
|
+
[Fact(Skip = "Remove to run test")]
|
24
|
+
public void A_tie_has_multiple_winners()
|
25
|
+
{
|
26
|
+
var actual = Poker.BestHands(new[] { "4D 5S 6S 8D 3C", "2S 4C 7S 9H 10H", "3S 4S 5D 6H JH", "3H 4H 5C 6C JD" });
|
27
|
+
var expected = new[] { "3S 4S 5D 6H JH", "3H 4H 5C 6C JD" };
|
28
|
+
Assert.Equal(expected, actual);
|
29
|
+
}
|
30
|
+
|
31
|
+
[Fact(Skip = "Remove to run test")]
|
32
|
+
public void Multiple_hands_with_the_same_high_cards_tie_compares_next_highest_ranked_down_to_last_card()
|
33
|
+
{
|
34
|
+
var actual = Poker.BestHands(new[] { "3S 5H 6S 8D 7H", "2S 5D 6D 8C 7S" });
|
35
|
+
var expected = new[] { "3S 5H 6S 8D 7H" };
|
36
|
+
Assert.Equal(expected, actual);
|
37
|
+
}
|
38
|
+
|
39
|
+
[Fact(Skip = "Remove to run test")]
|
40
|
+
public void One_pair_beats_high_card()
|
41
|
+
{
|
42
|
+
var actual = Poker.BestHands(new[] { "4S 5H 6C 8D KH", "2S 4H 6S 4D JH" });
|
43
|
+
var expected = new[] { "2S 4H 6S 4D JH" };
|
44
|
+
Assert.Equal(expected, actual);
|
45
|
+
}
|
46
|
+
|
47
|
+
[Fact(Skip = "Remove to run test")]
|
48
|
+
public void Highest_pair_wins()
|
49
|
+
{
|
50
|
+
var actual = Poker.BestHands(new[] { "4S 2H 6S 2D JH", "2S 4H 6C 4D JD" });
|
51
|
+
var expected = new[] { "2S 4H 6C 4D JD" };
|
52
|
+
Assert.Equal(expected, actual);
|
53
|
+
}
|
54
|
+
|
55
|
+
[Fact(Skip = "Remove to run test")]
|
56
|
+
public void Two_pairs_beats_one_pair()
|
57
|
+
{
|
58
|
+
var actual = Poker.BestHands(new[] { "2S 8H 6S 8D JH", "4S 5H 4C 8C 5C" });
|
59
|
+
var expected = new[] { "4S 5H 4C 8C 5C" };
|
60
|
+
Assert.Equal(expected, actual);
|
61
|
+
}
|
62
|
+
|
63
|
+
[Fact(Skip = "Remove to run test")]
|
64
|
+
public void Both_hands_have_two_pairs_highest_ranked_pair_wins()
|
65
|
+
{
|
66
|
+
var actual = Poker.BestHands(new[] { "2S 8H 2D 8D 3H", "4S 5H 4C 8S 5D" });
|
67
|
+
var expected = new[] { "2S 8H 2D 8D 3H" };
|
68
|
+
Assert.Equal(expected, actual);
|
69
|
+
}
|
70
|
+
|
71
|
+
[Fact(Skip = "Remove to run test")]
|
72
|
+
public void Both_hands_have_two_pairs_with_the_same_highest_ranked_pair_tie_goes_to_low_pair()
|
73
|
+
{
|
74
|
+
var actual = Poker.BestHands(new[] { "2S QS 2C QD JH", "JD QH JS 8D QC" });
|
75
|
+
var expected = new[] { "JD QH JS 8D QC" };
|
76
|
+
Assert.Equal(expected, actual);
|
77
|
+
}
|
78
|
+
|
79
|
+
[Fact(Skip = "Remove to run test")]
|
80
|
+
public void Both_hands_have_two_identically_ranked_pairs_tie_goes_to_remaining_card_kicker_()
|
7
81
|
{
|
8
|
-
|
9
|
-
|
82
|
+
var actual = Poker.BestHands(new[] { "JD QH JS 8D QC", "JS QS JC 2D QD" });
|
83
|
+
var expected = new[] { "JD QH JS 8D QC" };
|
84
|
+
Assert.Equal(expected, actual);
|
10
85
|
}
|
11
86
|
|
12
87
|
[Fact(Skip = "Remove to run test")]
|
13
|
-
public void
|
88
|
+
public void Three_of_a_kind_beats_two_pair()
|
14
89
|
{
|
15
|
-
|
16
|
-
|
17
|
-
Assert.Equal(
|
90
|
+
var actual = Poker.BestHands(new[] { "2S 8H 2H 8D JH", "4S 5H 4C 8S 4H" });
|
91
|
+
var expected = new[] { "4S 5H 4C 8S 4H" };
|
92
|
+
Assert.Equal(expected, actual);
|
18
93
|
}
|
19
94
|
|
20
95
|
[Fact(Skip = "Remove to run test")]
|
21
|
-
public void
|
96
|
+
public void Both_hands_have_three_of_a_kind_tie_goes_to_highest_ranked_triplet()
|
22
97
|
{
|
23
|
-
|
24
|
-
|
25
|
-
Assert.Equal(
|
98
|
+
var actual = Poker.BestHands(new[] { "2S 2H 2C 8D JH", "4S AH AS 8C AD" });
|
99
|
+
var expected = new[] { "4S AH AS 8C AD" };
|
100
|
+
Assert.Equal(expected, actual);
|
26
101
|
}
|
27
102
|
|
28
103
|
[Fact(Skip = "Remove to run test")]
|
29
|
-
public void
|
104
|
+
public void With_multiple_decks_two_players_can_have_same_three_of_a_kind_ties_go_to_highest_remaining_cards()
|
30
105
|
{
|
31
|
-
|
32
|
-
|
33
|
-
Assert.Equal(
|
106
|
+
var actual = Poker.BestHands(new[] { "4S AH AS 7C AD", "4S AH AS 8C AD" });
|
107
|
+
var expected = new[] { "4S AH AS 8C AD" };
|
108
|
+
Assert.Equal(expected, actual);
|
34
109
|
}
|
35
110
|
|
36
111
|
[Fact(Skip = "Remove to run test")]
|
37
|
-
public void
|
112
|
+
public void A_straight_beats_three_of_a_kind()
|
38
113
|
{
|
39
|
-
|
40
|
-
|
41
|
-
Assert.Equal(
|
114
|
+
var actual = Poker.BestHands(new[] { "4S 5H 4C 8D 4H", "3S 4D 2S 6D 5C" });
|
115
|
+
var expected = new[] { "3S 4D 2S 6D 5C" };
|
116
|
+
Assert.Equal(expected, actual);
|
42
117
|
}
|
43
118
|
|
44
119
|
[Fact(Skip = "Remove to run test")]
|
45
|
-
public void
|
120
|
+
public void Aces_can_end_a_straight_10_j_q_k_a_()
|
46
121
|
{
|
47
|
-
|
48
|
-
|
49
|
-
Assert.Equal(
|
122
|
+
var actual = Poker.BestHands(new[] { "4S 5H 4C 8D 4H", "10D JH QS KD AC" });
|
123
|
+
var expected = new[] { "10D JH QS KD AC" };
|
124
|
+
Assert.Equal(expected, actual);
|
50
125
|
}
|
51
126
|
|
52
127
|
[Fact(Skip = "Remove to run test")]
|
53
|
-
public void
|
128
|
+
public void Aces_can_start_a_straight_a_2_3_4_5_()
|
54
129
|
{
|
55
|
-
|
56
|
-
|
57
|
-
Assert.Equal(
|
130
|
+
var actual = Poker.BestHands(new[] { "4S 5H 4C 8D 4H", "4D AH 3S 2D 5C" });
|
131
|
+
var expected = new[] { "4D AH 3S 2D 5C" };
|
132
|
+
Assert.Equal(expected, actual);
|
58
133
|
}
|
59
134
|
|
60
135
|
[Fact(Skip = "Remove to run test")]
|
61
|
-
public void
|
136
|
+
public void Both_hands_with_a_straight_tie_goes_to_highest_ranked_card()
|
62
137
|
{
|
63
|
-
|
64
|
-
|
65
|
-
Assert.Equal(
|
138
|
+
var actual = Poker.BestHands(new[] { "4S 6C 7S 8D 5H", "5S 7H 8S 9D 6H" });
|
139
|
+
var expected = new[] { "5S 7H 8S 9D 6H" };
|
140
|
+
Assert.Equal(expected, actual);
|
66
141
|
}
|
67
142
|
|
68
143
|
[Fact(Skip = "Remove to run test")]
|
69
|
-
public void
|
144
|
+
public void Even_though_an_ace_is_usually_high_a_5_high_straight_is_the_lowest_scoring_straight()
|
70
145
|
{
|
71
|
-
|
72
|
-
|
73
|
-
Assert.Equal(
|
74
|
-
|
75
|
-
const string straightTo1 = "AS QH KS TD JH";
|
76
|
-
const string straightTo5 = "4S AH 3S 2D 5H";
|
77
|
-
Assert.Equal(new[] { straightTo1 }, Poker.BestHands(new[] { straightTo1, straightTo5 }));
|
146
|
+
var actual = Poker.BestHands(new[] { "2H 3C 4D 5D 6H", "4S AH 3S 2D 5H" });
|
147
|
+
var expected = new[] { "2H 3C 4D 5D 6H" };
|
148
|
+
Assert.Equal(expected, actual);
|
78
149
|
}
|
79
150
|
|
80
151
|
[Fact(Skip = "Remove to run test")]
|
81
|
-
public void
|
152
|
+
public void Flush_beats_a_straight()
|
82
153
|
{
|
83
|
-
|
84
|
-
|
85
|
-
Assert.Equal(
|
154
|
+
var actual = Poker.BestHands(new[] { "4C 6H 7D 8D 5H", "2S 4S 5S 6S 7S" });
|
155
|
+
var expected = new[] { "2S 4S 5S 6S 7S" };
|
156
|
+
Assert.Equal(expected, actual);
|
86
157
|
}
|
87
158
|
|
88
159
|
[Fact(Skip = "Remove to run test")]
|
89
|
-
public void
|
160
|
+
public void Both_hands_have_a_flush_tie_goes_to_high_card_down_to_the_last_one_if_necessary()
|
90
161
|
{
|
91
|
-
|
92
|
-
|
93
|
-
Assert.Equal(
|
162
|
+
var actual = Poker.BestHands(new[] { "4H 7H 8H 9H 6H", "2S 4S 5S 6S 7S" });
|
163
|
+
var expected = new[] { "4H 7H 8H 9H 6H" };
|
164
|
+
Assert.Equal(expected, actual);
|
94
165
|
}
|
95
166
|
|
96
167
|
[Fact(Skip = "Remove to run test")]
|
97
|
-
public void
|
168
|
+
public void Full_house_beats_a_flush()
|
98
169
|
{
|
99
|
-
|
100
|
-
|
101
|
-
Assert.Equal(
|
170
|
+
var actual = Poker.BestHands(new[] { "3H 6H 7H 8H 5H", "4S 5H 4C 5D 4H" });
|
171
|
+
var expected = new[] { "4S 5H 4C 5D 4H" };
|
172
|
+
Assert.Equal(expected, actual);
|
102
173
|
}
|
103
174
|
|
104
175
|
[Fact(Skip = "Remove to run test")]
|
105
|
-
public void
|
176
|
+
public void Both_hands_have_a_full_house_tie_goes_to_highest_ranked_triplet()
|
106
177
|
{
|
107
|
-
|
108
|
-
|
109
|
-
Assert.Equal(
|
178
|
+
var actual = Poker.BestHands(new[] { "4H 4S 4D 9S 9D", "5H 5S 5D 8S 8D" });
|
179
|
+
var expected = new[] { "5H 5S 5D 8S 8D" };
|
180
|
+
Assert.Equal(expected, actual);
|
110
181
|
}
|
111
182
|
|
112
183
|
[Fact(Skip = "Remove to run test")]
|
113
|
-
public void
|
184
|
+
public void With_multiple_decks_both_hands_have_a_full_house_with_the_same_triplet_tie_goes_to_the_pair()
|
114
185
|
{
|
115
|
-
|
116
|
-
|
117
|
-
Assert.Equal(
|
186
|
+
var actual = Poker.BestHands(new[] { "5H 5S 5D 9S 9D", "5H 5S 5D 8S 8D" });
|
187
|
+
var expected = new[] { "5H 5S 5D 9S 9D" };
|
188
|
+
Assert.Equal(expected, actual);
|
118
189
|
}
|
119
190
|
|
120
191
|
[Fact(Skip = "Remove to run test")]
|
121
|
-
public void
|
192
|
+
public void Four_of_a_kind_beats_a_full_house()
|
122
193
|
{
|
123
|
-
|
124
|
-
|
125
|
-
Assert.Equal(
|
194
|
+
var actual = Poker.BestHands(new[] { "4S 5H 4D 5D 4H", "3S 3H 2S 3D 3C" });
|
195
|
+
var expected = new[] { "3S 3H 2S 3D 3C" };
|
196
|
+
Assert.Equal(expected, actual);
|
126
197
|
}
|
127
198
|
|
128
199
|
[Fact(Skip = "Remove to run test")]
|
129
|
-
public void
|
200
|
+
public void Both_hands_have_four_of_a_kind_tie_goes_to_high_quad()
|
130
201
|
{
|
131
|
-
|
132
|
-
|
133
|
-
Assert.Equal(
|
202
|
+
var actual = Poker.BestHands(new[] { "2S 2H 2C 8D 2D", "4S 5H 5S 5D 5C" });
|
203
|
+
var expected = new[] { "4S 5H 5S 5D 5C" };
|
204
|
+
Assert.Equal(expected, actual);
|
134
205
|
}
|
135
206
|
|
136
207
|
[Fact(Skip = "Remove to run test")]
|
137
|
-
public void
|
208
|
+
public void With_multiple_decks_both_hands_with_identical_four_of_a_kind_tie_determined_by_kicker()
|
138
209
|
{
|
139
|
-
|
140
|
-
|
141
|
-
Assert.Equal(
|
210
|
+
var actual = Poker.BestHands(new[] { "3S 3H 2S 3D 3C", "3S 3H 4S 3D 3C" });
|
211
|
+
var expected = new[] { "3S 3H 4S 3D 3C" };
|
212
|
+
Assert.Equal(expected, actual);
|
142
213
|
}
|
143
214
|
|
144
215
|
[Fact(Skip = "Remove to run test")]
|
145
|
-
public void
|
216
|
+
public void Straight_flush_beats_four_of_a_kind()
|
146
217
|
{
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
Assert.Equal(new[] { spadeStraightTo9, diamondStraightTo9 }, Poker.BestHands(new[] { spadeStraightTo9, diamondStraightTo9, threeOf4 }));
|
218
|
+
var actual = Poker.BestHands(new[] { "4S 5H 5S 5D 5C", "7S 8S 9S 6S 10S" });
|
219
|
+
var expected = new[] { "7S 8S 9S 6S 10S" };
|
220
|
+
Assert.Equal(expected, actual);
|
151
221
|
}
|
152
222
|
|
153
223
|
[Fact(Skip = "Remove to run test")]
|
154
|
-
public void
|
224
|
+
public void Both_hands_have_straight_flush_tie_goes_to_highest_ranked_card()
|
155
225
|
{
|
156
|
-
|
157
|
-
|
158
|
-
Assert.Equal(
|
226
|
+
var actual = Poker.BestHands(new[] { "4H 6H 7H 8H 5H", "5S 7S 8S 9S 6S" });
|
227
|
+
var expected = new[] { "5S 7S 8S 9S 6S" };
|
228
|
+
Assert.Equal(expected, actual);
|
159
229
|
}
|
160
|
-
}
|
230
|
+
}
|