Program entry: Main () Method: namespace guess{ class program { static void Main (Strin G[] args) { Game game = new Game (); &NBSP ; game. Startgame (); } }}1.game class: namespace guess{ class game {&N Bsp Computer C = new computer (); person p = new person (); int count = 0; public void Startgame () { &N Bsp Console.WriteLine ("Start Game"); Console.WriteLine (" Game rules: 1. Scissors 2. Stone 3. Cloth (Please enter the corresponding number is OK!!!) ); Console.WriteLine ("First select your challenge: 1. Liu Bei 2. Sun Quan 3."); &NB Sp int i = Convert.ToInt16 ((Console.ReadLine ())); &nbsP switch (i) { & nbsp Case 1: c.name = "Liu Bei"; &NB Sp Console.WriteLine ("Counter selected opponent: {0}\n", c.name); &N Bsp break; case 2: &NBS P c.name = "Sun Quan"; &NB Sp Console.WriteLine ("Your opponent selected: {0}\n", c.name); break;& nbsp case 3: &NB Sp C.name = "Caocao"; Console.WriteLine ("The opponent you chose is {0}\n: ", C.name); break; default: Console.Write ("Incorrect input, exit department "); //SYSTEM.DIAGNOSTICS.PROCESS.GETCURRENTP Rocess (). Kill (); environment.exit (0); &NBS P break; } &NB Sp Console.WriteLine ("Please enter your name:"); P.name = convert.tostring ( Console.ReadLine ()); Console.WriteLine (""); &N Bsp Console.WriteLine (p.name + "vs" + c.name+ "\ n"); Console.WriteLine ("Do you want to start? (y/n) ");   String ans = convert.tostring (Console.ReadLine ()); while ("Y" . Equals (ans)) { int pID = P . Chuquan (); int cID = C.chuquan (); &NBSP ; if (PID = = CID) &NBS P { Console.WriteLine ("Draw") ; count++; & nbsp } else if (CID = = 1 && PID = = 3 | | cID = = 2 &&am P PID = = 1 | | CID = = 3 && PID = = 2) { Console.WriteLine ("{0} win", C.name); &N Bsp c.scoer++; } ELSE if (pid = = 1 && cid = 3 | | pid = = 2 && CID = 1 | | pid = = 3 && cid = = 2) { Console.WriteLine ("You Win"); p.scoer++; &NB Sp } Console.WriteLine ("Continue Games (y/n) "); ans = convert.tostring (Console.ReadLine ());   ; } Console.WriteLine ("Game Over, knot The following \ n "); Console.WriteLine ("Ping : {0}", count); &NB Sp Console.WriteLine ("{0} wins: {1}", C.name,c.scoer); &NBSP ; Console.WriteLine ("I win: {0}", P.scoer); } & nbsp }}2.person class; namespace guess{ class person { public string name; public int scoer; public person () {  ; } public int Chuquan () { & nbsp Console.WriteLine ("Please Punch:"); int ID = convert.toint16 (Console . ReadLine ()); switch (ID) { & nbsp Case 1:console.writeline ("I Punch for Scissors"); &N Bsp break; Case 2:console.writeline ("I Punch for Stone"); &NB Sp break; case 3:console.writeline ("I Punch for cloth"); break; &N Bsp default: CONSOLE.W Riteline ("input error"); environment.exit (0); & nbsp break; } &NB Sp return id; } }}3. Computer Computer class: namespace guess{ CLASS computer { public computer () { &NB Sp } public string name; public int scoer; & nbsp public int Chuquan () { random random = new Random () &NB Sp int ID = random. Next (1, 4); switch (ID) { C ASE 1:console.writeline (name+ "Punch: Scissors"); break; Case 2:console.writeline (name+ "Punch, stone"); break ; case 3:console.writeline (name+ "punch: Cloth"); &NBSP ; break; } return ID; } }}
Human-Machine Scissors C # implementation