Skip to content

Instantly share code, notes, and snippets.

@sherpc
Created June 13, 2016 12:38
Show Gist options
  • Save sherpc/f176bb1f0f094041cb3774ff503f25a1 to your computer and use it in GitHub Desktop.
Save sherpc/f176bb1f0f094041cb3774ff503f25a1 to your computer and use it in GitHub Desktop.
class rock{}
class paper{}
class scissors{}
public static class game{
public static object rps(rock r, paper p){return p;}
public static object rps(rock r, scissors s){return r;}
public static object rps(paper p, scissors s){return s;}
}
class TestConsole{
[STAThread]
static void Main(string[] args) {
Console.WriteLine(game.rps(new rock(),new paper())); //prints paper
Console.WriteLine(game.rps(new rock(),new scissors())); //prints rock
Console.ReadLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment