Negative indices
xs[-1]: good, bad, ugly?
xs[-1]: good, bad, ugly?
Print statement in Python 2 is optimized for hello world and few other programs people who study the language write.
All elements returned by adjacent
function from the previous post indeed correspond to the tiles adjacent to
the given one. And they indeed are arranged in counter-clockwise order.
So what’s the problem?
While playing HyperRogue (which is awesome, by the way), I began to wonder how such game could be implemented. Crucial component would be discrete coordinate system for hyperbolic tiling, and it turned out that it’s not entirely trivial.
I suppose there could be many valid answers to this question, but I’ll just go with one that is especially convenient for my puproses.
Operations defined in the
previous post are not total.
For example, we can’t go up
from the root of the tree.
That’s because root element has no history.
Let’s pretend that this whole tree is just a subtree of a tree with the same
uniform structure that spans infinitely in all directions (including up
).
As stated in famous Fibonacci rabbit problem, it takes one month for young pair of rabbits to mature (reach reproductive age). Mature pair breeds, and in one month produces young pair of offsprings, while remaining reproductive itself.
Suppose we pick biased coin at random, so that tails probability $\theta$ is itself uniformly distributed on $[0, 1]$. What is the distribution of number of tails if we toss this coin $n$ times?