Update
parent
cb4c18f285
commit
bb1c22347e
@ -1,2 +1,59 @@
|
||||
# Fractal
|
||||
|
||||
Informally speaking fractal is a shape that's geometrically "infinitely complex" while being described in an extremely simple way, e.g. with a very simple formula. Shapes found in the nature, such as trees, mountains or clouds, are often fractals. Fractals show self-similarity, i.e. when "zooming" into an ideal fractal we keep seeing it is composed, down to an infinitely small scale, of shapes that are similar to the shape of the whole fractal; e.g. the branches of a tree look like smaller versions of the whole tree etc.
|
||||
|
||||
Fractals are the beauty of mathematics, they can impress even complete non-mathematicians and so are probably good as a motivational example in [math](math.md) education.
|
||||
|
||||
Fractal is formed by [iteratively](iteration.md) or [recursively](recursion.md) (repeatedly) applying its defining rule -- once we repeat the rule infinitely many times, we've got a perfect fractal. [In the real world](irl.md), of course, both in nature and in computing, the rule is just repeat many times as we can't repeat literally infinitely. The following is an example of how iteration of a rule creates a simple tree fractal; the rule being: *from each branch grow two smaller branches*.
|
||||
|
||||
```
|
||||
V V V V
|
||||
\./ \./ V \./ \./ V
|
||||
| | _| | | |_ >_| | | |_<
|
||||
'-.| |.-' '-.| |.-' '-.| |.-'
|
||||
\ / \ / \ / \ /
|
||||
\ / \ / \ / \ /
|
||||
| | | |
|
||||
| | | |
|
||||
| | | |
|
||||
|
||||
iteration 0 iteration 1 iteration 2 iteration 3
|
||||
```
|
||||
|
||||
Mathematically fractal is a shape whose [Hausdorff dimension](hausdorff_dimension.md) (the "scaling factor of the shape's mass") is non-integer. For example the [Sierpinski triangle](sierpinski_triangle.md) can normally be seen as a 1D or 2D shape, but its Hausdorff dimension is approx. 1.585 as if we scale it down twice, it decreases its "weight" three times (it becomes one of the three parts it is composed of); Hausdorff dimension is then calculated as log(3)/log(2) ~= 1.585.
|
||||
|
||||
[L-systems](l_system.md) are one possible way of creating fractals. They describe rules in form of a [formal grammar](grammar.md) which is used to generate a string of symbols that are subsequently interpreted as drawing commands (e.g. with [turtle graphics](turtle_graphics.md)) that render the fractal. The above shown tree can be described by an L-system. Among similar famous fractals are the [Koch snowflake](koch_snowflake.md) and [Sierpinski Triangle](sierpinski_triangle.md).
|
||||
|
||||
|
||||
```
|
||||
/\
|
||||
/\/\
|
||||
/\ /\
|
||||
/\/\/\/\
|
||||
/\ /\
|
||||
/\/\ /\/\
|
||||
/\ /\ /\ /\
|
||||
/\/\/\/\/\/\/\/\
|
||||
|
||||
Sierpinski Triangle
|
||||
```
|
||||
|
||||
Fractals don't have to be [deterministic](determinism.md), sometimes there can be [randomness](random.md) in the rules which will make the shape be not perfectly self-similar (e.g. in the above shown tree fractal we might modify the rule to *from each branch grow 2 or 3 new branches*).
|
||||
|
||||
Another way of describing fractals is by iterative mathematical formulas that work with points in [space](space.md). One of the most famous fractals formed this way is the **[Mandelbrot set](mandelbrot.md)**. It is the set of [complex numbers](complex_number.md) *c* such that the series *z\_next = (z\_previous)^2 + c*, *z0 = 0* does not [diverge](divergence.md) to [infinity](infinity.md). Mendelbrot set can nicely be rendered by assigning each iteration's result a different color; this produces a nice colorful fractal. [Julia sets](julia_set.md) are very similar and there is infinitely many of them (each Julia set is formed like the Mandelbrot set but *c* is fixed for the specific set and *z0* is the tested point in the complex plain).
|
||||
|
||||
Fractals can of course also exist in 3 and more dimensions so we can have also have animated 3D fractals etc.
|
||||
|
||||
## Fractals In Tech
|
||||
|
||||
Computers are good for exploring and rendering fractals as they can repeat given rule millions of times in a very short time. Programming fractals is quite easy thanks to their simple rules, yet this can highly impress noobs.
|
||||
|
||||
3D fractals can be rendered with [ray marching](ray_marching.md) and so called *distance estimation*. This works similarly to classic [ray tracing](ray_tracing.md) but the rays are traced iteratively: we step along the ray and at each step use an estimate of the current point to the surface of the fractal; once we are "close enough" (below some specified threshold), we declare a hit and proceed as in normal ray tracing (we can render shadows, apply materials etc.). The distance estimate is done by some clever math.
|
||||
|
||||
[Mandelbulber](mandelbulber.md) is a [free](free_software.md), advanced software for exploring and rendering 3D fractals using the mentioned method.
|
||||
|
||||
[Marble Racer](marble_racer.md) is a [FOSS](foss.md) [game](game.md) in which the player races a glass ball through levels that are animated 3D fractals. It also uses the distance estimation method implemented as a [GPU](gpu.md) [shader](shader.md) and runs in real-time.
|
||||
|
||||
Fractals are also immensely useful in [procedural generation](procgen.md), they can help generate complex art much faster than human artists, and such art can only take a very small amount of storage.
|
||||
|
||||
There also exist such things as fractal antennas and fractal transistors.
|
@ -0,0 +1,52 @@
|
||||
# Minigame
|
||||
|
||||
Minigame is a very small and simple [game](game.md) intended to entertain the player for just a short amount of time, unlike a full fledged game. Minigames may a lot of times be embedded into a bigger game (as an [easter egg](easter_egg.md) or as a part of a game mechanic such as lock picking), they may come as an extra feature on primarily non-gaming systems, or appear in collections of many minigames as a bigger package (e.g. various party game collections). Minigames include e.g. [minesweeper](minesweeper.md), [sokoban](sokoban.md), the Google [Chrome](chrome.md) T-rex game, [Simon Tatham's Portable Puzzle Collection](stppc.md), as well as many of the primitive old games like [Pong](pong.md) and [Tetris](tetris.md). Minigames are nice from the [LRS](lrs.md) point of view as they are [minimalist](minimalism.md), simple to create, often [portable](portability.md), while offering a potential for great [fun](fun.md) nevertheless.
|
||||
|
||||
Despite the primary purpose of minigames many players invest huge amounts of time into playing them, usually competitively e.g. as part of [speedrunning](speedrun.md).
|
||||
|
||||
Minigames are still very often built on the principles of old arcade games such as getting the highest score or the fastest time. For this they can greatly benefit from [procedural generation](procgen.md) (e.g. endless runners).
|
||||
|
||||
## List Of Minigames
|
||||
|
||||
This is a list of just some of many minigames and minigame types.
|
||||
|
||||
- **[2048](2048.md)**
|
||||
- **[angry bird](angry_bird.md)**
|
||||
- **[arkanoid](arkanoid.md)**
|
||||
- **[asteroids](asteroids.md)**
|
||||
- **[backgammon](backgammon.md)**
|
||||
- **[checkers](checkers.md)**
|
||||
- **[chess](chess.md)** (and chess puzzles)
|
||||
- **city bomber**: a plane is descending on the screen, player has to drop bombs to destroy building so that it can land
|
||||
- **concentration**
|
||||
- **[donkey kong](donkey_kong.md)**
|
||||
- **[endless runner](endless_runner.md)**
|
||||
- **[fifteen](fifteen.md)**
|
||||
- **[game of life](gol.md)**
|
||||
- **[go](go_game.md)**
|
||||
- **guess a number**
|
||||
- **[hangman](hangman.md)**
|
||||
- **[invaders](invaders.md)**
|
||||
- **knowledge quiz**
|
||||
- **[loderunner](loderunner.md)**
|
||||
- **[ludo](ludo.md)**
|
||||
- **[lunar lander](lunar_lander.md)**
|
||||
- **[mahjong](mahjong.md)**
|
||||
- **maze**
|
||||
- **[minigolf](minigolf.md)**
|
||||
- **[minesweeper](minesweeper.md)**
|
||||
- **[pacman](pacman.md)**
|
||||
- **[pinball](pinball.md)**
|
||||
- **[pong](pong.md)**
|
||||
- **[rock-paper-scissors](rock_paper_scissors.md)**
|
||||
- **[shoot'em up](shmup.md)**
|
||||
- **[sokoban](sokoban.md)**
|
||||
- **[solitaire](solitaire.md)**
|
||||
- **[snake](snake.md)**
|
||||
- **[sudoku](sudoku.md)**
|
||||
- **[tetris](tetris.md)** (block game, "tetris" is trademarked)
|
||||
- **[tic-tac-toe](tic_tac_toe.md)**
|
||||
- **[tower of hanoi](tower_of_hanoi.md)**
|
||||
- **[tron](tron.md)**
|
||||
- **[untangle](untangle.md)**
|
||||
- **[QWOP](qwop.md)**
|
@ -0,0 +1,29 @@
|
||||
# Zero
|
||||
|
||||
Zero (0) is a [number](number.md) signifying the absence of a thing we count. It precedes [1](one.md) and follows -1.
|
||||
|
||||
Some properties of and facts about this number follow:
|
||||
|
||||
- It is [even](even.md).
|
||||
- It is neither positive nor negative. However in some computer numeric encodings (such as [one's complement](ones_complement.md)) there exist two representations of zero and so we may hear about a positive and negative zero, even though mathematically there is no such a thing.
|
||||
- It is a [whole number](integer.md), a [natural number](natural_number.md), a [rational number](rational_number.md), a [real number](real_number.md) and a [complex number](complex_number.md).
|
||||
- It is **NOT** a [prime number](prime.md).
|
||||
- It is an additive identity, i.e. adding 0 to anything has no effect. Subtracting 0 from anything also has no effect.
|
||||
- Multiplying anything by 0 gives 0.
|
||||
- Its representation in all traditional numeral systems is the same: 0.
|
||||
- 0^*x* (zero to the power of *x*), for *x* not equal to 0, is always 0.
|
||||
- *x*^0 (*x* to the power of 0), for *x* not equal to 0, is always 1.
|
||||
- 0^0 (0 to the power of 0) is **not defined**!
|
||||
- In programming we start counting from 0 (unlike in real life where we start with 1), so we may encounter the term **zeroth** item. We count from 0 because we normally express offsets from the first item, i.e. 0 means "0 places after the first item".
|
||||
- It is, along with 1, one of the symbols used in [binary](binary.md) logic and is normally interpreted as the "off"/"false"/"low" value.
|
||||
- Its opposite is most often said to be the [infinity](infinity.md), even though it depends on the angle of view and the kind of infinity we talk about. Other numbers may be seen as its opposite as well (e.g. 1 in the context of [probability](probability.md)).
|
||||
- As it is one of the most commonly used numbers in programming, computers sometimes deal with it in special ways, for example in [assembly](assembly.md) languages there are often special instructions for comparing to 0 (e.g. `NEZ`, not equals zero) which can save memory and also be faster. So as a programmer you may optimize your program by trying to use zeros if possible.
|
||||
- In [C](c.md) 0 represents the [false](false.md) value, a function returning 0 many times signifies an [error](error.md) during the execution of that function. However 0 also sometimes means success, e.g. as a return value from the main function.
|
||||
|
||||
**Dividing by zero is not defined**, it is a forbidden operation for a number of reasons, e.g. because it breaks equations (allowing dividing by zero would also allow us to make basically any equation hold, even those that normally don't). In programming dividing by zero typically causes an error, crash of a program or an [exception](exception.md). When operating with [limits](limit.md) however, we can handle divisions by zero in a special way (find out what value an [expression](expression.md) approaches if we get infinitely close to dividing by 0).
|
||||
|
||||
## See Also
|
||||
|
||||
- [NULL](null.md)
|
||||
- [infinity](infinity.md)
|
||||
- [one](one.md)
|
Loading…
Reference in New Issue