2048.cpp
1.0.0
用 C++ 編寫的遊戲「2048」的終端版本。
?在 GitHub 的 Twitter 和 Facebook 頁面上精選! ?

遊戲和程式碼可以在 GNU/Linux 和 MacOS 平台上本地運行,但也添加了 Windows 的跨平台相容性。
g++ 、 clang++ 、 pgc++ 、 icpc等)git clone https://github.com/plibither8/2048.cpp cd 2048.cpp對於 CMake 和 Meson,將使用系統上預設的 C++ 編譯器。如果您希望手動選擇 C++ 編譯器,可以選擇新增CXX=clang++ cmake或CXX=clang++ meson等。
ctest -S setup.cmakecmake --install build2048 # run `build/2048` if game is not installed或者
meson buildmeson test -C buildmeson configure build --prefix= $HOME /.local
meson install -C build2048 # run `build/2048` if game is not installed 首先感謝您的貢獻?有幾點要注意:
如果您發現了錯誤,或有想要實現的功能,請提出問題。
如果您提出了拉取請求,請確保在原始程式碼( .cpp和.hpp )檔案上執行clang-format (如果您在其中進行了更改)。
在本機儲存庫中,執行git update-index --skip-worktree ./data/*.txt以確保 git 不會追蹤對資料檔案的更改,因此不會暫存。
我深深感謝以下人員的幫忙:
cstdlib rand改為 C++ 隨機 int 產生器。CMakeLists.txt檔案。1 。clang-format 。Game類別建構子。CMakeLists.txt檔案並將Color枚舉設定為作用域枚舉。const 。[GameBoard].getTile(2,0)指第二行中的第0 個圖塊(或列),在本例中,x = 0 且y = 2。 」符號表示:
注意:
row和column索引從 0 開始。
┌──────┬──────┬──────┬──────┐
│ │ │ │ │
├──────┼──────┼──────┼──────┤
│ │ │ │ │
├──────┼──────┼──────┼──────┤
│ @ │ │ │ │
├──────┼──────┼──────┼──────┤
│ │ │ │ │
└──────┴──────┴──────┴──────┘
版權所有 (c) Mihir Chaturvedi。版權所有。
根據 MIT 許可證獲得許可。