removed prompts
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
This is the start of a high performant c++ Wave Function Collapse repo for n-dimensions. To increase performance we want to avoid using a large memory footprint, virtual polymoprhism, etc.
|
||||
|
||||
For now we want to make it possible to use and test WFC with 2 dimensions, but later on we'll want to use 3D or even 4D. Please implement the algorithm with 2 dimensions for now. use the console for outputting tests.
|
||||
@@ -1,10 +0,0 @@
|
||||
We're using c++20, I want you to create a file wfc_bit_container.hpp in include\nd-wfc which contains a templated class whose goal is to minimize the amount of bits we use for masking. The template type should be a number (The number of bits stored) and should have the Size of the container (how many of these integers should we store). The size is 0 by default, which means it's resizable and it should use an std::vector instead of an std::array.
|
||||
examples of given parameters:
|
||||
- Bits: 2; Size: 8; -> 2 requires 2 bits, std::array<uint8_t, 2>
|
||||
- Bits: 3; size: 4; -> 3 requires 4 bits, std::array<uint8_t, 2>
|
||||
- Bits: 0; size 128; -> 0*128 == 0; std::array<uint8_t, 0>
|
||||
- Bits: 32; size: 100; -> std::array<uint32_t, 100>
|
||||
- Bits: 256; size: 0; -> std::vector<uint64_t[2]>
|
||||
Make sure that the amount of bits used is a power of 2: 0, 1, 2, 4, 8, 16, 32, 64. If more than 64 bits are required, make sure it is a multiple of 64: 64, 128, 196, 256, etc.
|
||||
We should be able to get/set values with an index, do bit operations like |, &, ^ on individual elements, do std::countl_zero, std::countl_one, std::countr_zero, std::countr_one & std::popcount.
|
||||
This repo tries to be as optimized as possible. Make good use of `asserts` instead of `if conditions` wherever you are checking something.
|
||||
@@ -1 +0,0 @@
|
||||
Can you make a fast sudoku loader and solution validator in demos/sudoku/. make sure to use as little memory as possible for the sudoku class and validator
|
||||
@@ -1 +0,0 @@
|
||||
inside the demos/nonogram directory, please implement a nonogram loader that stores the nonogram solution and instructions in a seperate class. Use as little memory as possible for storing the solution and instructions. Only store important info, we don't need the name of the author.
|
||||
@@ -1,46 +0,0 @@
|
||||
In this repo I want you to implement a templated Wave Function Collapse engine that would be compatible with 2D grids, 3D grids, Sudoku, Picross, etc.
|
||||
I want the following to be possible:
|
||||
|
||||
WFC::Builder<World>()
|
||||
.variable(name/id/userdata, ...).constrains([](World& world, int worldID, Constrainer& constrainer, name/id/userdata){ constrainer.constrain(world.getid(...)); })
|
||||
.variable(...)
|
||||
|
||||
The World is responsible for giving its size and giving ids. the ids should all fit in the size of the world.
|
||||
when setting the variable on a node/cell, it should call the lambda to constrain the rest of the unknown nodes/cells.
|
||||
The WFC should have no concept of coordinate systems. The WFC algorithm should be able to work even without coordinates, and just with a graph for example.
|
||||
|
||||
sudoku eg:
|
||||
WFC::Builder<Array2D<uint8_t,9,9>>()
|
||||
.variable(1,2,3,4,5,6,7,8,9).constrains([](Array2D<uint8_t,9,9>& world, int worldID, Constrainer& constrainer, uint8_t var)
|
||||
{
|
||||
int [x,y] = world.getCoord(worldID);
|
||||
|
||||
for (int i{}; i < 9; ++i)
|
||||
{
|
||||
constrainer.constrain(9 * y + i, var);
|
||||
constrainer.constrain(i * y + x, var);
|
||||
// TODO add small square constraint
|
||||
}
|
||||
})
|
||||
|
||||
2D tilemap eg:
|
||||
WFC::Builder<Array2D<uint8_t, 100,100>>()
|
||||
.variable(SEA).constrains([](Array2D<uint8_t, 100,100>& world, int worldID, Constrainer& constrainer, uint8_t var)
|
||||
{
|
||||
int [x,y] = world.getCoord(worldID);
|
||||
|
||||
constrainer.only(y*100 + x - 1, SEA, BEACH);
|
||||
constrainer.only(y*99 + x, SEA, BEACH);
|
||||
constrainer.only(x*101 + x, SEA, BEACH);
|
||||
constrainer.only(x*100 + x + 1, SEA, BEACH);
|
||||
})
|
||||
.variable(BEACH).constrains([](Array2D<uint8_t, 100,100>& world, int worldID, Constrainer& constrainer, uint8_t var)
|
||||
{
|
||||
int [x,y] = world.getCoord(worldID);
|
||||
|
||||
constrainer.only(y*100 + x - 1, SEA, LAND);
|
||||
constrainer.only(y*99 + x, SEA, LAND);
|
||||
constrainer.only(x*101 + x, SEA, LAND);
|
||||
constrainer.only(x*100 + x + 1, SEA, LAND);
|
||||
})
|
||||
...
|
||||
@@ -1 +0,0 @@
|
||||
This is a repo for Wafe Function Collapse. The logic is already implemented. There is branching logic that creates a new state and allocates a lot of memory. I want you to create an "stack" allocator specifically for the wfc algorithm that the program can use to quickly allocate new branches. The deallocation should only occur when a branch goes out of scope, so no need to have logic in the deallocate() function.
|
||||
@@ -1 +0,0 @@
|
||||
I want you to create code files in the demos/ directory that helps with console rendering. I want to be able to render the sudoku and nonogram demos that I have right now, but also have them solved in real time without adding new lines to the console. Test out your solution by rendering a sudoku puzzle. Give a clear API to render the state of the existing Sudoku class. Make sure you first allocate enough space in the console before rendering anything. So first add some empty lines before the rendering.
|
||||
@@ -1,5 +0,0 @@
|
||||
in wfc.hpp I want you to implement a way for the user to customize the way random cells are picked in the Branch function. Right now it just uses uniform_int_distribution and mt19937 to generate random indices, but I want the user to be able to supply their own functions and data using lambdas.
|
||||
The lambda should be supplied an std::span<VarT> of possible cell values and should return the index.
|
||||
Test this by making a default randomization function a constexpr simple seed randomizer using a mutable lambda to change the seed.
|
||||
Add a more advanced one that uses the uniform_int_distribution and mt19937 implementation that is currently in use.
|
||||
The goal of this project is to be able to use the wfc algorithm at compile time, to be able to solve sudokus at compile time. So make sure its constexpr friendly.
|
||||
@@ -1,10 +0,0 @@
|
||||
in wfc.hpp there are 2 random selector structs. I want you to create another one that can be used to give weights to values.
|
||||
use 16-bit for the individual weights for each value. The weights should work at compile time.
|
||||
The WeightedSelector is a RandomSelector that uses another random selector as a backend.
|
||||
example of how the weights should work:
|
||||
Builder::
|
||||
::DefineIDs<...>
|
||||
::DefinedConstrainer<...>
|
||||
::SetRandomSelector<...>
|
||||
::Weights<DEFAULT_WEIGHT, Weight<VarT, WEIGHT>, Weight<VarT, WEIGHT>, ...>
|
||||
::Build
|
||||
Reference in New Issue
Block a user