diff --git a/Resources:-spread-functions.md b/Resources:-spread-functions.md index bba7cc0..5f330e7 100644 --- a/Resources:-spread-functions.md +++ b/Resources:-spread-functions.md @@ -18,6 +18,12 @@ Build-in functions make models syntax easier to read: * `nth(number)`: true for each nth cell only, e.g. `nth(2)` skips 50% of cells, `nth(5)` skips 80% of cells * `random(number)`: percentage of true, e.g. `50` will return true in 50% of cases +Let's say we want a resource to be generated in hot and highly elevated areas. If altitude is medium, let it also be allowed, but pretty rarely. The model will be something like `minTemp(15) && (minHeight(70) || minHeight(40) && nth(5))`. + +----- +const fn = new Function("i", "minTemp(15) && (minHeight(70) || minHeight(40) && nth(5))"); +fn(i); + Default biome ids: * 0: Marine * 1: Hot desert