This commit is contained in:
Miloslav Ciz 2024-12-06 03:33:05 +01:00
parent 9da425a4c1
commit a82ad31a6f
20 changed files with 1979 additions and 1862 deletions

View file

@ -28,14 +28,14 @@ This place is for suggesting programming projects that will in first place serve
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.
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 was.
4. **password generator**: Make a program which when run outputs randomly generated password (of course it must generate different password each time, i.e. you can't output the exact same password every time). The password must be at least 10 characters long, contain at least one English alphabet letter, one decimal digit and one special character.
5. **rock, paper scissors**: Make a game of rock paper scissors, the player plays against the computer.
6. **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).
7. **kawaii filter**: Make a program that will filter input text to make it more kawai senpai. It has to read characters from input until end is reached (you can consider either EOF or end of line the end of input, that's up to you), outputting each character it reads as soon as it reads it, except for letters *r*/*R* that will be replaced with *w*/*W*. Also when period is read, the word *desu* must be output before it. For example the input *"This program is really good."* will produce output *"This pwogwam is weally good desu."*.
8. **info tool**: Make a tool that will output some basic info about real world, the computer, its operating system or the programming language -- you have to really retrieve this info e.g. using standard library, OS files, language's built-in functions etc. When run, it has to output at least three of the following things: current time, current date, operating system name and version, programming language version, native integer size in bits, amount of computer RAM, free disk space, CPU name and/or frequency and/or number of cores or locale info (language, timezone, ...). (hints: see *time.h*, *limits.h*, *locale.h*, *man system* etc.)
9. **[ASCII art](ascii_art.md) animation**: Program a simple ASCII art animation that will play in terminal -- just make a few frames of the animation in some text editor, then make a program that will show one frame after another. After each frame write out like 50 spaces to scroll the old frame away from the screen, then draw the next frame. The animation can be advanced just with a key press, i.e. you can just have a loop that draws the frames and at the end of the loop you just wait for user input (but thumbs up if you can figure out how to pause for some fixed time after each frame).
10. **[Nim](nim.md)**: Implement the simple variant of the game Nim for two human players -- At the beginning there will be 15 matches, players take turn, in each turn a player can take 1, 2 or 3 matches. That who takes the last one loses. The game has to show the number of matches as a numeral and also as some kind of symbols, for example: `|||||||||||||||`. Players have to input `1`, `2` or `3` to play their turn, on wrong input the game has to report error and ask again. At the end winner must be shown. Thumbs up for randomly setting the initial number of matches between 10 and 15.
9. **[ASCII art](ascii_art.md) animation**: Program a simple ASCII art animation that will play in terminal -- just make a few frames of the animation in some text editor, then make a program that will show one frame after another. After each frame write out like 50 spaces to scroll the old frame away from the screen, then draw the next frame. The animation can be advanced just with a key press, i.e. you can just have a loop that draws the frames and at the end of the loop you just wait for user input (but thumbs up if you can figure out how to pause for some fixed time after each frame). Thumbs up: if you can do it, you can also generate the animation [procedurally](procgen.md), i.e. you can for example make an animation of expanding circle without having to draw it all by hand, but this is more difficult.
10. **[Nim](nim.md)**: Implement the simple variant of the game Nim for two human players -- At the beginning there will be 15 matches, players take turns, in each turn a player can take 1, 2 or 3 matches. That who takes the last one loses. The game has to show the number of matches as a numeral and also graphically, for example: `|||||||||||||||`. Players have to input `1`, `2` or `3` to play their turn, on wrong input the game has to report error and ask again. At the end the winner must be reported. Thumbs up for randomly setting the initial number of matches between 10 and 15 or even making a simple AI (can even just make random choices).
### Level 1: Easy, *I'm Too Young To Die*
@ -93,9 +93,9 @@ This place is for suggesting programming projects that will in first place serve
1. **3D [physics engine](physics_engine.md) without [floating point](float.md)**: Warm up for the god tier by making a 3D physics engine without using floating point, usable in real time. It must support complex shapes, i.e. not just plain spheres ;) The engine can use rigid body or soft body physics, or both. It doesn't have to be physically accurate but should produce results that an average observer will judge realistic enough for a game.
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.
4. **[Python](python.md)**: Implement the Python programming language, INCLUDING its whole standard library. Thumbs up for finishing before the version you are implementing stops being supported.
5. **the grandest program of all time**: Make a program that (in a simplified way but still) simulates the whole [Universe](universe.md) and allows its user to explore and zoom in on anything not just in vast space but mainly on Earth, in big and small scales AND in all times in past and future, while the simulation approximately matches our available data (i.e. recorded historical events, famous people, geography, known bodies in the Universe etc.) and procedurally generates/interpolates/extrapolates unknown data (i.e. for example if we don't know what Napoleon did on a certain day, the program will make some guess and show him doing something). This will be the great visual encyclopedia in which one can observe the big bang, [Jesus](jesus.md), dinosaurs, black holes, the future destruction of Earth and so on.
6. **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
6. **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 the year 2010. Warning: this is probably unsolvable, but if you solve it you may help save the planet :P
TODO: tetris, voice synth?, snake, quadratic equation, fractals, 2D raycasting, fourier transform, primes, image library, web browser, diff, HTML parser/visualizer?, markov chain, syntax beautifier, grep, some kinda server, function plotter, pi digits, 2D physics engine, encryption?, custom markup lang, procedural MIDI, machine translation?, maze gen., genetic prog., language recognizer, AI?, photogrammetry, solar system simulator, emulator, chat (P2P?), auto integrator, steganography, driver? ...
@ -103,7 +103,7 @@ TODO: tetris, voice synth?, snake, quadratic equation, fractals, 2D raycasting,
Here are some questions to test your LRS related knowledge :D Questions here are of varying difficulty, areas and may potentially have even multiple solutions, just like in [real life](irl.md).
Bear in mind the main purpose of this quiz is for you to test your understanding of things AND possibly learn something new or spark some curiosity -- don't rage if you get something wrong or if maybe the question is worded badly (which can happen) or even if the answer here has an error or something (which can also happen), the important thing is you gain new knowledge, if only something like "oh, this is a thing" or "this is a nice kind of problem I haven't seen before" etc.
Bear in mind this is not a school test that's supposed to decide if you get to a university or not, the main purpose of this quiz is for you to test your understanding of things AND possibly learn something new or spark some curiosity -- don't rage if you get something wrong or if maybe the question is worded badly (which can happen) or even if the answer here has an error or something (which can also happen), the important thing is you gain new knowledge, if only something like "oh, this is a thing" or "this is a nice kind of problem I haven't seen before" etc.
1. What's the difference between *[free software](free_software.md)* and *[open source](open_source.md)*?
2. Use numbers 1, 3, 4 and 6, each exactly once, with any of the basic arithmetic operations (addition, subtraction, multiplication, division) and brackets to get the result 24.
@ -223,7 +223,8 @@ Bear in mind the main purpose of this quiz is for you to test your understanding
116. Consider we record moves in [chess](chess.md) with a simple notation as *<SQUARE_FROM><SQUARE_TO>*, for example *e3e5* or *g1f3* (i.e. we don't care about which chessman moves, if check or promotion happens etc., only start and end square are recorded). How many such moves exist if we only consider those that can ever legally happen (i.e. don't count moves such as *a2g1*, *b3b3* and so on)? Castling just means moving the king to his castled position.
117. We keep hearing about "first world" and "third world", but what about "second world"? Why is that term not used?
118. [Jara Cimrman](jara_cimrman.md) invented a brilliant self-powered mine elevator design that worked as follows. When miners came to start a new shift in the mine, two of them would enter a down-coming lift, which by the weight of the two workers started to move down and lifted another lift up; in the up-coming lift one miner, ending his shift in the mine, would come up (as he was lighter than the two miners in the down-coming lift). However they soon realized this system had one fatal flaw. What was it?
119. Did you enjoy this quiz?
119. Use only the logical function [NAND](nand.md) (which gives a negated result of [AND](and.md)) to implement the [XOR](xor.md) logical function.
120. Did you enjoy this quiz?
### Answers
@ -346,7 +347,8 @@ sin(x) / cos(x) - log2(2) = tg(x) - 1*, so we get *tg(x) >= 1*. So that will hol
116. Should be 1792 { Unless I counted it wrong lol. ~drummyfish }. We can count this by just considering each square on the board and summing all possible queen and knight moves from that square (queen and knight together cover all possible moves). Queen can obviously end up on any square and from knight's walk we know we can place a knight anywhere as well. This can probably be computed even manually but writing a quick program does the job quicker.
117. The term "second world" used to exist -- during the Cold War "first world" was used for the "western world", countries allied with US/NATO; the "second world" meant the "USSR world", and "third world" everyone else. After dissolution of Soviet Union the second world basically stopped existing, or rather merged with the first world, and since then the terms got more of an economical meaning rather than political.
118. Two miners were coming down but only one up, more workers were entering the mine than were leaving, so the workers started to pile up in the mine. Cimrman solved this by advising the workers to eat a lot before the shift and then work hard to lose some weight so that two heavy miners would be able to lift two lighter ones.
119. yes
119. a XOR b = (a OR b) AND NOT(a AND b) = ((a NAND a) NAND (b NAND b)) AND (a NAND b) = (((a NAND a) NAND (b NAND b)) NAND (a NAND b)) NAND (((a NAND a) NAND (b NAND b)) NAND (a NAND b)).
120. yes
## Other