資源簡介
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
namespace?Game
{
????public?class?Program
????{
????????static?int[]?Map?=?new?int[100];//定義一個靜態字段來存儲地圖的數組
????????static?int[]?PlayerPos?=?new?int[2];//聲明一個數組來存儲玩家A和B的坐標
????????static?string[]?PlayerName?=?new?string[2];//聲明一個一個數組存儲兩個玩家的姓名
????????static?int[]?PlayerNumber?=?new?int[2];//聲明一個數組來存儲兩個玩家的序號
????????static?bool[]?Flags?=?new?bool[2];//兩個玩家的標記,默認都是false
????????public?static?void?Main(string[]?args)
????????{
????????????//調用GameShow方法
????????????GameShow();
????????????#region?輸入玩家姓名
????????????Console.ForegroundColor?=?ConsoleColor.White;//定義下面文字在控制臺顯示的顏色
????????????Console.WriteLine(“請輸入玩家A的姓名:“);//從控制臺獲取玩家A的姓名
????????????PlayerName[0]?=?Console.ReadLine();
????????????while?(PlayerName[0].Trim()?==?““)//trim(去掉兩頭的空格,但不影響中間的空格,防止所輸入的姓名為空和全部都是空格的情況
????????????{
????????????????Console.WriteLine(“玩家A的姓名不能為空,請重新輸入玩家A的姓名!!!“);
?????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????189??2019-07-08?19:17??App.config
?????文件????????2331??2019-07-08?19:17??ConsoleApp2.csproj
?????文件???????15065??2019-07-08?19:26??Program.cs
?????目錄???????????0??2019-07-08?19:17??Properties\
?????文件????????1320??2019-07-08?19:17??Properties\AssemblyInfo.cs
?????目錄???????????0??2019-07-08?19:17??bin\
?????目錄???????????0??2019-07-08?19:17??bin\Debug\
?????文件????????9728??2019-07-08?19:26??bin\Debug\ConsoleApp2.exe
?????文件?????????189??2019-07-08?19:17??bin\Debug\ConsoleApp2.exe.config
?????文件???????17920??2019-07-08?19:26??bin\Debug\ConsoleApp2.pdb
?????目錄???????????0??2019-07-08?19:17??obj\
?????目錄???????????0??2019-07-08?19:17??obj\Debug\
?????文件??????????42??2019-07-08?19:17??obj\Debug\ConsoleApp2.csproj.CoreCompileInputs.cache
?????文件?????????494??2019-07-08?19:17??obj\Debug\ConsoleApp2.csproj.FileListAbsolute.txt
?????文件????????8077??2019-07-08?19:17??obj\Debug\ConsoleApp2.csprojAssemblyReference.cache
?????文件????????9728??2019-07-08?19:26??obj\Debug\ConsoleApp2.exe
?????文件???????17920??2019-07-08?19:26??obj\Debug\ConsoleApp2.pdb
?????文件????????6731??2019-07-08?19:17??obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????目錄???????????0??2019-07-08?19:27??obj\Debug\TempPE\
?????文件???????????0??2019-07-08?19:17??obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件???????????0??2019-07-08?19:17??obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件???????????0??2019-07-08?19:17??obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
評論
共有 條評論