No description
  • C++ 99.5%
  • Makefile 0.3%
  • CMake 0.2%
Find a file
2025-02-02 18:23:24 -05:00
3ps/ska Added back hash map 2024-10-29 16:52:15 -04:00
.gitignore Update cmake build instructions and update gitignore 2025-02-02 18:23:24 -05:00
CMakeLists.txt Update CMakeLists.txt to include 5 layer executables 2024-11-24 10:51:41 -05:00
lookup.cpp Removed format library usage adn reformat 2024-10-28 17:05:47 -04:00
Makefile Removed format library usage adn reformat 2024-10-28 17:05:47 -04:00
README.md Update cmake build instructions and update gitignore 2025-02-02 18:23:24 -05:00
search.cpp Removed format library usage adn reformat 2024-10-28 17:05:47 -04:00
shapez.hpp Removed format library usage adn reformat 2024-10-28 17:05:47 -04:00

Shapez 2 all possible shapes

This project lists all the possible shapes in Shapez 2 by bruteforce. This fork changes little things to make the compiling process easier

Credits

Requirements

  1. A C++ compiler supporting C++23 (use -std=c++23 argument)
  2. Enumerating all the shapes for Normal and Hard scenarios (4 layers, 4 parts per layer) takes ~32MB memory and ~1.5 minutes.
  3. Enumerating all the shapes for Insane scenario (5 layers, 4 parts per layer) takes ~8GB memory and ~2 hours.

Facultative requirements

make(makefile) or cmake >= 3.30

Usage

  1. Compile the search and lookup files

1.1. Manual method using g++

g++ -o search4 search.cpp -std=c++23 -O3
g++ -o lookup4 lookup.cpp -std=c++23 -O3
g++ -o search5 search.cpp -std=c++23 -O3 -DCONFIG_LAYER=5
g++ -o lookup5 lookup.cpp -std=c++23 -O3 -DCONFIG_LAYER=5

1.2. Use the make command (linux only)

make ALL

1.3. Use cmake

mkdir build
cd build
cmake ..
cmake --build .
  1. Enumerate all the shapes and store in a binary file
$ ./search4 dump4.bin
...
# shapes: 349728289
# halves: 8148
# shapes whose halves aren't stable: 2002457
# quarters: 152
  1. Check whether a shape can be made in the game
$ ./lookup4 dump4.bin P---P---:P-------:cRCu--Cu:--------
The shape is creatable
  1. We can do similar things for 5 layers
$ ./search5 dump5.bin
...
# shapes: 26929624298
# halves: 67669
# shapes whose halves aren't stable: 251172538
# quarters: 476
$ ./lookup5 dump5.bin P-------:P---P---:P-------:cRCu--Cu:--------
The shape is not creatable