Shockwave is an interesting variation of
Jacks or Better. The game has two modes - Regular mode and Shockwave mode. In regular mode, the game plays like Jacks or Better, except Two
Pair pays 1-for-1 and a Straight Flush pays 100-for-1. Payouts for Straight, Flush and Full House are commonly adjusted to increase or reduce the return.
But the real attraction of the game is Shockwave mode. In Shockwave mode, Four of a Kind pays the same amount as a Royal Flush (4,000 coins when betting five). Shockwave mode is triggered when the
player gets Four of a Kind in regular mode, and lasts for 10 hands or until the player gets another Four of a Kind, whichever occurs first.
The correct strategy for Shockwave mode goes after Four of a Kind very aggressively. One Pair, regardless of rank, generally beats everything except Four to a Straight Flush or better. It is almost
never correct to discard five cards during Shockwave mode. If the hand appears to be garbage, the correct play is usually to keep the card which can produce the most Straights and Straight Flushes,
even if that card is lower than a Jack.
Note that, because there are two paytables involved, analyzing this game takes about twice as long as most other games.
Play Shockwave for free
Deck Simplification
Unique Rank Patterns
| Core Hand Type | Formula | Result |
| Four of a Kind | Combin(13, 1) * Combin(12, 1) | 156 |
| Full House | Combin(13, 1) * Combin(12, 1) | 156 |
| Three of a Kind | Combin(13, 1) * Combin(12, 2) | 858 |
| Two Pair | Combin(13, 2) * Combin(11, 1) | 858 |
| One Pair | Combin(13, 1) * Combin(12, 3) | 2,860 |
| No Pair | Combin(13, 5) | 1,287 |
Unique Suit Patterns
| Four of a Kind |
Full House |
Three of a Kind |
Two Pair |
One Pair |
No Pair |
| Pattern | Count |
Pattern | Count |
Pattern | Count |
Pattern | Count |
Pattern | Count |
Pattern | Count |
| ABCDA | 4 | ABCAB | 12 | ABCAA | 12 | ABABA | 12 | ABAAA | 12 | AAAAA | 4 |
| | ABCAD | 12 | ABCAB | 24 | ABABC | 12 | ABAAB | 12 | AAAAB | 12 |
| | | | ABCAD | 12 | ABACA | 24 | ABAAC | 24 | AAABA | 12 |
| | | | ABCDA | 12 | ABACB | 24 | ABABA | 12 | AAABB | 12 |
| | | | ABCDD | 4 | ABACC | 24 | ABABB | 12 | AAABC | 24 |
| | | | | | ABACD | 24 | ABABC | 24 | AABAA | 12 |
| | | | | | ABCDA | 12 | ABACA | 24 | AABAB | 12 |
| | | | | | ABCDC | 12 | ABACB | 24 | AABAC | 24 |
| | | | | | | | ABACC | 24 | AABBA | 12 |
| | | | | | | | ABACD | 24 | AABBB | 12 |
| | | | | | | | ABCAA | 24 | AABBC | 24 |
| | | | | | | | ABCAB | 24 | AABCA | 24 |
| | | | | | | | ABCAC | 24 | AABCB | 24 |
| | | | | | | | ABCAD | 24 | AABCC | 24 |
| | | | | | | | ABCCA | 24 | AABCD | 24 |
| | | | | | | | ABCCC | 12 | ABAAA | 12 |
| | | | | | | | ABCCD | 12 | ABAAB | 12 |
| | | | | | | | ABCDA | 24 | ABAAC | 24 |
| | | | | | | | ABCDC | 12 | ABABA | 12 |
| | | | | | | | ABCDD | 12 | ABABB | 12 |
| | | | | | | | | | ABABC | 24 |
| | | | | | | | | | ABACA | 24 |
| | | | | | | | | | ABACB | 24 |
| | | | | | | | | | ABACC | 24 |
| | | | | | | | | | ABACD | 24 |
| | | | | | | | | | ABBAA | 12 |
| | | | | | | | | | ABBAB | 12 |
| | | | | | | | | | ABBAC | 24 |
| | | | | | | | | | ABBBA | 12 |
| | | | | | | | | | ABBBB | 12 |
| | | | | | | | | | ABBBC | 24 |
| | | | | | | | | | ABBCA | 24 |
| | | | | | | | | | ABBCB | 24 |
| | | | | | | | | | ABBCC | 24 |
| | | | | | | | | | ABBCD | 24 |
| | | | | | | | | | ABCAA | 24 |
| | | | | | | | | | ABCAB | 24 |
| | | | | | | | | | ABCAC | 24 |
| | | | | | | | | | ABCAD | 24 |
| | | | | | | | | | ABCBA | 24 |
| | | | | | | | | | ABCBB | 24 |
| | | | | | | | | | ABCBC | 24 |
| | | | | | | | | | ABCBD | 24 |
| | | | | | | | | | ABCCA | 24 |
| | | | | | | | | | ABCCB | 24 |
| | | | | | | | | | ABCCC | 24 |
| | | | | | | | | | ABCCD | 24 |
| | | | | | | | | | ABCDA | 24 |
| | | | | | | | | | ABCDB | 24 |
| | | | | | | | | | ABCDC | 24 |
| | | | | | | | | | ABCDD | 24 |
Total Unique Patterns
| Core Hand Type | Rank Patterns | Suit Patterns | Total |
| Four of a Kind | 156 | 1 | 156 |
| Full House | 156 | 2 | 312 |
| Three of a Kind | 858 | 5 | 4,290 |
| Two Pair | 858 | 8 | 6,864 |
| One Pair | 2,860 | 20 | 57,200 |
| No Pair | 1,287 | 51 | 65,637 |
| Total | 134,459 |
| Reduction in processing time | 94.8264% |
Hand Scoring Code
int GetHandType(int C1, int C2, int C3, int C4, int C5)
{
int Hand = 0;
int R1 = Rank[C1],
R2 = Rank[C2],
R3 = Rank[C3],
R4 = Rank[C4],
R5 = Rank[C5];
int S1 = Suit[C1],
S2 = Suit[C2],
S3 = Suit[C3],
S4 = Suit[C4],
S5 = Suit[C5];
bool Flush =
(S1 == S2) &&
(S2 == S3) &&
(S3 == S4) &&
(S4 == S5);
if (R1 > R2) { R1 ^= R2; R2 ^= R1; R1 ^= R2; }
if (R1 > R3) { R1 ^= R3; R3 ^= R1; R1 ^= R3; }
if (R1 > R4) { R1 ^= R4; R4 ^= R1; R1 ^= R4; }
if (R1 > R5) { R1 ^= R5; R5 ^= R1; R1 ^= R5; }
if (R2 > R3) { R2 ^= R3; R3 ^= R2; R2 ^= R3; }
if (R2 > R4) { R2 ^= R4; R4 ^= R2; R2 ^= R4; }
if (R2 > R5) { R2 ^= R5; R5 ^= R2; R2 ^= R5; }
if (R3 > R4) { R3 ^= R4; R4 ^= R3; R3 ^= R4; }
if (R3 > R5) { R3 ^= R5; R5 ^= R3; R3 ^= R5; }
if (R4 > R5) { R4 ^= R5; R5 ^= R4; R4 ^= R5; }
if (Flush)
{
if (R1 == 8)
{
Hand = 9; // Royal Flush
}
else if ((R1 == (R2 - 1)) &&
(R2 == (R3 - 1)) &&
(R3 == (R4 - 1)) &&
((R4 == (R5 - 1)) || ((R1 == 0) && (R5 == 12))))
{
Hand = 8; // Straight Flush
}
else
{
Hand = 5; // Flush
}
}
else
{
if ((R2 == R3) && (R3 == R4) && ((R1 == R2) || (R4 == R5)))
{
Hand = 7; // Four of a Kind
}
else if ((R1 == R2) && (R4 == R5) && ((R2 == R3) || (R3 == R4)))
{
Hand = 6; // Full House
}
else if ((R1 == (R2 - 1)) &&
(R2 == (R3 - 1)) &&
(R3 == (R4 - 1)) &&
((R4 == (R5 - 1)) || ((R1 == 0) && (R5 == 12))))
{
Hand = 4; // Straight
}
else if (((R1 == R2) && (R2 == R3)) ||
((R2 == R3) && (R3 == R4)) ||
((R3 == R4) && (R4 == R5)))
{
Hand = 3; // Three of a Kind
}
else if (((R1 == R2) && (R3 == R4)) ||
((R1 == R2) && (R4 == R5)) ||
((R2 == R3) && (R4 == R5)))
{
Hand = 2; // Two Pair
}
else if (((R1 == R2) && (R1 >= 9)) ||
((R2 == R3) && (R2 >= 9)) ||
((R3 == R4) && (R3 >= 9)) ||
((R4 == R5) && (R4 >= 9)))
{
Hand = 1; // Jacks or Better
}
}
return Hand;
}
Programming Methodology
For this game it is necessary to analyze both paytables separately. The Shockwave-mode paytable needs to be analyzed first, because the strategy for the Regular-mode paytable depends on it.
After analyzing the Shockwave paytable, the probability of hitting Four of a Kind during Shockwave mode is needed to determine the average number of hands. The average number of hands is calculated
by multiplying the probability of each possible outcome by the number of hands played in that particular outcome. The following formula works for the 10 outcomes where Four of a Kind was hit.
p is the probability of getting Four of a Kind in Shockwave mode and
h is the hand number that it was won on:
p × (1 − p)(h − 1) × h
The result of each outcome for
h = 1 to 10 is summed, and added to the probability of not getting Four of a Kind at all, which is
(1 − p)10 ×
10.
After adding these 11 figures together, which is the average number of Shockwave-mode hands, the next step is to multiply it by the value of the Shockwave mode paytable reduced by 1 (the value needs
to be reduced by 1 because it is necessary to place a wager on each Shockwave-mode hand). After multiplying the average number of hands by the wager-reduced value of the Shockwave-mode paytable, it
needs to be multiplied by the number of coins played and added to the Regular-mode Four of a Kind payout. The Regular-mode paytable is then analyzed using this inflated Four of a Kind payout to
determine the proper strategy for Regular-mode.
While this determines the strategy for Regular mode, it does not calculate the overall return of the game because Regular-mode Four of a Kind still only pays 125 coins. The results from both
paytables need to be blended according to the probability of any given hand being played in either mode. The average number of Shockwave-mode hands for each Regular-mode hand is determined by
multiplying the average number of Shockwave-mode hands by the probability of getting a Regular-mode Four of a Kind. Call this result
a.
The probability of any given hand being a Regular-mode hand
r = 1 ÷ (1 +
a).
The probability of any given hand being a Shockwave-mode hand
s =
a ÷ (1 +
a).
The overall return for the game is then determined by multiplying the Regular-mode return by
r and the Shockwave-mode return by
s, and adding these two results together.
My thanks to Michael Shackleford for his help on combining the return from each paytable. For more information, see the Wizard of Odds'
Shockwave page 
.