online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Online C# Compiler. Code, Compile, Run and Debug C# program online. Write your code in this editor and press "Run" button to execute it. *******************************************************************************/ using System; class HelloWorld { static void Main() { Console.WriteLine("Hello World"); Console.Write("Please enter player1 name: "); Console.Write("Please enter player1 name: "); string sName = Console.ReadLine(); Player player1 = new Player(sName); Console.Write("Please enter player2 name: "); sName = Console.ReadLine(); Player player2 = new Player(sName); //1 player1.Play(); player2.Play(); //2 player1.Play(); player2.Play(); //3 player1.Play(); player2.Play(); Console.WriteLine("player1 score is : {0}.", player1.GetScore()); Console.WriteLine("player2 score is : {0}.", player2.GetScore()); if (player1.GetScore() == player2.GetScore()) Console.WriteLine("The players have equal points : {0}.", player1.GetScore()); else if (player1.GetScore() > player2.GetScore()) Console.WriteLine("The winner is {0}.", player1.GetName()); else Console.WriteLine("The winner is {0}.", player2.GetName()); } }
using System; public class Player { //صفات private string name; private int score; private Random rd; //بناء public Player( string name) { this.name = name; this.score = 0; this.rd = new Random(); } //عمليات public void Play() { int result = this.rd.Next(1, 7); Console.WriteLine("Play : {0}", result); this.score += result; } //Set/Get public int GetScore() { return this.score; } public string GetName() { return this.name; } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue