This commit is contained in:
Miloslav Ciz 2022-05-08 01:57:33 +02:00
parent cb4c18f285
commit bb1c22347e
7 changed files with 143 additions and 1 deletions

View file

@ -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.

View file

@ -36,6 +36,7 @@ Trademarks have been known to cause problems in the realm of libre games, for ex
## See Also
- [minigame](minigame.md)
- [open console](open_console.md)
- [fantasy console](fantasy_console.md)
- [chess](chess.md)

View file

@ -20,6 +20,8 @@ Please do NOT post lame "big-bang-theory" jokes like *sudo make sandwich* or *th
- When will they remove the *[touch](touch.md)* and *[kill](kill.md)* commands from [Unix](unix.md)? Probably when they rename *[man pages](man_page.md)* to *person pages*.
- If [law](law.md) was viewed as a programming code, it would be historically the worst case of [bloated](bloat.md) [spaghetti code](spaghetti_code.md) littered with [magic constants](magic_constant.md), undefined symbols and dead code, which is additionally deployed silently and without any [testing](testing.md). Yet it's the most important algorithm of our society.
- At the beginning there was [machine code](machine_code.md). Then they added [assembly](assembly.md) on top of it to make it more comfortable. To make programs portable they created an [operating system](os.md) and a layer of [syscalls](syscall.md). Except it didn't work because other people made other operating systems with different syscalls. So to try to make it portable again they created a high-level language [compiler](compiler.md) on top of it. To make it yet more comfortable they created yet a higher level language and made a [transpiler](transpiler.md) to the lower level language. To make building more platform independent and comfortable they created [makefiles](makefile.md) on top of it. However, more jobs were needed so they created [CMake](cmake.md) on top of makefiles, just in case. It seems like CMake nowadays seems too low level so a new layer will be needed above all the meta-meta-meta build systems. I wonder how high of a tower we can make, maybe they're just trying to get a Guinness world for the greatest bullshit sandwich in history.
- How to install a package on [Debian](debian.md)? I don't know, but on my [Arch](arch.md) it's done with `pacman`.
- Difference between a beginner and pro programmer? Pro programmer fails in a much more sophisticated manner.
## See Also

52
minigame.md Normal file
View file

@ -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)**

View file

@ -15,6 +15,7 @@ If you contribute, add yourself to [wiki authors](wiki_authors.md)! You can also
- **Don't line-break paragraphs** (a pragraph is on a single line). The reasoning is that a text manually formatted to specific width is hard to edit. It's easier to switch to auto-line breaking in your editor.
- **Avoid [unicode](unicode.md), highly prefer [ASCII](ascii.md)**, for the sake of maximum compatibility and simplicity. Use of unicode has to be greatly justified.
- **Each page shall start with a heading** (which may not correspond to article file name).
- I've finally decided that with certain exceptions headings should be written like this: **Each Word Of A Heading Is Capitalized**. This is for simplicity.
- **Filenames of articles shall use a lowercase snake_case**.
- **This isn't [Wikipedia](wikipedia.md)**, memes, opinions and uncensored truths are allowed (and welcome).
- The style of this wiki is **inspired by the famous [WikiWikiWeb](http://wiki.c2.com/?WikiWikiWeb)**.

2
www.md
View file

@ -1,6 +1,6 @@
# World Wide Web
World Wide Web (www or just *the web*) is (or was, if we accept that by 2021 the web is basically dead) a network of interconnected documents on the [Internet](internet.md) (called *websites* or *webpages*). Webpages are normally written in [HTML](html.md) language and can refer to each other by [hyperlinks](hyperlink.md). The web itself works on top of the [HTTP](http.md) protocol. Some people confuse the web with the Internet, but of course those people are retarded: web is just one of many service existing on the Internet (other ones being e.g. [email](email.md) or [torrents](torrent.md)). In order to browse the web you need an Internet connection and a [web browser](browser.md).
World Wide Web (www or just *the web*) is (or was, if we accept that by 2021 the web is basically dead) a network of interconnected documents on the [Internet](internet.md) (called *websites* or *webpages*). Webpages are normally written in [HTML](html.md) language and can refer to each other by [hyperlinks](hyperlink.md). The web itself works on top of the [HTTP](http.md) protocol. Some people confuse the web with the Internet, but of course those people are retarded: web is just one of many service existing on the Internet (other ones being e.g. [email](email.md) or [torrents](torrent.md)). In order to browse the web you need an Internet connection and a [web browser](browser.md). An important part of the web is also searching its vast amounts of information with [search engines](search_engine.md) such as the infamous [Google](google.md) engine.
Web is kind of a bloated [shit](shit.md), for more [suckless](suckless.md) alternatives see [gopher](gopher.md) and [gemini](gemini.md).

29
zero.md Normal file
View file

@ -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)