using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 双色球游戏系统2._0
{
class Program
{
static void Main(string[] args)
{
//随机数
Random WinRandom = new Random();
//红色用户数组
int[] RedUserSelect = new int[6];
//红色中奖数组
int[] RedComputerSelect = new int[6];
//蓝色用户号码,蓝色中奖号码
int BlueUserSelect = 0, BlueComputerSelect = 0;
//中奖对比数据接收
int[] WinAB = new int[2];
//输出欢迎页面
Welcome();
bool judge = true;
do
{
Console.WriteLine("自选号码请输入:1,机选号码请输入:2");
string Zero = Console.ReadLine();
//判断自选还是机选
switch (Zero)
{
case "1":
Console.WriteLine("自选");
string A = "", B = "", C = "";
int RedRead = 0, BlueRead = 0;
string[] RedNumber = new string[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33" };
string[] BlueNumber = new string[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16" };
Console.Clear();
//输出欢迎页面
Welcome();
Console.WriteLine("请在1-33之间选择号码\n");
//红球部分
//输出red数组
Home(RedNumber);
Console.WriteLine("\n\n请选择第1个红色球:");
//选择red数字
for (int i = 0; i < 6; i++)
{
bool yes = false;
do
{
yes = false;
//判断输入red数字是否符合规定,若符合,则返回值给RedRead
RedRead = RedReadInt();
//收集用户输入数据返回给数组RedUserSelelct
RedUserSelect[i] = RedRead; //用户选择红色球数据接口1---------------------
//将返回值给A
A = Convert.ToString(RedRead);
//判断输入red数字是否已经存在过
yes = RedHave(RedNumber, A, yes);
} while (yes);
//清除以上内容
Console.Clear();
//再次输出欢迎页面
Welcome();
Console.WriteLine("请在1-33之间选择号码\n");
//再次输出重构后的red数组
Home(RedNumber);
B = B + " " + A;
Console.WriteLine("\n你选择的红球号码依次为:{0}", B);
Console.WriteLine("****************************************************************************");
if (i < 5)
{
Console.WriteLine("请选择第{0}个红色球:", i + 2);
}//红色球部分结束
else
{
//显示蓝色球数组
Console.WriteLine("请在1-16之间选择号码\n");
Home(BlueNumber);
Console.WriteLine("\n请选择蓝色球:");
}
} //for循环结束
//蓝球部分
//判断输入蓝色球号码是否符合规定,若符合,则返回值给BlueRead
BlueRead = BlueReadInt();
//将用户输入数据返回给BlueUserSelect
BlueUserSelect = BlueRead; //用户选择蓝色球数据接口2---------------------
//将返回值赋给C
C = Convert.ToString(BlueRead);
//清除以上内容
Console.Clear();
//欢迎页面
Welcome();
//再次显示红球数组
Home(RedNumber);
Console.WriteLine("\n你选择的红球号码依次为:{0}", B);
Console.WriteLine("****************************************************************************");
//再次显示蓝球数组
BlueNumber[BlueRead - 1] = "○";
Home(BlueNumber);
Console.WriteLine("\n你选择的蓝球号码为:{0}", C);
//蓝球部分结束
//中奖部分对比
Console.WriteLine("按回车键开奖!!!");
Console.ReadKey();
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("自选红色球为:{0}", B);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("\t自选蓝色球为:{0}", C);
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("\n中奖红色球为:");
RedComputerSelect = MyRandom(); //电脑红色球随机接口3---------------------
BlueComputerSelect = WinRandom.Next(1, 16); //电脑蓝色球随机接口4---------------------
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("中奖蓝色球为:{0}", BlueComputerSelect);
Console.ForegroundColor = ConsoleColor.Gray;
//中奖部分对比结束
Console.WriteLine("\n再次按回车键查询中奖结果!!!");
Console.ReadKey();
//测试中奖规则------------------------------------------------------------------------------------------------
int[] Redceshi = new int[] { 1, 2, 3, 4, 5, 6 };
int Blueceshi = 1;
WinAB = WinProving01(Redceshi, RedUserSelect, Blueceshi, BlueUserSelect);
//测试中奖规则------------------------------------------------------------------------------------------------
//中奖数据对比完返回给数组WinAB
//WinAB = WinProving01(RedComputerSelect, RedUserSelect, BlueComputerSelect, BlueUserSelect);
//判断是否中奖
WinProving02(WinAB);
//判断程序是否继续运行
judge = SignOut();
break;
case "2":
Console.Clear();
//输出欢迎页面
Welcome();
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("自选红色球为:");
//调用随机产生的红球数组
RedUserSelect = MyRandom(); //用户红色球随机接口1---------------------
//随机产生的蓝球用户数
BlueUserSelect = WinRandom.Next(1, 16); //用户蓝色球随机接口2---------------------
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\t自选蓝色球为:{0}", BlueUserSelect);