Skip to content

Instantly share code, notes, and snippets.

@JustinMorgan
Created October 19, 2015 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinMorgan/3bb4e6b058d70cc07d41 to your computer and use it in GitHub Desktop.
Save JustinMorgan/3bb4e6b058d70cc07d41 to your computer and use it in GitHub Desktop.
Deck shuffling puzzle: C# tester boilerplate
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