Files
nd-wfc/prompts/9-weighted-random-selector
2025-09-01 14:31:42 +09:00

10 lines
529 B
Plaintext

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