This commit is contained in:
Miloslav Ciz 2022-06-29 21:51:01 +02:00
parent 549ebc70a9
commit 2993dadb56
4 changed files with 6 additions and 29 deletions

View file

@ -233,8 +233,8 @@ int main(void)
while (!quit) while (!quit)
{ {
int forwX = cos((2 * 3.14 * camAngle) / ((float) U) ) * U, int forwX = cos(2 * 3.14 * camAngle) * U,
forwY = sin((2 * 3.14 * camAngle) / ((float) U) ) * U, forwY = sin(2 * 3.14 * camAngle) * U,
vecFromX = forwX + forwY, // leftmost ray vecFromX = forwX + forwY, // leftmost ray
vecFromY = forwY - forwX, vecFromY = forwY - forwX,
vecToX = forwX - forwY, // rightmost ray vecToX = forwX - forwY, // rightmost ray
@ -261,8 +261,8 @@ int main(void)
switch (c) // movement switch (c) // movement
{ {
case 'a': camAngle -= 30; break; case 'a': camAngle += 30; break;
case 'd': camAngle += 30; break; case 'd': camAngle -= 30; break;
case 'w': camX += forwX / 2; camY += forwY / 2; break; case 'w': camX += forwX / 2; camY += forwY / 2; break;
case 's': camX -= forwX / 2; camY -= forwY / 2; break; case 's': camX -= forwX / 2; camY -= forwY / 2; break;
case 'q': quit = 1; break; case 'q': quit = 1; break;

View file

@ -4,7 +4,7 @@
In general recursion is a situation in which a [definition](definition.md) refers to itself; for example the definition of a human's ancestor as "the human's parents and the ancestors of his parents" ([fractals](fractal.md) are also very nice example of what a simple recursive definition can achieve). In programming recursion takes on a meaning of a **function that calls itself**; this is the meaning we'll suppose in this article, unless noted otherwise. In general recursion is a situation in which a [definition](definition.md) refers to itself; for example the definition of a human's ancestor as "the human's parents and the ancestors of his parents" ([fractals](fractal.md) are also very nice example of what a simple recursive definition can achieve). In programming recursion takes on a meaning of a **function that calls itself**; this is the meaning we'll suppose in this article, unless noted otherwise.
We divide recursion to a **direct** and **indirect** one. In direct recursion the function calls itself directly, in indirect function *A* calls a function `B` which ends up (even possibly by calling some more functions) calling *A* again. Indirect recursion is tricky because it may appear by mistake and cause a [bug](bug.md) (which is nevertheless easily noticed as the program will mostly run out of memory and crash). We divide recursion to a **direct** and **indirect** one. In direct recursion the function calls itself directly, in indirect function *A* calls a function *B* which ends up (even possibly by calling some more functions) calling *A* again. Indirect recursion is tricky because it may appear by mistake and cause a [bug](bug.md) (which is nevertheless easily noticed as the program will mostly run out of memory and crash).
When a function calls itself, it starts "diving" deeper and deeper and in most situations we want this to stop at some point, so in most cases **a recursion has to contain a terminating condition**. Without this condition the recursion will keep recurring and end up in an equivalent of an infinite loop (which in case of recursion will however crash the program with a [stack overflow](stack_overflow.md) exception). Let's see this on perhaps the most typical example of using recursion, a [factorial](factorial.md) function: When a function calls itself, it starts "diving" deeper and deeper and in most situations we want this to stop at some point, so in most cases **a recursion has to contain a terminating condition**. Without this condition the recursion will keep recurring and end up in an equivalent of an infinite loop (which in case of recursion will however crash the program with a [stack overflow](stack_overflow.md) exception). Let's see this on perhaps the most typical example of using recursion, a [factorial](factorial.md) function:

View file

@ -1,23 +0,0 @@
# Selflessness
Selflessness is the opposite of [self interest](self_interest.md). That is: being selfless means acting in ways that help everyone as opposed to oneself. Under our definition *everyone* also includes *self*, so selflessness doesn't mean not helping oneself -- helping self is okay as long as it also helps everyone else equally or more.
Selflessness is extremely important in [LRS](lrs.md): our technology must be maximally helpful to everyone which excludes any malicious features such as [proprietary code](proprietary.md), [bloat](bloat.md), [ads](ad.md), legal conditions (even [free](free_software.md)), [spyware](spyware.md) and other malware or anything that makes the program worse for the general user in order to specially benefit the program's author.
This is in stark contrast with [capitalist software](capitalist_software.md) that's by definition made solely for its creator's profit and is only as helpful to others as that serves the ultimate goal.
## Money
The greatest challenge of selfless software is its development under capitalist society which is highly hostile to selflessness by its strict application of the tyranny of economy onto all areas. In a better society where humans would be free to invest their time freely the issue wouldn't be present; sadly most people are slaves forced to work every day for their food and therefore prevented from creating anything that doesn't bring them money.
So, under current conditions, we have to ask: **Can we charge money for selfless software?** Here we give an answer similar to that of [free software](free_software.md): **It is not wrong to collect money for software as long as this doesn't limit its users, i.e. only completely optional payment is acceptable.** This is in accordance with our definition of selflessness: with optional payment the technology doesn't get worse for anyone and its author simply gets basic resources (food, water, ...) from people who can afford and are willing to share them, by means compatible with the current socioeconomic system. By this we at least somewhat simulate the ideal society in which people do what they truly want because they get basic resources for living.
But **BEWARE**: charging money, even optionally, may introduce subconscious bias towards wanting to earn more and implementing malicious features, and so **it is better to not ask money if it's not needed**, for example if the author already has enough money for comfortable living. By staying completely non-commercial it is better assured the goal remains pure.
## Recommendations
Try to follow this advice in order to achieve high selflessness of your technology:
- **Use [public domain](public_domain.md) waiver** (such as [CC0](cc0.md)), do NOT try to "own" your software in any way and do NOT use licenses with conditions such as attribution, do not seek fame (if your software is good, you will become famous anyway, even without any attribution conditions). This doesn't mean you have to stay anonymous, that can in many situations be worse for everyone.
- **Do not charge money** for the program if you don't have to, and if you do, **make the payment completely optional**.
- **Always have the definition of selflessness on your mind** and from time to time ask yourself whether you're still faithful to it. Ask yourself what's the true goal of your project.

View file

@ -24,7 +24,7 @@ Some SW renderers make use of specialized CPU instructions such as [MMX](mmx.md)
These are some notable software renderers: These are some notable software renderers:
- **[Build engine](build_engine.md)**: While not a "true 3D", this was a very popular [proprietary](proprietary.md) [BSP rendering](bsp.md) engine for older games like Duke Nukem 3D or Blood. - **[Build engine](build_engine.md)**: While not a "true 3D", this was a very popular [proprietary](proprietary.md) portal-rendering engine for older games like Duke Nukem 3D or Blood.
- **[BRender](brender.md)**: Old [proprietary](proprietary.md) commercial renderer used in games such as Carmageddon, Croc or Harry Potter 1. - **[BRender](brender.md)**: Old [proprietary](proprietary.md) commercial renderer used in games such as Carmageddon, Croc or Harry Potter 1.
- **[id Tech](id_tech.md)**: Multiple engines by [Id software](id.md) (later made [FOSS](foss.md)) used for games like [Quake](quake.md) included a software renderer. - **[id Tech](id_tech.md)**: Multiple engines by [Id software](id.md) (later made [FOSS](foss.md)) used for games like [Quake](quake.md) included a software renderer.
- **[Irrlich](irrlicht.md)**: [FOSS](foss.md) game engine including a software renderer as one of its [backends](backend.md). - **[Irrlich](irrlicht.md)**: [FOSS](foss.md) game engine including a software renderer as one of its [backends](backend.md).