Skip to content

Commit dfeee42

Browse files
Rename 15 High Low Card Game.sql to 15 High Low Card Game Random Sequence.sql
1 parent 9574e16 commit dfeee42

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Permutations, Combinations, Sequences and Random Numbers/SQL Scripts/15 High Low Card Game.sql renamed to Permutations, Combinations, Sequences and Random Numbers/SQL Scripts/15 High Low Card Game Random Sequence.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ Last Updated: 07/05/2022
77
This script is written in SQL Server's T-SQL
88
99
10-
• This solution uses the following concepts:
10+
• This solution uses the following concepts:
1111
1) A sequence generator to create a deck of cards, as we only care about the number value on the card and not its suite (Hearts, Diamonds, Clubs, Spades)
1212
2) This solution also uses the UNIQUEIDENTIFIER data type to shuffle a deck of cards
1313
3) A random generator (0 or 1) to randomly choose a higher or lower prediction if both have the same probability
1414
15-
• I use several temp tables for my solution rather than running UPDATE statements
15+
• I use several temp tables for my solution rather than running UPDATE statements
1616
1) A #Numbers table is populated with 52 records, the size of a deck of cards
1717
2) The sequence CardDeckSequence is created that cycles every 13 numbers
1818
3) The #CardShuffle table is created using the UNIQUEIDENTIFIER data type to randomize the deck of cards and then populated using the CardDeckSequence
@@ -151,4 +151,4 @@ WHILE (SELECT COUNT(*) FROM #CardShuffleResults) <= @vIterations --Number of sim
151151
-------------------------------
152152
-------------------------------
153153
--Display the results
154-
SELECT * FROM #CardShuffleResults ORDER BY 2 DESC;
154+
SELECT * FROM #CardShuffleResults ORDER BY 2 DESC;

0 commit comments

Comments
 (0)