More actions
y5nw is a player on the server.
Personal bookmark
Notes
Note: This section is more or less written based on my own knowledge. Feel free to suggest corrections in my talk page.
Event chance calculation
For a one-shot event that fires with a probability of checked at an interval of (e.g. tree growth), the expected amount of time it takes for the event to fire is .
Note that, in some definition tables in Minetest (e.g. ABMs), the probability is specified using the reciprocal of .
Calculations: Let be the probability of the event not firing at the next check.
(Abandoned) Idea for prefix-notation syntax
For my railtour mod I considered using a simple prefix-notation syntax for filter expressions (although IMO filters have a low priority at the time of writing). A somewhat adequate prefix syntax can be made to sufficiently resemble infix notation used for mathematics. Consider the following example:
x >= 5
As an infix expression, this is parsed to something similar to with .
However, given
(i.e. effectively performs function currying.)
The above expression can be parsed into . It can be checked that
It should be noted that this approach reaches its limitations when multiple "infix" operators are used, as in x >= y + 1
, which is parsed into . Evaluating this gives which does not have a sensible result.
The above issue can be avoided (albeit counterintuitively) by adding parentheses where appropriate, i.e. with x >= (y + 1)
However, with the use of parentheses, a Lisp-based syntax à la (>= x (+ y 1))
appears more attractive as it also involves less function-related abstractions (which avoids issues arising from such abstractions; compare x >= 5
and 5 <= x
with the custom prefix notation)