Created
October 19, 2015 20:41
-
-
Save JustinMorgan/3bb4e6b058d70cc07d41 to your computer and use it in GitHub Desktop.
Deck shuffling puzzle: C# tester boilerplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Shuffle | |
{ | |
static Random r = new Random(); | |
public static void swap(ref int a, ref int b) | |
{ | |
if (a != b) | |
{ | |
a ^= b; | |
b ^= a; | |
a ^= b; | |
} | |
} | |
public static int rand(int min, int max) | |
{ | |
return r.Next(min, max + 1); | |
} | |
public static void shuffle(int[] deck) | |
{ | |
//your code here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment