using System;
namespace Coin_Toss
{
class Program
{
static void Main(string[] args)
{
int minbound,maxbound;
Console.WriteLine("Player one give a lower limit");
minbound = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Player two give a upper limit");
maxbound = Convert.ToInt32(Console.ReadLine());
Generate_Numbers toss = new Generate_Numbers(minbound,maxbound);
Decide_Side obj = new Decide_Side(toss);
Console.ReadKey();
}
}
class Generate_Numbers
{
int number,min,max;
public int Num { get { return number; } set { number = value; } }
public int MinRange{ get { return min; } set { min = value; } }
public int MaxRange { get { return max; } set { max = value; } }
Random obj = new Random();
public Generate_Numbers(int mi,int ma)
{
MinRange = mi;
MaxRange = ma;
}
public int pickNumber()
{
Num = obj.Next(MinRange,MaxRange);
return Num;
}
}
class Decide_Side
{
public Decide_Side(Generate_Numbers A)
{
Console.WriteLine(decide(A));
}
public string decide(Generate_Numbers B)
{
string state;
int no= B.pickNumber();
if(no%2==0)
{
state="head";
}
else{
state="tail";
}
return state;
}
}
}
namespace Coin_Toss
{
class Program
{
static void Main(string[] args)
{
int minbound,maxbound;
Console.WriteLine("Player one give a lower limit");
minbound = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Player two give a upper limit");
maxbound = Convert.ToInt32(Console.ReadLine());
Generate_Numbers toss = new Generate_Numbers(minbound,maxbound);
Decide_Side obj = new Decide_Side(toss);
Console.ReadKey();
}
}
class Generate_Numbers
{
int number,min,max;
public int Num { get { return number; } set { number = value; } }
public int MinRange{ get { return min; } set { min = value; } }
public int MaxRange { get { return max; } set { max = value; } }
Random obj = new Random();
public Generate_Numbers(int mi,int ma)
{
MinRange = mi;
MaxRange = ma;
}
public int pickNumber()
{
Num = obj.Next(MinRange,MaxRange);
return Num;
}
}
class Decide_Side
{
public Decide_Side(Generate_Numbers A)
{
Console.WriteLine(decide(A));
}
public string decide(Generate_Numbers B)
{
string state;
int no= B.pickNumber();
if(no%2==0)
{
state="head";
}
else{
state="tail";
}
return state;
}
}
}
Comments
Post a Comment