master
Miloslav Ciz 1 month ago
parent b9fd8d7532
commit f8e54987d6

@ -14,7 +14,7 @@ Some metrics traditionally used to measure bloat include **[lines of source code
Despite this there isn't any completely objective measure that would say "this software has exactly X % of bloat", bloat is something judged based on what we need/want, what tradeoffs we prefer etc. The answer to "how much bloat" there is depends on the answer to **"what really is bloat?"**. To answer this question most accurately we can't limit ourselves to simplifications such as [lines of code](loc.md) or number of package dependencies -- though these are very good estimates for most practical purposes, a more accurate insight is obtained by carefully asking what *burdens* and *difficulties* of ANY kind come with given technology, and also whether and how much of a necessary evil they are. Realize for example that if your software doesn't technically require package X to run or be compiled, package X may be [de facto](de_facto.md) required for your software to exist and work (e.g. a pure multiplayer game client won't have the server as a dependency, but it will be useless without a server, so de facto all bloat present in the server is now in a wider sense also the client's burden). So if you've found a program that's short and uses no libraries, you still have to check whether the language it is written in isn't bloated itself, whether the program relies on running on a complex platform that cannot be implemented without bloat, whether some highly complex piece of hardware (e.g. [GPU](gpu.md) or 8GB of [RAM](ram.md)) is required, whether it relies on some complex Internet service etc. You can probably best judge the amount of bloat most objectively by asking the following: if our current technology instantly disappeared, how hard would it be to make this piece of technology work again? This will inevitably lead you to investigating how hard it would be to implement all the dependencies etc.
For a quick overview let us average some data over time -- the table that follows shows growth of system requirements and sizes and averages them to give an estimate of bloat ratio with respect to the first row. Please note some data in the table may not be completely accurate, interpolation/extrapolation was used for missing values, we're only making an estimate after all, but still notice our computing resource usage already grew almost 200 times despite computers being generally slower and less responsive.
For a quick overview let us average some data over time -- the table that follows shows growth of system requirements and sizes and averages them to give an estimate of bloat ratio with respect to the first row. Please note some data in the table may not be completely accurate, interpolation/extrapolation was used for missing values, we're only making an estimate after all, but still notice our computing resource usage already grew almost 2000 times despite computers being generally slower and less responsive.
| year | avg. webpage size (KB) | Windows min RAM MB/CPU MHz/HDD MB | Debian min RAM MB/HDD MB | FPS game min RAM MB/CPU MHz/HDD MB | Blender (win zip KB) | % of base |
| ----- | ---------------------- | --------------------------------- | ------------------------ | ---------------------------------- | -------------------- | --------- |

@ -7,6 +7,7 @@ Disease is a bad state of living organism's health caused by failure of its inne
- [autism](autism.md)
- [cancer](cancer.md)
- [capitalism](capitalism.md)
- citation addiction, also known as [pseudoskeptic](pseudoskepticism.md)'s disease^[1][2][3]
- [data hoarding](data_hoarding.md)
- [depression](depression.md)
- [egoism](egoism.md)

@ -12,7 +12,7 @@ See also [needed projects](needed.md).
Here you will find suggestions for programming projects, roughly sorted by their difficulty (in each level projects will be sorted roughly by difficulty too). You can use this to practice what you've learned in [c tutorial](c_tutorial.md), try to follow the [LRS](lrs.md) principles. We are kind of assuming you'll be programming these projects in [C](c.md) -- that's how we judge the difficulty etc. -- but of course no one is stopping you to make the project in another language if you so desire :)
**LRS programming challenge!** If you want you can treat this as a [game](game.md), kind of achievements you can collect. You can even make a git repo for your solutions so others can see and admire them { Pls send me the repo if you make it. ~drummyfish } Here are the rules:
**LRS programming challenge!** If you want you can treat this as a [game](game.md), kind of achievements you can collect. You can even make a git repo for your solutions so others can see and admire them { I'll be glad if you send me a link. ~drummyfish } Here are the rules:
- Award yourself points like this:
- 1 point for a completed project in level 0.
@ -27,29 +27,34 @@ Here you will find suggestions for programming projects, roughly sorted by their
### Level 0: Trivial, *Piece Of Cake*
1. **hello world**: Make a program that outputs `hello world`.
1. **hello**: Make a program that outputs `hello`.
2. **counting**: Make a program that outputs numbers from 1 up to 100.
3. **guess a number**: Make a game in which the computer secretly thinks a number from 0 to 9 and the player guesses the number. The computer then says if the player won and what the secret number what.
4. **password generator**: Make a program which when run outputs randomly generated password (the password must be different each time you run the program of course). The password must be at least 10 characters long, contain at least one decimal digit and one special character.
5. **average**: Make a program that reads two numbers (you can assume only non-negative integers will be input) and writes out their average (it can be rounded, even to just integer, e.g. 3 and 8 can give 5).
### Level 1: Easy, *I'm Too Young To Die*
1. **[fizzbuzz](fizzbuzz.md)**: Write the classic fizzbuzz program.
2. **number [encyclopedia](encyclopedia.md)**: Make a program that writes number from 0 to 1000 (including both) and about each of which it writes some facts. These facts have to include at least the number's square, square root, sum of its decimal digits, its [binary](binary.md) representation, prime factorization and whether the number is [prime](prime.md), perfect number and [Fibonacci](fibonnaci.md) number.
3. **[brainfuck](brainfuck.md) interpreter**: Make a program that interprets brainfuck. You may choose to read the input program either from standard input or from a file (the file may have some hardcoded name, e.g. your program will just look for a file `program.bf` in the same directory). If the brainfuck program is invalid or runtime error occurs in it, you may just write out `error` and halt your interpreter. Thumbs up for making the interpreter nicer, e.g. allowing to pass input file name as a CLI argument, reporting more details about errors (e.g. its position in source code) and so on.
4. **[game of life](game_of_life.md)**: Make a program that simulates game of life on a finite *N * N* grid, with wrapping (i.e. a cell on the very left of the grid is considered a neighbor of the cell on the very right in the same row, same thing with top and bottom). Make *N* configurable at least as a compile time option, draw the world as [ASCII art](ascii_art.md) to terminal, make the user step forward by pressing some key. You can initialize the grid values randomly, but thumbs up for allowing setting the initial world state (e.g. reading it from a file or something).
5. **text adventure**: Make an interactive [CLI](cli.md) text adventure that will take an average player at least 10 minutes to finish. Part of game mechanics must involve inventory, i.e. picking up items, carrying them around and using them.
6. **calculator**: Make an interactive calculator -- it can be a purely [command line](cli.md) program into which user types expressions and your program evaluates them. The functionality must be at least on the level of the most plain physical calculators, i.e. it doesn't have to parse whole complex expressions, but it should be able to add, subtract, multiply, divide and find square roots. Results can be approximate, showing just 3 fractional decimal digits. Thumbs up for more features like handling expressions with brackets, converting between bases and so on.
2. **[anagram](anagram.md) checker**: Make a program that reads one line of text from the user and checks if it's an anagram (i.e. if it's spelled the same forward and backwards) or not -- you can just output *yes* or *no*.
3. **number [encyclopedia](encyclopedia.md)**: Make a program that writes number from 0 to 1000 (including both) and about each of which it writes some facts. These facts have to include at least the number's square, square root, sum of its decimal digits, its [binary](binary.md) representation, prime factorization and whether the number is [prime](prime.md), perfect number and [Fibonacci](fibonnaci.md) number.
4. **[brainfuck](brainfuck.md) interpreter**: Make a program that interprets brainfuck. You may choose to read the input program either from standard input or from a file (the file may have some hardcoded name, e.g. your program will just look for a file `program.bf` in the same directory). If the brainfuck program is invalid or runtime error occurs in it, you may just write out `error` and halt your interpreter. Thumbs up for making the interpreter nicer, e.g. allowing to pass input file name as a CLI argument, reporting more details about errors (e.g. its position in source code) and so on.
5. **[game of life](game_of_life.md)**: Make a program that simulates game of life on a finite *N * N* grid, with wrapping (i.e. a cell on the very left of the grid is considered a neighbor of the cell on the very right in the same row, same thing with top and bottom). Make *N* configurable at least as a compile time option, draw the world as [ASCII art](ascii_art.md) to terminal, make the user step forward by pressing some key. You can initialize the grid values randomly, but thumbs up for allowing setting the initial world state (e.g. reading it from a file or something).
6. **text adventure**: Make an interactive [CLI](cli.md) text adventure that will take an average player at least 10 minutes to finish. Part of game mechanics must involve inventory, i.e. picking up items, carrying them around and using them.
7. **calculator**: Make an interactive calculator -- it can be a purely [command line](cli.md) program into which user types expressions and your program evaluates them. The functionality must be at least on the level of the most plain physical calculators, i.e. it doesn't have to parse whole complex expressions, but it should be able to add, subtract, multiply, divide and find square roots. Results can be approximate, showing just 3 fractional decimal digits. Thumbs up for more features like handling expressions with brackets, converting between bases and so on.
8. **[bytebeat](bytebeat.md)**: Make at least two cool sounding bytebeat songs.
### Level 2: Mid, *Hurt Me Plenty*
1. **[chess](chess.md) without AI**: Make a program that allows two human players to play chess, AI is not required. It can be just a CLI program that draw the chessboard to terminal and reads moves by having players type the squares. Of course the program mustn't allow illegal moves, it must know if the game ended, who won (or if it's a draw) and so on. Implement all rules correctly, i.e. don't forget en passant, castling rights and so on. Time controls are not required at all. Thumbs up for some basic recording of games, undos, showing playable squares or even having some kind of stupid AI (can just make random moves).
2. **2D game**: Make a complete 2D game in which you control a character, with at least 5 levels. Genre is up to you, recommended is e.g. platformer or top-down shooter. Sounds are not required but thumbs up if you have them.
2. **2D game**: Make a complete 2D game in which you control a character, with at least 5 levels. Genre is up to you, recommended is e.g. platformer or top-down shooter. Sounds are not required but thumbs up if you have them. If you want, you can try [SAF](saf.md) for this.
3. **[gopher](gopher.md) browser**: Write interactive gopher browser -- it can be a purely [command line](cli.md) browser. It has to be able to follow links and go back at least one page. The program must include some basic help and ability to save files to disk.
4. **simple text [compression](compression.md)**: Write a program that can compress and decompress plain [ASCII](ascii.md) text files using some very simple technique like [run length encoding](rle.md) (RLE) or dictionary methods (you can even use a fixed dictionary, e.g. have a list of common English words that you will represent by some shorter symbols). You can assume input characters will only have 7bit ASCII codes, so you can compress the text also by dropping the 8th unused bit. You don't have to achieve great compression ratio (you can even enlarge some files), but you must pass the following test: take the program's source code, this article's plain text and Wikipedia main page plain text, your program must compress at least two of these to a smaller size (and of course successfully decompress them into identical files). The program must work as a [filter](filter.md), i.e. it mustn't load the whole file into memory, it has to use approximately same amount of RAM for input of any size.
4. **stupid chatbot**: Make an entertaining chatbot that can react to basic sentences like "how are you?", "are you a robot?" and so on. It must give a human-like answer to at least 20 different sentences. It has to deal with typos and text variability a little bit and has to have some kind of memory (for example it can remember the name of its chatting partner). Test the bot by having it chat with itself.
5. **arbitrary size numbers**: Make a library that allows working with arbitrary size [fixed point](fixed_point.md) [numbers](number.md), i.e. you will provide a data type in which it is possible to store a binary number with any number of bits before and after the radix point -- size of the number will only be limited by amount of RAM your program can use. Each number will dynamically allocate as much memory as it needs. Additionally implement these operations with the numbers: converting to/from the language's native numbers (with rounding), printing and/or converting the number to string, addition, subtraction, multiplication and dividing.
6. **image to [ASCII art](ascii_art.md)**: Make a program that takes an RGB bitmap image and renders it with ASCII characters (i.e. prints it out to console). You can support loading the image from just one file format of your choice, possibly something simple like PPM, BMP or Farbfeld. The program must support resizing the image and it must allow to just set one dimension with keeping the aspect ratio.
5. **stupid chatbot**: Make an entertaining chatbot that can react to basic sentences like "how are you?", "are you a robot?" and so on. It must give a human-like answer to at least 20 different sentences. It has to deal with typos and text variability a little bit and has to have some kind of memory (for example it can remember the name of its chatting partner). Test the bot by having it chat with itself.
6. **arbitrary size numbers**: Make a library that allows working with arbitrary size [fixed point](fixed_point.md) [numbers](number.md), i.e. you will provide a data type in which it is possible to store a binary number with any number of bits before and after the radix point -- size of the number will only be limited by amount of RAM your program can use. Each number will dynamically allocate as much memory as it needs. Additionally implement these operations with the numbers: converting to/from the language's native numbers (with rounding), printing and/or converting the number to string, addition, subtraction, multiplication and dividing.
7. **image to [ASCII art](ascii_art.md)**: Make a program that takes an RGB bitmap image and renders it with ASCII characters (i.e. prints it out to console). You can support loading the image from just one file format of your choice, possibly something simple like PPM, BMP or Farbfeld. The program must support resizing the image and it must allow to just set one dimension with keeping the aspect ratio.
8. **educational [sorting](sorting.md) visualization**: Make a program for visualizing sorting algorithms -- it may draw real graphics (either directly to the screen or by outputting animation file) or just render ASCII art graphics, but it has to clearly show what the sorting algorithm is doing, i.e. which elements are being compared, which are swapped and if it makes good sense to highlight something else (like the pivot or already sorted part of the array), you should do it. Implement at least bubble sort, insertion sort, selection sort and quick sort. Also offer benchmark mode in which all algorithms race in sorting the same array (this can be without advanced visualization, just show e.g. number of steps for each).
9. **3D model of [fractal](fractal.md)**: Make a program that outputs 3D model of either Sieprinski triangle or Koch snowflake fractal. The output shall be some simple 3D format like obj or Collada. The model can be primitive, i.e. it can be just flat shape made of triangles which don't have to really be connected, but the program must allow specifying the number of iterations of the fractal (during invocation, e.g. as a CLI flag). Check that the model is correct by opening it in some 3D editor such as Blender.
### Level 3: Hard, *Ultra Violence*
@ -59,8 +64,10 @@ Here you will find suggestions for programming projects, roughly sorted by their
4. **textured 3D [software renderer](software_rendering.md)**: Make 3D software renderer that rasterizes triangles (just like for example [OpenGL](ogl.md)), with texturing. Affine texture mapping (i.e. the easier, incorrect texturing by linear interpolation of texturing coordinates in screen space) will pass, but thumbs up for perspective correct texture mapping. Implement some basic [shading](shading.md) like, e.g. Goraud with ambient and diffuse light. You have to handle visibility even of non-convex shapes, e.g. with z-buffer or at least approximately by sorting triangles. It's enough if you can display some textured model with setting camera position and rotation somehow. You don't have to handle any 3D formats, 3D models can just be passed as arrays of numbers. It is enough if you output static images e.g. to a file, but thumbs up for being able to handle real-time rendering, animation and having extra features like transparency, scene graph and so on. Extra thumbs up for not using [float](float.md).
5. **[regular expression](regex.md) library**: Make a library for working with regular expressions. Implement at least the following operations: search of regular expression, substitution of regular expressions WITH capture groups and generating random strings by regular expression.
6. **[chess](chess.md) [AI](ai.md)**: Use any sane approach to write a chess engine of reasonable strength. No, you can't just fork stockfish, write it from scratch. It has to support xboard or UCI interface, the strength must be such that it beats [smolchess](smallchesslib.md), Maia 1500, GNU chess, Dreamer, Stockfish or similar engine in a 10 game match with both engines having equivalent settings (search depth, time for move etc.); alternatively it can pass by getting stable rating over 1600 on lichess or by beating someone with FIDE rating over 1500 in a 10 game match. You get the idea.
7. **Bitmap image editor**: [GIMP](gimp.md) is bloated! You have to save us by writing a GUI image editor that's at least a bit more advanced than the original MS paint. It has to be able to save and load images (supporting just one format is enough), draw basic shapes (at least a line, rectangle and circle), copy/paste parts of the image (with rectangle select), resize the image as a whole (with scaling it), have fill bucket and adjust brightness and contrast of the whole image. It should be reasonably user friendly, i.e. upon quitting it should ask if you want to save the work etc. Thumbs up for extra features like filters (blur, invert, edge detect, ...), layers and so on.
7. **bitmap image editor**: [GIMP](gimp.md) is bloated! You have to save us by writing a GUI image editor that's at least a bit more advanced than the original MS paint. It has to be able to save and load images (supporting just one format is enough), draw basic shapes (at least a line, rectangle and circle), copy/paste parts of the image (with rectangle select), resize the image as a whole (with scaling it), have fill bucket and adjust brightness and contrast of the whole image. It should be reasonably user friendly, i.e. upon quitting it should ask if you want to save the work etc. Thumbs up for extra features like filters (blur, invert, edge detect, ...), layers and so on.
8. **64K intro**: Make an impressive [demoscene](demoscene.md)-style 3D intro with music that's at least 1 minute long and fits into 64 KB. It has to be good enough so that an average demoscener would approve it as not completely laughable.
9. **3D [path tracer](path_tracing.md) without [floating point](float.md)**: Write a path tracer (NOT a mere [ray tracer](ray_tracing.md)) without using floating point. It can only produce static images that may just be saved to a file in some simple format (no need to draw real time animation to the screen). It must be possible to position and rotate the camera arbitrarily and to set its field of view. It has to support several shapes of objects in the scene: at least a sphere, plane and cylinder, and it must support transparent objects. Thumbs up for supporting polygonal models, depth of field and loading scene description from a file.
10. **[gopher](gopher.md) fulltext search engine**: Create a whole search engine (with crawler, index creator, user frontend, ...) for the gopher network. It can store its database just to flat files (no need to use SQL or something like that). It has to allow at least very basic fulltext search, i.e. about each gopher site you'll have to remember which words it contains (and possibly their count), so that if the user searched e.g. for `cats dogs`, you'll give him sites that contain both of these words somewhere in their text. Besides this you can make simplifications (ignore case, don't support Unicode, special characters etc.). Thumbs up for additional features like creating a graphical map of the crawled gopherspace along the way.
### Level 4: God Tier, *!Nightmare!*
@ -68,10 +75,38 @@ Here you will find suggestions for programming projects, roughly sorted by their
2. **[operating system](operating_system.md)**: Make a whole [self hosted](self_hosting.md) operating system with your own custom kernel, with basic [GUI](gui.md) and tools such as a text editor, file browser and programming language compiler. Throw in some games because without them your OS will be boring. Run the OS on real hardware. It doesn't have to support networking, sound, USB and similar bloat, but thumbs up if you manage even that.
3. **[MMORPG](mmorpg.md)**: Make both client and server for an MMORPG game. The game has to support 3D graphics (but can also have 2D frontends) and have some basic lore that makes sense. Remember, it is MASSIVELY multiplayer game, so you have to be able to handle at least 1000 players connected at the same time on some kind of affordable computer. There must be chat, PvP and PvE combat. Thumbs up for releasing it all under [CC0](cc0.md).
4. **[Python](python.md)**: Implement the Python programming language, INCLUDING its whole standard library. Bonus points for finishing before the version you are implementing stops being supported.
5. **ruin [bitcoin](bitcoin.md)**: Make a program that can mine one bitcoin by running for at most one minute on any consumer laptop released before year 2010. Warning: this is probably unsolvable, but if you solve it you may help save the planet :P
TODO: text editor, demo, tetris, voice synth?, snake, JPG like compression, quadratic equation, compression, 2D raycasting, fourier transform, primes, image library, web browser, arbitrary size int, diff, MD parser, sudoku solver/generator, bytebeat, markov chain, grep, some kinda server, chatbot, function plotter, raytracer, pi digits, 2D physics engine, encryption?, procedural MIDI, machine translation?, language recognizer, search engine, AI?, ...
## Quiz
TODO: some questions + answers here
5. **ruin [bitcoin](bitcoin.md)**: Make a program that can mine one bitcoin by running for at most one minute on some consumer laptop released before year 2010. Warning: this is probably unsolvable, but if you solve it you may help save the planet :P
TODO: text editor, tetris, voice synth?, snake, JPG like compression, quadratic equation, fractals, 2D raycasting, fourier transform, primes, image library, web browser, diff, MD parser, sudoku solver/generator, bytebeat, markov chain, syntax beautifier, grep, some kinda server, function plotter, raytracer, pi digits, 2D physics engine, encryption?, procedural MIDI, machine translation?, maze gen., genetic prog., language recognizer, search engine, AI?, chat ...
## Quiz/Questions/Problems
Here are some questions to test your LRS related knowledge :D
1. What's the difference between *[free software](free_software.md)* and *[open source](open_source.md)*?
2. Name at least 10 different [programming languages](programming_language.md).
3. Why is text written on a piece of paper flipped horizontally when viewed in a mirror -- why is it not flipped vertically?
4. Say we want to generate a random number from 0 to 999 (including both) with uniform probability distribution (i.e. every number is equally likely). In C we often do it using the modulo operator like this: `int num = rand() % 1000`. However there is a problem with this -- describe what the problem is and how its negative effect can be reduced. Hint: it's called *modulo bias*.
5. What's the difference between [data](data.md) and [information](information.md)?
6. Bob has written a program and died. The program is now [unmaintained](maintenance.md). Bob's program uses 10 libraries. The probability that the API of one such library will be [updated](update_culture.md) and changed in any given year is 5%. If this happens, Bob's program will stop working. During the next 5 years what is the probability of his program breaking?
7. What will the following C (C99) snippet print out? `int x = 2; putchar('a' + ((1 == 3 > 2) + ++x));`
8. Order the following software by the date of the release of their 1.0 version from oldest to newest: [TempleOS](temple_os.md), [MS DOS](dos.md), original [Unix](unix.md), [Linux](linux.md), [Windows](windows.md). Also point out which one stands out from others and why.
9. If you're running in a race and overtake the guy who's currently in third place, what place will you be in?
10. We have two gears, each of same size and same number of teeth. Gear A is fixed in place, it can't move or rotate, gear B runs around gear A so that it keeps touching it (and therefore rotates along the way) until it gets to the place where it started. How many revolutions around its own axis (from your stationary point of view) has gear B made?
11. What's the worst socioeconomic system in the world? You don't even have to say why because that would take too long.
12. Manually convert the [binary](binary.md) numeral 10110000000010110101 to hexadecimal.
### Answers
1. Though legally similar (but not identical), free software is a movement based on ethics and pursuing freedom for the software user, open source is evil business movement that avoids talking about ethics, it was forked from free software and is solely focused on exploiting free software licenses for making profit.
2. [C](c.md), [C++](cpp.md), [Java](java.md), [JavaScrip](javascript.md), [Python](python.md), [Lisp](lisp.md), [Forth](forth.md), [Brainfuck](brainfuck.md), [Fortran](fortran.md), [Pascal](pascal.md), [Haskell](haskell.md), [Prolog](prolog.md), [Smalltalk](smalltalk.md), [comun](comun.md), ...
3. The mirror doesn't flip the text, you flipped it by pointing it at the mirror -- you most likely flipped it horizontally so that's how you see it in the mirror, but you could as well have flipped it vertically; then the text would be flipped vertically in the mirror.
4. Modulo bias happens when the random number generator's range is non-divisible by our desired range that we enforce with modulo operator -- with shown approach some numbers then have higher probability of being generated than others. For example if rand() here return numbers from 0 to 1023, there is only one way to get 999 (999 % 1000) but two ways to get 0 (0 % 1000 and 1000 % 1000), i.e. 0 is more likely to be generated. Common approach to reducing this effect is to repeatedly generate numbers until we get one falling into the "fair" range (this is not guaranteed to end so we should limit the maximum number of attempts).
5. The relationship is commonly described like this: information is interpreted data. I.e. data is just a sequence of symbols, information is the knowledge we extract from it.
6. The probability of program breaking is 1 minus probability of it not breaking. For a program to NOT break during one year, all libraries have to stay unchanged (probability 0.95 for each one): that's 0.95 * 0.95 * 0.95 * ... = 0.95^10. Similarly the probability of it not breaking during 5 years is (0.95^10)^5, so the probability of the program breaking in 5 years is around 92%.
7. `e`
8. Original Unix (around 1970), MS DOS (1981), Windows (1985), Linux (1998), TempleOS (2007). Linux stands out because it's not an operating system, it's a kernel.
9. third
10. two (try it, see coin rotation paradox)
11. [capitalism](capitalism.md)
12. B00B5

@ -2,6 +2,6 @@
*Not to be [confused](often_confused.md) with [libertarianism](libertarianism.md).*
Liberalism is a political ideology whose definition is not greatly clear (we may find branches that differ a lot) but which usually aims for "liberty", focus on individuals who ought to be protected by the state and have equal opportunities, which leads to obsession with all kinds of "[rights](rights_culture.md)" and "social justice" (i.e. social revenge of minorities); as one of worst imaginable ideologies it is no surprise it's the prevailing [US](usa.md) ideology and ideology of [SJW](sjw.md)s -- liberalism is taking over the whole western world and it's destroying everything. It basically tries to take the worst of all other ideologies: liberalism supports things such as [state](state.md) and strong laws (to "protect" people), [capitalism](capitalism.md) (to give them "opportunities"), [censorship](censorship.md), [political correctness](political_correctness.md) and violence; supporting concepts connected to both [right and (pseudo)left](left_right.md), it is said to be a "centrist" stance, however [we](lrs.md) just call it confused -- they just try to combine absolutely incompatible things, they want a competitive environment in which "everyone wins". Liberalism is highly [harmful](harmful.md), retarded and should never be supported.
Liberalism is a political ideology whose definition is not greatly clear (we may find branches that differ a lot) but which usually aims for "liberty", focus on individuals who ought to be protected by the state and have equal opportunities, which leads to obsession with all kinds of "[rights](rights_culture.md)" and "[social justice](social_revenge.md)" (i.e. social revenge of minorities); as one of worst imaginable ideologies it is no surprise it's the prevailing [US](usa.md) ideology and ideology of [SJW](sjw.md)s -- liberalism is taking over the whole western world and it's destroying everything. It basically tries to take the worst of all other ideologies: liberalism supports things such as [state](state.md) and strong laws (to "protect" people), [capitalism](capitalism.md) (to give them "opportunities"), [censorship](censorship.md), [political correctness](political_correctness.md) and violence; supporting concepts connected to both [right and (pseudo)left](left_right.md), it is said to be a "centrist" stance, however [we](lrs.md) just call it confused -- they just try to combine absolutely incompatible things, they want a competitive environment in which "everyone wins". Liberalism is highly [harmful](harmful.md), retarded and should never be supported.
Libertarianism is associated with the [color](color.md) yellow (same as with libertarianism), which symbolized piss.

File diff suppressed because one or more lines are too long

@ -46,7 +46,7 @@ Let's write an extremely primitive Markov bot that will work on the level of ind
Keep in mind this example is really extremely simple, it only looks one letter back and makes some further simplifications, for example it only approximates the probabilities with kind of a [KISS](kiss.md) hack -- we won't record any numeric probability, we'll only hold a table of letters, each one having a "bucket" of letters that may possibly follow; during training we'll always throw a preceding letter's follower to a random place in the preceding letter's bucket, with the idea that once we finish training, statistically in any bucket there will remain more letters that are more likely to follow given letter, just because we simply threw more such letters in. Similarly when generating the output text we will choose a letter to follow the current one by looking into the table and pulling out a random follower from that letter's bucket, again hoping that letters that have greater presence in the bucket will be more likely to be randomly selected. This approach has issues, for example regarding the question of ideal bucket size, and it introduces statistical biases (maximum probability is limited by bucket size, order matters, later letters are kind of privileged), but it kind of works. Try to think of how we could make a better text generator -- for starters it might work on the level of words and could take into account a history of let's say three letters, i.e. it would record triplets of words and then list of words that likely follow, along with each one's probability that we would record as an actual number to make the probabilities accurate.
Anyway with all this said, below is a [C](c.md) code implementing the above described text generator. To use it just pipe some input ASCII text to it, however make it reasonably sized (a few thousand lines maybe, please don't feed it whole Britannica, the output won't be better), keep in mind the program always trains itself from scratch (in practice we might separate training from generation, as serious training might take very long, i.e. we would have a separate training program that would output a trained model, i.e. the learner probabilities, and then a generator that would only take the trained model and generate output text). Here is the code:
Anyway with all this said, below is a [C](c.md) code implementing the above described text generator. To use it just pipe some input ASCII text to it, however make it reasonably sized (a few thousand lines maybe, please don't feed it whole Britannica, the output won't be better), keep in mind the program always trains itself from scratch (in practice we might separate training from generation, as serious training might take very long, i.e. we would have a separate training program that would output a trained model, i.e. the learned probabilities, and then a generator that would only take the trained model and generate output text). Here is the code:
```
#include <stdio.h>
@ -98,4 +98,56 @@ int main(void)
}
```
Trying it out on the text of [this wiki](LRS_wiki.md) may output something like this:
```
Ther thellialy oris threstpl/pifragmediaragmagoiby s agmexes, den
atss pititpenaraly d thiplio s ts gs, tis wily NU gmarags gos
aticel/EEECTherixed atstixedells, s s ores agolltixes tixe. TO: N
s, s, TOpedatssth NUCAPorag: puffrits, pillly ars agmen No tpix abe
aghe. aragmed ssh titixen plioix ag: Th tingoras TOD s wicipixe d
tpllifr.edarenexeramed Thecospix ts ts s osth s pes ovipingor
g: agors agass s TOnamand s aghech th wopipistalioiaris agontibuf
ally Thrixtply tiaceca th oul/EEEEEEEECPU), wicth NU athed wen
aragag athichipl Thechixthass s gmelliptilicex th ostunth gmagh
atictpixe. ar Th on wipixexepifrag gman g: sthabopl/te.
```
We see at first glance it looks a bit like English text, even with some quirks specific to this wiki, for example here and there having FULL CAPS words (due to acronyms and also rants that often appear here). It even generated the word "CPU". Notice the algorithm correctly learned punctuation, i.e. it knows that after commas and periods there is almost always space and after space there is usually not another space. For comparison here is a Spanish-like text generated from Don Quixote (with accents removed):
```
Diloma Dadro hacaci gua usta lesano strore sto do diaco; ma ro
hiciso stue ue dita. do que menotamalmeci ma quen do gue lo;
denestajo qucos rdo horor Da que qunca. quadombuce que queromiderbre
hera ha rlabue F de querdos Dio macino; dombidrompo mi ste derdiba
l, mbiolo Ferbes l ste s lolo que ha Du hano quenore Dio ueno que
hala F uano he Dorame de qus rl, ha didesa que halanora Fla quco
dil qucio ue do mestostaloste hados de gusta querana. stuce F s s
Do lo dre s hal Fro gue sa sa. la sido la dico; hado mbuno Do.
mororo; rdenaja. qunolole Diba. do. Fa gor stamestamo ha quno
unostabro quero mue s Diado Didota. quencoralor dio sotomo Fuen
que halora. gunore quabrbe rol gostuno hadolmbe Da que unendor
que le di so; qunta rajos s F de qucol
```
We see some shorter words like *lo*, *le*, *de*, *he*, *que* and *sido* are real Spanish words. Though punctuation is quite nice, the algorithm fails to learn that after period the word of the next sentence should start with a capital letter (it only does so sometimes by pure chance) -- this is due to the algorithm only seeing one character back; after a period there is also one space which already makes the algorithm forget about the period. This would be addressed by keeping longer history, as said above. Now let's try a difference kind of text altogether, let's try to feed in the source code of [Anarch](anarch.md):
```
2 camechererea = 20;
#erereppon.xereponioightFuaighe16_ARABEIUnst
chtreraySqua->rarepL_RCL_CL_PE;
caminsin.yDINeramaxer = costRCL_PERCL_ditsins->pL_ime1
= 0;
* = RCL_dime1,y 1)
0;
}
}
ck;
camererayDimameaxSqua ca = ca->ra caininin.xS_UAME;
caminstFua-> 0 0;
} ca->ponstramiomereaxSquts chts 154;
1)
```
Here it's pretty clear the code won't work but its structure really does resemble the original source: curly brackets and semicolons are correctly followed by newlines, assignments look pretty correct as well, dereference arrows (`->`) appear too -- the code even generated the `RCL_` prefix of the [raycastlib](raycastlib.md) functions that's widely seen in the original code.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -3,9 +3,9 @@
This is an autogenerated article holding stats about this wiki.
- number of articles: 569
- number of commits: 756
- total size of all texts in bytes: 3524906
- total number of lines of article texts: 27775
- number of commits: 757
- total size of all texts in bytes: 3536118
- total number of lines of article texts: 27795
- number of script lines: 262
- occurences of the word "person": 8
- occurences of the word "nigger": 71
@ -35,50 +35,50 @@ longest articles:
top 50 5+ letter words:
- which (2028)
- there (1517)
- which (2034)
- there (1518)
- people (1339)
- other (1105)
- example (1058)
- software (1035)
- number (954)
- about (918)
- program (786)
- example (1060)
- software (1036)
- number (969)
- about (919)
- program (804)
- their (761)
- called (714)
- because (688)
- computer (687)
- would (686)
- simple (661)
- being (657)
- things (643)
- numbers (640)
- language (630)
- without (614)
- function (609)
- programming (608)
- computer (690)
- because (689)
- would (687)
- simple (664)
- being (659)
- numbers (645)
- things (644)
- language (637)
- without (619)
- programming (612)
- function (611)
- however (588)
- something (577)
- these (572)
- different (562)
- world (531)
- system (529)
- games (523)
- should (518)
- point (511)
- something (579)
- these (575)
- different (564)
- world (533)
- system (530)
- games (524)
- should (522)
- point (515)
- society (504)
- doesn (494)
- doesn (497)
- though (491)
- memory (485)
- memory (488)
- drummyfish (467)
- while (466)
- drummyfish (466)
- using (456)
- using (460)
- technology (454)
- course (447)
- still (445)
- course (445)
- similar (445)
- simply (443)
- similar (443)
- possible (434)
- possible (435)
- really (407)
- computers (398)
- https (396)
@ -89,6 +89,24 @@ top 50 5+ letter words:
latest changes:
```
Date: Tue Apr 2 22:47:48 2024 +0200
42.md
bullshit.md
c_pitfalls.md
c_tutorial.md
demoscene.md
emoticon.md
exercises.md
future_proof.md
how_to.md
javascript.md
main.md
python.md
random_page.md
wiki_pages.md
wiki_stats.md
yes_they_can.md
youtube.md
Date: Sun Mar 31 20:21:22 2024 +0200
3d_model.md
acronym.md
@ -106,24 +124,6 @@ Date: Sun Mar 31 20:21:22 2024 +0200
wiki_stats.md
wikipedia.md
wow.md
Date: Sat Mar 30 22:07:31 2024 +0100
compression.md
determinism.md
distance.md
drummyfish.md
feminism.md
future_proof.md
kiss.md
lmao.md
mainstream.md
progress.md
quaternion.md
random_page.md
wiki_pages.md
wiki_post_mortem.md
wiki_stats.md
youtube.md
Date: Sat Mar 30 00:11:50 2024 +0100
```
most wanted pages:
@ -135,6 +135,7 @@ most wanted pages:
- [quake](quake.md) (10)
- [meme](meme.md) (10)
- [lisp](lisp.md) (10)
- [cli](cli.md) (10)
- [irl](irl.md) (9)
- [gpl](gpl.md) (9)
- [drm](drm.md) (9)
@ -147,7 +148,6 @@ most wanted pages:
- [waiver](waiver.md) (7)
- [syntax](syntax.md) (7)
- [rpi](rpi.md) (7)
- [mcu](mcu.md) (7)
most popular and lonely pages:
@ -173,14 +173,14 @@ most popular and lonely pages:
- [foss](foss.md) (73)
- [censorship](censorship.md) (72)
- [hacking](hacking.md) (70)
- [programming_language](programming_language.md) (69)
- [art](art.md) (69)
- [programming_language](programming_language.md) (68)
- [fight_culture](fight_culture.md) (68)
- [shit](shit.md) (67)
- [less_retarded_society](less_retarded_society.md) (67)
- [bullshit](bullshit.md) (66)
- [float](float.md) (63)
- [chess](chess.md) (62)
- [float](float.md) (65)
- [chess](chess.md) (63)
- ...
- [trusting_trust](trusting_trust.md) (4)
- [trump](trump.md) (4)

Loading…
Cancel
Save