Created
June 13, 2016 12:38
-
-
Save sherpc/f176bb1f0f094041cb3774ff503f25a1 to your computer and use it in GitHub Desktop.
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
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