//bobing
static void Displaynum(int num, int x, int y)
{
Console.ForegroundColor = ConsoleColor.White;
string[,] digital = new string[6, 3] {
{" "," ● "," " },//1
{" ","● ●"," " },//2
{"● "," ● "," ●" },//3
{"● ●"," ","● ●" },//4
{"● ●"," ● ","● ●" },//5
{"● ●","● ●","● ●" },//6
};
for (int i = 0; i < 6; i++)
{
if (i == num-1)
{
for (int j = 0; j < 3;j++)
{
Console.SetCursorPosition(x, y + j);
Console.WriteLine(digital[i, j]);
}
break;
}
while (true)
{
Start();
stringaa=Console.ReadLine();
if (aa == "q")
{
break;
}
Console.Clear();
}
//shuijishu
Random rd = new Random();
for (int i = 0; i < 6; i++)
{
int k = rd.Next();
k = (k % 6) + 1;
a[i] = k;
Displaynum(k, 28 + 10 * i, 4);
}
}
//Number of occurrences of a statistic
int one = number.Count(r => r == '1');
int two = number.Count(r => r == '2');
int three = number.Count(r => r == '3');
int four = number.Count(r => r == '4');
int five = number.Count(r => r == '5');
int six = number.Count(r => r == '6');
//
if (four == 6) Console.WriteLine("六杯紅");
else if (four == 4 && one == 2) Console.WriteLine("狀元插金花");
else if (four == 5 && one == 1) Console.WriteLine("五紅");
else if (six == 5 || five == 5 || three == 5 || two == 5 || one == 5)Console.WriteLine("五子登科");
else if (six == 6 || five == 6 || three == 6 || two == 6)Console.WriteLine("六杯黑");
else if (one == 6) Console.WriteLine("遍地錦");
else if (one == 1 && two == 1 && three == 1 &&four == 1 && five == 1 && six == 1) Console.WriteLine("對堂");
else if (four == 4) Console.WriteLine("四点紅");
else if (one == 4 || two == 4 || three == 4 || five == 4 || six == 4)Console.WriteLine("四進");
else if (four == 3) Console.WriteLine("三紅");
else if (four == 2) Console.WriteLine("二舉");
else if (four == 1) Console.WriteLine("一秀");
else Console.WriteLine("Thanks for participation.");
}