• 大小: 0.15M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-26
  • 语言: C#
  • 标签: 2048  算法  

资源简介

2048核心算法

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;

namespace _2048
{
    class Game
    {
        private static Random random;
        private int[] map;
        private int[] curData;
        private List emptyList;
        private int[] backMap;
        public bool IsChange { get; set; }

        public int[] Map {
            get {
                return this.map;
            }
        }
           
        public enum Flag
        {
            EXIT
            TOP
            DOWN
            LEFT
            RIGHT
        }

        public Game() {
            random = new Random();
            map = new int[44];
            curData = new int[4];
            emptyList = new List();
            backMap = new int[44];
        }

        private void StatisticsEmpty() {
            emptyList.Clear();
            for (int i = 0; i < this.map.GetLength(0); i++)
            {
                for (

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         220  2019-10-19 19:49  2048.csproj
     文件        1112  2020-06-01 19:07  2048.sln
     文件         404  2020-06-01 19:08  bin\Debug\netcoreapp3.0\2048.deps.json
     文件        8704  2020-06-01 19:08  bin\Debug\netcoreapp3.0\2048.dll
     文件      159744  2020-06-01 19:08  bin\Debug\netcoreapp3.0\2048.exe
     文件        3316  2020-06-01 19:08  bin\Debug\netcoreapp3.0\2048.pdb
     文件         182  2020-06-01 19:08  bin\Debug\netcoreapp3.0\2048.runtimeconfig.dev.json
     文件         154  2020-06-01 19:08  bin\Debug\netcoreapp3.0\2048.runtimeconfig.json
     文件        6197  2019-10-24 15:48  Game.cs
     文件         315  2019-10-24 15:06  Location.cs
     文件         149  2019-10-19 19:49  obj\2048.csproj.nuget.cache
     文件        2402  2020-06-01 19:06  obj\2048.csproj.nuget.dgspec.json
     文件        1122  2020-06-01 19:06  obj\2048.csproj.nuget.g.props
     文件         294  2019-10-19 19:49  obj\2048.csproj.nuget.g.targets
     文件         995  2019-10-19 19:49  obj\Debug\netcoreapp3.0\2048.AssemblyInfo.cs
     文件          42  2019-10-19 19:49  obj\Debug\netcoreapp3.0\2048.AssemblyInfoInputs.cache
     文件         144  2020-06-01 19:06  obj\Debug\netcoreapp3.0\2048.assets.cache
     文件          42  2020-06-01 19:08  obj\Debug\netcoreapp3.0\2048.csproj.CoreCompileInputs.cache
     文件        1563  2020-06-01 19:08  obj\Debug\netcoreapp3.0\2048.csproj.FileListAbsolute.txt
     文件         424  2020-06-01 19:08  obj\Debug\netcoreapp3.0\2048.csprojAssemblyReference.cache
     文件        8704  2020-06-01 19:08  obj\Debug\netcoreapp3.0\2048.dll
     文件      159744  2020-06-01 19:08  obj\Debug\netcoreapp3.0\2048.exe
     文件          42  2020-06-01 19:08  obj\Debug\netcoreapp3.0\2048.genruntimeconfig.cache
     文件        3316  2020-06-01 19:08  obj\Debug\netcoreapp3.0\2048.pdb
     文件        2365  2020-06-01 19:06  obj\project.assets.json
     文件         813  2020-06-01 19:06  obj\project.nuget.cache
     文件         997  2019-10-28 22:14  obj\Release\netcoreapp3.0\2048.AssemblyInfo.cs
     文件          42  2019-10-28 22:14  obj\Release\netcoreapp3.0\2048.AssemblyInfoInputs.cache
     文件         143  2019-10-28 22:14  obj\Release\netcoreapp3.0\2048.assets.cache
     文件        2527  2020-06-01 19:07  Program.cs

评论

共有 条评论