This commit is contained in:
Miloslav Ciz 2025-02-26 18:17:24 +01:00
parent f80ca20c00
commit 1e739cc555
19 changed files with 1980 additions and 1936 deletions

View file

@ -65,10 +65,12 @@ A great many commonly used tricks in programming could be regarded as hacks even
- Computer [graphics](graphics.md) uses many clever tricks that could possibly be called hacks, e.g. in times when 3D graphics was primitive and didn't allow achieving such effects as mirror reflections easily, some [games](game.md) faked mirrors simply with a hole in the wall behind which the whole mirrored room was placed -- this achieved the same effect as a mirror and didn't require any extra rendering passes or shaders.
- **[quine](quine.md)**: A cleverly constructed self-replicating program in [programming language](programming_language.md) that prints its own source code -- this is a common exercise of language hackers.
- **MetaGolfScript [esoteric languages](esolang.md)**: rather than being a nicely designed [code golfing](code_golf.md) language MetaGolfScript invents infinitely many languages, each of which solves one problem with a zero-length program, making it possible to win any golfing contest that allows arbitrary choice of language just by choosing the correct MetaGolfScript language.
- In video [games](game.md) "hacking" is nowadays used as a synonym for "[cheating](cheating.md)", but a clever use of game mechanics to achieve something unintended by the game developers can be seen as a hack in the traditional sense. Example of this could be a so called tower rush in strategy games (building defensive towers in opponent's base to attack him).
- **Appending "in Minecraft" to avoid legal responsibility**: some people try to avoid legal responsibility for threats by talking about the situation as if it was harmlessly happening in a video game such as Minecraft, for example "Bitch I'm going to come to your house and murder you in sleep, in Minecraft." Though this is a nice hack and should work, the dystopian governments can do whatever they want and still arrest you for this -- this happened e.g. in New Jersey when one guy threatened to kill a sheriff like this.
- **[polyglot](polyglot.md) programs**: another fun activity by programming language enthusiasts; a polyglot is source code that's a valid in more than one programming language.
- [Richard Stallman](rms.md) called some musical compositions hacks, specifically 4'33 (just silence) and Ma Fin Est Mon Commencement ([palindromic](palindrome.md) music).
- TODO: moar
- The [unix](unix.md) [sed](sed.md) utility can be used to replace patterns in text using [regular expressions](regex.md), however the utility is limited by working line-by-line and hence not being able to easily replace patterns that span multiple lines. A clever hack suggested on stack overflow to work around this was to first replace all newlines by `\r` (character not normally used in typical text files), then used sed (to which the whole text now presents a single line), then replace `\r`s back to newlines.
- ...
## See Also