diff --git a/.vs/MineSweeper/project-colors.json b/.vs/MineSweeper/project-colors.json new file mode 100644 index 0000000000000000000000000000000000000000..2581938e02cdb0855f933de0c0d7b44c35421141 --- /dev/null +++ b/.vs/MineSweeper/project-colors.json @@ -0,0 +1,16 @@ +{ + "Version": 1, + "ProjectMap": { + "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3": { + "ProjectGuid": "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3", + "DisplayName": "杂项文件", + "ColorIndex": -1 + }, + "3a42e008-5eea-42ae-8e6c-948ca05e164b": { + "ProjectGuid": "3a42e008-5eea-42ae-8e6c-948ca05e164b", + "DisplayName": "MineSweeper", + "ColorIndex": 0 + } + }, + "NextColorIndex": 1 +} \ No newline at end of file diff --git a/.vs/MineSweeper/v17/.suo b/.vs/MineSweeper/v17/.suo new file mode 100644 index 0000000000000000000000000000000000000000..bc5b80826dd386cf43d22529121cea27369ba862 Binary files /dev/null and b/.vs/MineSweeper/v17/.suo differ diff --git a/.vs/MineSweeper/v17/Browse.VC.db b/.vs/MineSweeper/v17/Browse.VC.db new file mode 100644 index 0000000000000000000000000000000000000000..4eff9a349387b9d97a572cfa9301d6e09c3c5927 Binary files /dev/null and b/.vs/MineSweeper/v17/Browse.VC.db differ diff --git a/.vs/MineSweeper/v17/ipch/AutoPCH/26d7c07a6d50e7f3/OPT.ipch b/.vs/MineSweeper/v17/ipch/AutoPCH/26d7c07a6d50e7f3/OPT.ipch new file mode 100644 index 0000000000000000000000000000000000000000..ef9bd9605a9803b03fe39632343a60f98f43a17b Binary files /dev/null and b/.vs/MineSweeper/v17/ipch/AutoPCH/26d7c07a6d50e7f3/OPT.ipch differ diff --git a/.vs/MineSweeper/v17/ipch/AutoPCH/98954ce38854ac1a/OPT.ipch b/.vs/MineSweeper/v17/ipch/AutoPCH/98954ce38854ac1a/OPT.ipch new file mode 100644 index 0000000000000000000000000000000000000000..10d96fa203e162c9a03d7b86f8586a5bb18ea6d5 Binary files /dev/null and b/.vs/MineSweeper/v17/ipch/AutoPCH/98954ce38854ac1a/OPT.ipch differ diff --git a/.vs/MineSweeper/v17/ipch/AutoPCH/d788c3f2519d5322/RUN_APP.ipch b/.vs/MineSweeper/v17/ipch/AutoPCH/d788c3f2519d5322/RUN_APP.ipch new file mode 100644 index 0000000000000000000000000000000000000000..6d4e6af05b2708cc0f98d0e1c1f10f2fe5fdc246 Binary files /dev/null and b/.vs/MineSweeper/v17/ipch/AutoPCH/d788c3f2519d5322/RUN_APP.ipch differ diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000000000000000000000000000000000000..f8b4888565caadc7510be75682268d6c18edd6de --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000000000000000000000000000000000000..8bbbb4f154923892e5cdb54de970fab3ff673764 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,8 @@ +{ + "ExpandedNodes": [ + "", + "\\src" + ], + "SelectedNode": "\\MineSweeper.sln", + "PreviewInSolutionExplorer": true +} \ No newline at end of file diff --git a/.vs/mine-sweeper/v17/.suo b/.vs/mine-sweeper/v17/.suo new file mode 100644 index 0000000000000000000000000000000000000000..752622d7e847aba843328a69da27be0c6856eb88 Binary files /dev/null and b/.vs/mine-sweeper/v17/.suo differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d00b983a9a583cdf27848e849af4a56b576f9750 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/MineSweeper.sln b/MineSweeper.sln new file mode 100644 index 0000000000000000000000000000000000000000..720b2b8032d011606bfb7f5b00ce91e05fddc0cf --- /dev/null +++ b/MineSweeper.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31912.275 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MineSweeper", "MineSweeper.vcxproj", "{3A42E008-5EEA-42AE-8E6C-948CA05E164B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3A42E008-5EEA-42AE-8E6C-948CA05E164B}.Debug|x64.ActiveCfg = Debug|x64 + {3A42E008-5EEA-42AE-8E6C-948CA05E164B}.Debug|x64.Build.0 = Debug|x64 + {3A42E008-5EEA-42AE-8E6C-948CA05E164B}.Debug|x86.ActiveCfg = Debug|Win32 + {3A42E008-5EEA-42AE-8E6C-948CA05E164B}.Debug|x86.Build.0 = Debug|Win32 + {3A42E008-5EEA-42AE-8E6C-948CA05E164B}.Release|x64.ActiveCfg = Release|x64 + {3A42E008-5EEA-42AE-8E6C-948CA05E164B}.Release|x64.Build.0 = Release|x64 + {3A42E008-5EEA-42AE-8E6C-948CA05E164B}.Release|x86.ActiveCfg = Release|Win32 + {3A42E008-5EEA-42AE-8E6C-948CA05E164B}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B633CF92-6B16-4432-BA91-07C25A21A250} + EndGlobalSection +EndGlobal diff --git a/MineSweeper.vcxproj b/MineSweeper.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..5302e9829a0ae87a104264ce96c1dc1f23b4086e --- /dev/null +++ b/MineSweeper.vcxproj @@ -0,0 +1,111 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + {3A42E008-5EEA-42AE-8E6C-948CA05E164B} + Win32Proj + + + + Application + true + v143 + + + Application + false + v143 + + + Application + true + v143 + + + Application + false + v143 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Windows + + + + + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Windows + true + true + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MineSweeper.vcxproj.filters b/MineSweeper.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..ec90da3637b87eb84b6b7b65d0eb90dc213f7cf8 --- /dev/null +++ b/MineSweeper.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/MineSweeper.vcxproj.user b/MineSweeper.vcxproj.user new file mode 100644 index 0000000000000000000000000000000000000000..88a550947edbc3c5003a41726f0749201fdb6822 --- /dev/null +++ b/MineSweeper.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/lib/mine_map.h b/lib/mine_map.h new file mode 100644 index 0000000000000000000000000000000000000000..3ab2ddb682b5da81f81f67ee179dff3c7826f3ad --- /dev/null +++ b/lib/mine_map.h @@ -0,0 +1,22 @@ +#pragma once + +#define UNCOVERED 0 +#define COVERED 1 +#define FLAGED 2 +#define MARKED 3 + +/* +*ɨ׵ͼ +*mineMap 0ʾף1ʾ +*mx, my ʾͼĸߣ +*mode ͼѶ +*stage ӵǰ״̬ δ/Ѿ/ӱ/ʺű +*cnt Ѿǵ +*/ +typedef struct map{ + int mineMap[105][105]; + int mx, my; + int mode; + int stage[105][105]; + int cnt; +}map; diff --git a/lib/opt.h b/lib/opt.h new file mode 100644 index 0000000000000000000000000000000000000000..d53349d1fc3ce1bf38ed0d8d4fd46821de66504e --- /dev/null +++ b/lib/opt.h @@ -0,0 +1,9 @@ +#pragma once +#include "mine_map.h" + + +#define BOOM 0//ըը +#define UNALLOWED 1//ΪѾ򿪵ĸӻߵ +#define ALLOWED 2//ɹ + +int count(map* map, int x, int y); \ No newline at end of file diff --git a/log/team.txt b/log/team.txt new file mode 100644 index 0000000000000000000000000000000000000000..83115bf43b178ca5606652f60386465ea2c72f94 --- /dev/null +++ b/log/team.txt @@ -0,0 +1,5 @@ +map +record +opt +ui + diff --git a/pullTest/pull b/pullTest/pull deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/opt.c b/src/opt.c new file mode 100644 index 0000000000000000000000000000000000000000..1e4b803de8e6003800e7905413620b8f9c3a5e3d --- /dev/null +++ b/src/opt.c @@ -0,0 +1,59 @@ +#include "../lib/mine_map.h" +#include "../lib/opt.h" + + +int opt(map* m) +{ +/* +* 变量名:optMode +* 作用: 操作类型 +* 说明: 1表示左键单击 +* 2表示右键单击 +* 3表示鼠标中键 +*/ + int optMode; +/* +* 变量名:optX,optY +* 说明: 表示该次操作的坐标 +* +**/ + int optX, optY; +/* +* 变量名:stageNow +* 说明: 当前格子状态 +* +**/ + int stageNow; + + return m; +} + +#ifndef COUNT +/* +* count函数 +* 作用:判断指定格子周围雷的数量 +* 参数:地图指针,指定格子坐标 +* 返回值:int 指定格子周围雷的数量 +*/ +int count(map* map, int x, int y) +{ + int cnt = 0; + for (int i = x - 1;i <= x + 1;i++) + { + for (int j = y - 1; j <= y + 1; j++) + { + if (i < 1 || j<1 || i>map->mx || j>map->my) + continue; + if (i == x && j == y) + continue; + if (map->mineMap[x][y]) + cnt++; + } + } + return cnt; +} +#define COUNT +#endif // !COUNT + + + diff --git a/src/run_app.cpp b/src/run_app.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1dd79710df748043d35a32b1353c7a185fdb13b3 --- /dev/null +++ b/src/run_app.cpp @@ -0,0 +1,8 @@ +#include + +int main() +{ + + getchar(); + return 0; +} \ No newline at end of file diff --git a/x64/Debug/MineSweeper.exe b/x64/Debug/MineSweeper.exe new file mode 100644 index 0000000000000000000000000000000000000000..3d6f8eac75cf1874c1a86b4e3f94a0423ef3ffba Binary files /dev/null and b/x64/Debug/MineSweeper.exe differ diff --git a/x64/Debug/MineSweeper.exe.recipe b/x64/Debug/MineSweeper.exe.recipe new file mode 100644 index 0000000000000000000000000000000000000000..af819970f029376f1c52893339e411fead3494b6 --- /dev/null +++ b/x64/Debug/MineSweeper.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\Users\Anti\source\repos\mine-sweeper\x64\Debug\MineSweeper.exe + + + + + + \ No newline at end of file diff --git a/x64/Debug/MineSweeper.ilk b/x64/Debug/MineSweeper.ilk new file mode 100644 index 0000000000000000000000000000000000000000..a2fe47d8c2d0f9a0666b136e2348c4b7f7d9f6fa Binary files /dev/null and b/x64/Debug/MineSweeper.ilk differ diff --git a/x64/Debug/MineSweeper.log b/x64/Debug/MineSweeper.log new file mode 100644 index 0000000000000000000000000000000000000000..90681d99ed4ee6399ffebdeced9871cff0711404 --- /dev/null +++ b/x64/Debug/MineSweeper.log @@ -0,0 +1,2 @@ + run_app.cpp + MineSweeper.vcxproj -> C:\Users\Anti\source\repos\mine-sweeper\x64\Debug\MineSweeper.exe diff --git a/x64/Debug/MineSweeper.pdb b/x64/Debug/MineSweeper.pdb new file mode 100644 index 0000000000000000000000000000000000000000..9e74af1cb07c27db7f1903f28b3290c22a218f72 Binary files /dev/null and b/x64/Debug/MineSweeper.pdb differ diff --git a/x64/Debug/MineSweeper.tlog/CL.command.1.tlog b/x64/Debug/MineSweeper.tlog/CL.command.1.tlog new file mode 100644 index 0000000000000000000000000000000000000000..dcbfb7ca1fc895c435a62d3400447c473798cc8d Binary files /dev/null and b/x64/Debug/MineSweeper.tlog/CL.command.1.tlog differ diff --git a/x64/Debug/MineSweeper.tlog/CL.read.1.tlog b/x64/Debug/MineSweeper.tlog/CL.read.1.tlog new file mode 100644 index 0000000000000000000000000000000000000000..15c522e23b612ecdf20925bf97e9229a29e4b652 Binary files /dev/null and b/x64/Debug/MineSweeper.tlog/CL.read.1.tlog differ diff --git a/x64/Debug/MineSweeper.tlog/CL.write.1.tlog b/x64/Debug/MineSweeper.tlog/CL.write.1.tlog new file mode 100644 index 0000000000000000000000000000000000000000..21f2deb54819fc783936fae1bb238d0776e61711 Binary files /dev/null and b/x64/Debug/MineSweeper.tlog/CL.write.1.tlog differ diff --git a/x64/Debug/MineSweeper.tlog/MineSweeper.lastbuildstate b/x64/Debug/MineSweeper.tlog/MineSweeper.lastbuildstate new file mode 100644 index 0000000000000000000000000000000000000000..5b5f3f71931457f83fa7aa75062021e1dde747e8 --- /dev/null +++ b/x64/Debug/MineSweeper.tlog/MineSweeper.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.30.30705:TargetPlatformVersion=10.0.19041.0: +Debug|x64|C:\Users\Anti\source\repos\mine-sweeper\| diff --git a/x64/Debug/MineSweeper.tlog/link.command.1.tlog b/x64/Debug/MineSweeper.tlog/link.command.1.tlog new file mode 100644 index 0000000000000000000000000000000000000000..fd8310dbfd3bf240310f8971ea27d513cf84ae3a Binary files /dev/null and b/x64/Debug/MineSweeper.tlog/link.command.1.tlog differ diff --git a/x64/Debug/MineSweeper.tlog/link.read.1.tlog b/x64/Debug/MineSweeper.tlog/link.read.1.tlog new file mode 100644 index 0000000000000000000000000000000000000000..ea2cf4aab950dec5277dcb05339f9a679b4a87a9 Binary files /dev/null and b/x64/Debug/MineSweeper.tlog/link.read.1.tlog differ diff --git a/x64/Debug/MineSweeper.tlog/link.write.1.tlog b/x64/Debug/MineSweeper.tlog/link.write.1.tlog new file mode 100644 index 0000000000000000000000000000000000000000..78d8589457ee94b1f8f106ea40f3ef87e06c40f6 Binary files /dev/null and b/x64/Debug/MineSweeper.tlog/link.write.1.tlog differ diff --git a/x64/Debug/MineSweeper.vcxproj.FileListAbsolute.txt b/x64/Debug/MineSweeper.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000000000000000000000000000000000000..7214faafe3eaaa16e8b0087fd5ffee8c76b5dc75 --- /dev/null +++ b/x64/Debug/MineSweeper.vcxproj.FileListAbsolute.txt @@ -0,0 +1 @@ +C:\Users\Anti\source\repos\mine-sweeper\x64\Debug\MineSweeper.exe diff --git a/x64/Debug/run_app.obj b/x64/Debug/run_app.obj new file mode 100644 index 0000000000000000000000000000000000000000..fa66f59bfd5cb40c51fa06f6347af4e984236e60 Binary files /dev/null and b/x64/Debug/run_app.obj differ diff --git a/x64/Debug/vc143.idb b/x64/Debug/vc143.idb new file mode 100644 index 0000000000000000000000000000000000000000..41e4e8e7ca622165b13c11e3874391712df4d4fa Binary files /dev/null and b/x64/Debug/vc143.idb differ diff --git a/x64/Debug/vc143.pdb b/x64/Debug/vc143.pdb new file mode 100644 index 0000000000000000000000000000000000000000..26022959966271755d54f9428831614f6d7e20a8 Binary files /dev/null and b/x64/Debug/vc143.pdb differ