From 421a8ccbe71d8518fb4f132b224d57ec47d10cb1 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 17 Apr 2023 06:18:35 -0700 Subject: [PATCH] Fix html vs md files issue in 2020/ferguson1 The solution is that when referring to html files have in parentheses text like 'foo.md' on GitHub though with a link. ...at least I believe this should solve the problem. Time might show otherwise but we'll see. --- 2020/ferguson1/README.md | 107 ++++++++++++++++-------------- 2020/ferguson1/bugs.md | 5 +- 2020/ferguson1/gameplay.md | 30 +++++---- 2020/ferguson1/spoilers.md | 31 +++++---- 2020/ferguson1/terminals.md | 9 ++- 2020/ferguson1/troubleshooting.md | 24 ++++--- 6 files changed, 117 insertions(+), 89 deletions(-) diff --git a/2020/ferguson1/README.md b/2020/ferguson1/README.md index a54ca1a95..58b4758a7 100644 --- a/2020/ferguson1/README.md +++ b/2020/ferguson1/README.md @@ -54,8 +54,8 @@ and non-zero). * **`GROW`** size to grow every time you eat a bug. Default 5; negative values are allowed. 'Negativity' creates for fun gameplay modes with - enough creativity. See [gameplay.md](gameplay.md) / - [gameplay.html](gameplay.html) as well as [play.sh](play.sh) for some examples. + enough creativity. See [gameplay.html][] ([gameplay.md][] on + GitHub) as well as [play.sh](play.sh) for some examples. * **`SHED`** every **`SHED`** movements you will grow (> 0), shrink (< 0) or @@ -112,27 +112,27 @@ This game has a number of configurable pitfalls including walls and snakes. There is a good deal of useful documentation that is provided with this entry: -* [gameplay.html][] +* [gameplay.html][] ([gameplay.md][] on GitHub) Documented game *features*! -* [terminals.html][] +* [terminals.html][] ([terminals.md][] on GitHub) Information about terminal capabilities, dimensions (setting and how to restore sanity if it causes any problems) as well as colours (limitations etc.). -* [troubleshooting.html][] +* [troubleshooting.html][] ([troubleshooting.md][] on GitHub) Workarounds for various game *features* -* [bugs.html][] +* [bugs.html][] ([bugs.md][] on GitHub) Bugs and things that might seem like bugs but are not. -* [chocolate-cake.html][] +* [chocolate-cake.html][] ([chocolate-cake.md][] on GitHub) Because most of us could use some *Double-layered Chocolate Fudge Cake*! -* [spoilers.html][] +* [spoilers.html][] ([spoilers.md][] on GitHub) Read ***ONLY*** if you really must give up trying to de-obfuscate! @@ -144,11 +144,11 @@ Snake has two cheat modes (passable walls and self [cannibalism]), a drawing (or practising) mode, *can play by itself (**and win!**)*, is coloured (included [snake-colours.sh][] and [play.sh][] scripts compile in player-selected colours) and there are many other play modes (many more can be devised with the -imagination and the environmental variables; see [gameplay.html][] for many -examples and [play.sh][] for preconfigured modes) and options. You can pause -and there's even a built-in test unit for some features! The variables -mentioned in the to run section at the top of this file modify the behaviour of -Snake. +imagination and the environmental variables; see [gameplay.html][] +([gameplay.md][] on GitHub) for many examples and [play.sh][] for preconfigured +modes) and options. You can pause and there's even a built-in test unit for +some features! The variables mentioned in the to run section at the top of this +file modify the behaviour of Snake. Here are some other features of the game: @@ -159,16 +159,16 @@ Here are some other features of the game: section (this goes for a low **`EVADE`** value too). * Grow-Shrink mode (Positive and Negative Winning) mode (see - [gameplay.html][] for more details). + [gameplay.html][]/[gameplay.md][] for more details). * The dimensions of the game (this is actually a terminal thing but I document how to do this and its potential pitfalls) (**`LINES`** , **`COLUMNS`**). There are no complicated command line invocations; it's just a matter of passing into the game descriptively named variables and I include a script that sets up -many different gameplay modes (see [gameplay.html][] and [play.sh][]). +many different gameplay modes (see [gameplay.html][]/[gameplay.md][] and [play.sh][]). -The [gameplay.html][] file has all the information on +The [gameplay.html][]/[gameplay.md][] file has all the information on what the game looks like, how to play, the different types of modes (that I have thought of so far) including all those in the above list. Along with the [play.sh][] and [snake-colours.sh][] scripts it's probably the most important @@ -182,22 +182,22 @@ suggestions (that I don't document so as to not spoil them). You can pass in environmental variables to both scripts though obviously some will conflict with different options in play.sh. -Probably just as important is [chocolate-cake.html][] with an old but wonderful -recipe (because the judges love chocolate and who can blame them? - also it goes -with one of the IAQs I include later). +Probably just as important is [chocolate-cake.html][] ([chocolate-cake.md][] on +GitHub) with an old but wonderful recipe (because the judges love chocolate and +who can blame them? - also it goes with one of the IAQs I include later). -The [troubleshooting.html][] file has some advice on potential problems (and -things that might appear to be problems at first glance but are not) that I have -thought of or encountered. +The [troubleshooting.html][] ([troubleshooting.md][] on GitHub) file has some +advice on potential problems (and things that might appear to be problems at +first glance but are not) that I have thought of or encountered. -The [terminals.html][] has a variety of information specific to terminals from -input/directions, dimensions, sanity and colours: a sort of troubleshooting -guide for terminals with some additional information. +The [terminals.html][] ([terminals.md][] on GitHub) has a variety of information +specific to terminals from input/directions, dimensions, sanity and colours: a +sort of troubleshooting guide for terminals with some additional information. -The [spoilers.html][] has a variety of information including some of the -obfuscation techniques and a bit of how it works. +The [spoilers.html][] ([spoilers.md][] on GitHub) has a variety of information +including some of the obfuscation techniques and a bit of how it works. -The [bugs.html][] has a list of known bugs and things that +The [bugs.html][] ([bugs.md][] on GitHub) has a list of known bugs and things that look like bugs but aren't as well as documenting a built-in test unit for some features. @@ -208,19 +208,22 @@ though much of it is what's also above). To render try: man ./snake.1 ``` -The [COMPILING.md][] file has a few portability notes and the [HACKING.md][] file has -some information on how one might modify things, things that could be -implemented (and how to/how not to go about some of the things) as well as some -other information on the entry (some of which is deliberately not true - a -variation of misleading comments). These files are probably insignificant. +The [COMPILING.html][] ([COMPILING.md][] on GitHub) file has a few portability +notes and the [HACKING.html][] ([HACKING.md][] on GitHub) file has some +information on how one might modify things, things that could be implemented +(and how to/how not to go about some of the things) as well as some other +information on the entry (some of which is deliberately not true - a variation +of misleading comments). These files are probably insignificant. I have more information about this entry at -[https://ioccc.xexyl.net/2020/snake][]. +. + +As noted for the files I recommend looking at the html files with a browser +unless on GitHub in which case I recommend the markdown files; this particularly +goes for the gameplay, bugs, terminals, troubleshooting ones along with the most +important one, chocolate cake. Most important for the cake as the formatting is +very important. -For the files I recommend looking at the html files with a browser; this -particularly goes for the [gameplay.html][], [bugs.html][], [terminals.html][] -and [troubleshooting.html][] - along with the most important one -[chocolate-cake.html][]. @@ -268,7 +271,7 @@ and [troubleshooting.html][] - along with the most important one took fewer bytes and the negative shedding is a positive consequence of unsigned arithmetic. -On a more serious note look at [bugs.html][]. +On a more serious note look at [bugs.html][] ([bugs.md][] on GitHub). ### NAQs/IAQs (Never/Infrequently Asked Questions) @@ -462,17 +465,18 @@ walls passable and not worry about dying. Why yes I do! So good in fact that even my late stepmum who didn't even like chocolate (except white chocolate) loved this cake. It's a double-layered -chocolate fudge cake. See the file [chocolate-cake.html][] for the recipe. -Note that it's a complicated but it's well worth it! +chocolate fudge cake. See the file [chocolate-cake.html][] +([chocolate-cake.md][] on GitHub) for the recipe. Note that it's a complicated +but it's well worth it! -I included it in all my entries this year because if any of them won more people +I included it in both of my entries this year because if any of them won more people can have this recipe; also it might help remind the judges that they really should have their cook bake it so they can all - including the cook should they also like chocolate - enjoy the cake whilst judging (and otherwise - it's a big cake and very rich). Sadly they didn't get to enjoy it during their judging due to the pandemic but maybe next time (or they can do on their own). -Do make sure to pay attention to all notes! +**Do make _SURE_ that you pay attention to _ALL_ notes!** ##### Reiterating the notes about the cake and the icing @@ -483,7 +487,8 @@ use the refrigerator or else air conditioner to cool down the place. This might or might not work well enough. - Do **NOT** use imitation vanilla! - Do **NOT** use butter even if you think it'll come out better; it will come -out bad! +out bad! Many people have made this mistake 'because they know better'. You've +been warned. - Pay attention to the rest of the notes as well! They're crucial. @@ -569,27 +574,31 @@ If you wish to contact me please do so. Please contact via mastodon. You can try email but I'm more likely to respond to mastodon messages. [COMPILING.md]: COMPILING.md +[COMPILING.html]: COMPILING.html [HACKING.md]: HACKING.md +[HACKING.html]: HACKING.html [bugs.html]: bugs.html +[bugs.md]: bugs.md [troubleshooting.html]: troubleshooting.html [human snakes]: http://www.macroevolution.net/snake-human-hybrids.html +[chocolate-cake.md]: chocolate-cake.md [chocolate-cake.html]: chocolate-cake.html -[spoilers.markdown]: spoilers.markdown +[spoilers.md]: spoilers.md +[spoilers.html]: spoilers.md [Surround]: https://en.wikipedia.org/wiki/Surround_(video_game) [Snake walk: The physics of slithering]: https://www.bbc.co.uk/news/science-environment-35563941 [snake-colours.sh]: snake-colours.sh [gameplay.html]: gameplay.html +[gameplay.md]: gameplay.md [flying snakes]: https://www.bbc.co.uk/news/science-environment-25943693 [play.sh]: play.sh [great chocolate cake]: cake.jpg [https://ioccc.xexyl.net/2020/snake]: https://ioccc.xexyl.net/2020/snake [Double-layered Chocolate Fudge Cake]: chocolate-cake.html -[gameplay.html]: gameplay.html [terminals.html]: terminals.html +[terminals.md]: terminals.md [troubleshooting.html]: troubleshooting.html -[bugs.html]: bugs.html -[chocolate-cake.html]: chocolate-cake.html -[spoilers.html]: spoilers.html +[troubleshooting.md]: troubleshooting.md ## Copyright and CC BY-SA 4.0 License: diff --git a/2020/ferguson1/bugs.md b/2020/ferguson1/bugs.md index d8049f3be..458c407a1 100644 --- a/2020/ferguson1/bugs.md +++ b/2020/ferguson1/bugs.md @@ -142,7 +142,7 @@ And you'll see that you start to be the normal size but then you leave your head several places until you end up getting to the max size (by way of it being unsigned). This isn't a bug even if it might seem like one. In fact this is the basis of the grow/shrink mode of play that I talk about in the -[gameplay.md][] ([gameplay.html][]) file. +[gameplay.html][] ([gameplay.md][] on GitHub) file. Here's another thing to be aware of. Let's say you do: @@ -266,7 +266,7 @@ With 10 rows and columns it's calculated as `7 * 7` (i.e. it's (`playable_rows * playable_columns`). I have played with this many times and I do not believe there should be a problem. If there is it's from a very poor implementation of rand() and I discuss this in -[troubleshooting.md][] ([troubleshooting.html][]). +[troubleshooting.html][] ([troubleshooting.md][] on GitHub). There I also give some test outputs without the cap in place to give an idea of when it became a problem (or would have). In short this is known but I do not @@ -323,6 +323,7 @@ but it is very much appreciated and it means a great deal to me. Cheers.) [troubleshooting.md]: troubleshooting.md [troubleshooting.html]: troubleshooting.html [gameplay.html]: gameplay.html +[gameplay.md]: gameplay.md [cannibalism.log.md]: cannibalism.log.md [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms]: https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms [spoilers]: spoilers.markdown diff --git a/2020/ferguson1/gameplay.md b/2020/ferguson1/gameplay.md index bde91d532..1e25f9fcf 100644 --- a/2020/ferguson1/gameplay.md +++ b/2020/ferguson1/gameplay.md @@ -69,11 +69,12 @@ for the input keys. # 1. Testing terminal environment/capabilities Most people probably won't have any issue at all but for those who have any -problems with the terminal see the [terminals.md][] file for more -information on the terminal capabilities testing utility I include. +problems with the terminal see the [terminals.html][] ([terminals.md][] on +GitHub) file for more information on the terminal capabilities testing utility I +include. -For troubleshooting other problems see [troubleshooting.md][] -([troubleshooting.html][]) and [bugs.md][] ([bugs.html][]). +For troubleshooting other problems see [troubleshooting.html][] +([troubleshooting.md][] on GitHub) and [bugs.html][] ([bugs.md][] on GitHub). # 2. Input keys @@ -414,10 +415,11 @@ left go right etc.) and then after some length (but before you get beyond the snake) turn (so that you go perpendicular) and then watch as the snake starts unwinding at one place and then suddenly unwinds another direction. -An example of extreme cannibalism is in the [cannibalism.log.md][] file. It -explains information about the file including how to find the bug, head and tail -of the snake, at least where it was documented. The first run has several dumps. -The final example has the snake inside itself. +An example of extreme cannibalism is in the [cannibalism.log.html][] +([cannibalism.log.md][] on GitHub) file. It explains information about the file +including how to find the bug, head and tail of the snake, at least where it was +documented. The first run has several dumps. The final example has the snake +inside itself. # Gameplay: Shedding (stretching) @@ -476,8 +478,8 @@ X:24/49 Y:8/16 S:5/658 B:0 # 4. Gameplay modes -Here I list a number of different modes of play. In the [bugs.md][] -([bugs.html][]) file I even show how there's a built-in test unit for some +Here I list a number of different modes of play. In the [bugs.html][] +([bugs.md][] on GitHub) file I even show how there's a built-in test unit for some modes! There are certainly other modes that could be imagined: the modes below happened over time and some were simply an accidental discovery or something I thought of by a chance; others were thought out from the beginning but were @@ -696,7 +698,8 @@ The parameters above were chosen after playing with the mode a bit to find a value that wouldn't take that much time but still would pose a challenge. One could reverse it so that one shrinks more than growing. -The [crazy.log.md][] file has several screen dumps with this idea. +The [crazy.log.html][] ([crazy.log.md][] on GitHub) file has several screen +dumps with this idea. You could also have it so that eating a bug makes you shrink and moving so many moves you grow. I tried this and for me it was far more fun. The [play.sh][] @@ -874,12 +877,15 @@ years ago but I know it's true now. **Believe in yourself. Always.** [troubleshooting.html]: troubleshooting.html [bugs.md]: bugs.md [bugs.html]: bugs.html -[spoilers.markdown]: spoilers.markdown +[spoilers.md]: spoilers.md +[spoilers.html]: spoilers.html [snake-colours]: snake-colours [number of hertz (flashes) per second triggering seizures]: https://www.epilepsysociety.org.uk/photosensitive-epilepsy#.Xjgpwi2ZOgQ [termcaps.c]: termcaps.c [cannibalism.log.md]: cannibalism.log.md +[cannibalism.log.html]: cannibalism.log.html [crazy.log.md]: crazy.log.md +[crazy.log.md]: crazy.log.html [play.sh]: play.sh ----------------------------------------------------------------------------------------------------- diff --git a/2020/ferguson1/spoilers.md b/2020/ferguson1/spoilers.md index 97eda191a..d1ec2f0e6 100644 --- a/2020/ferguson1/spoilers.md +++ b/2020/ferguson1/spoilers.md @@ -1,6 +1,6 @@ # Introduction (SPOILER ALERT) -In the [gameplay.md][] ([gameplay.html][]) file I have given enough +In the [gameplay.html][] ([gameplay.md][] on GitHub) file I have given enough information to know how the game looks, how to move the snake, how to pause etc. In this file I am including (some) information on how the game actually works: the technical details as it were, obfuscation techniques and also some of the @@ -437,13 +437,14 @@ dimensions. Now in the first call in main() I have the code and tests following: offsets for every time I use negative offsets. But where's the fun in that? :) - BTW: Some of these are not in the table of expressions in the HACKING.md file. - Also there might be some code in there that is no longer correct (it was - before I started obfuscation) though it might be able to give an idea. - Spoilers abound in that file (in addition to this file) but the HACKING.md file - states things that are no longer true: a way of obfuscation itself! Instead - of misleading comments it's misleading statements in the file that explains - what some of the things are for! + BTW: Some of these are not in the table of expressions in the + [HACKING.html][] ([HACKING.md][] on GitHub) file. Also there might be some + code in there that is no longer correct (it was before I started + obfuscation) though it might be able to give an idea. Spoilers abound in + that file (in addition to this file) but the [HACKING.html][] ([HACKING.md][] + on GitHub) file states things that are no longer true: a way of obfuscation + itself! Instead of misleading comments it's misleading statements in the + file that explains what some of the things are for! - Misleading variable names for coordinates. In other words the Y coordinate is called X and the X coordinate is called Y. This adds to the already confusing @@ -948,17 +949,19 @@ all spaces anyway. Thus I could save another three bytes by changing it to: !o && q *U,*V,' '); ``` -Technically it would be a `" "` (see [HACKING.md][] file) else for N (not referring to -the variable though it might very well matter here too) movements (i.e. due to -sizes) you will at times (e.g. after eating a bug) see the snake body char at -0,0. I'm not bothered about that though because the score line is meant to -display something, it squeezes a few more bytes and having a space is hardly an -imposition on usage (and for that matter having a 'o' at 0,0 isn't either). +Technically it would be a `" "` (see [HACKING.html][] or on GitHub +[HACKING.md][]) else for N (not referring to the variable though it might very +well matter here too) movements (i.e. due to sizes) you will at times (e.g. +after eating a bug) see the snake body char at 0,0. I'm not bothered about that +though because the score line is meant to display something, it squeezes a few +more bytes and having a space is hardly an imposition on usage (and for that +matter having a 'o' at 0,0 isn't either). [gameplay.md]: gameplay.md [gameplay.html]: gameplay.html [HACKING.md]: HACKING.md +[HACKING.html]: HACKING.html ----------------------------------------------------------------------------------------------------- (c) Copyright 1984-2020, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved diff --git a/2020/ferguson1/terminals.md b/2020/ferguson1/terminals.md index 562bb7d84..a30827664 100644 --- a/2020/ferguson1/terminals.md +++ b/2020/ferguson1/terminals.md @@ -232,8 +232,8 @@ properly. Because that's what funny means in this context. It'd be nice if curses could detect hitting more than one arrow key at the same time so that diagonal directions would be possible but unfortunately it's not (`cat -v` confirms this). Even if I were to define four extra keys what -would they be? And what about the head character? The [HACKING](HACKING.md) file has -information on this. +would they be? And what about the head character? The [HACKING.html][] +([HACKING](HACKING.md) on GitHub) file has information on this. I also limit the terminal size to 10 lines/columns but most likely it would require the cheat modes to win and in any event allowing certain low values @@ -255,7 +255,8 @@ from a quick test this holds even with a terminal that has a white background. There is a way to force the background to remain white though that's by way of monochrome (so no colours); I discuss that and another related terminal specific in the troubleshooting guide (there's another way but it would take me over the -iocccsize; I talk about it in the [HACKING](HACKING.md) file). +iocccsize; I talk about it in the [HACKING.html][] ([HACKING](HACKING.md) on +GitHub) file). ## Monochrome terminals @@ -363,6 +364,8 @@ Perhaps you only need to add the `return;` to `C()`. My guess is that's the case but I do not know for certain. +[HACKING.md]: HACKING.md +[HACKING.html]: HACKING.html [Linux keyboard and console HOWTO]: https://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO.html [Linux keyboard and console HOWTO section 4]: https://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-4.html [snake-colours.sh]: snake-colours.sh diff --git a/2020/ferguson1/troubleshooting.md b/2020/ferguson1/troubleshooting.md index 0b7f1de66..86f54c930 100644 --- a/2020/ferguson1/troubleshooting.md +++ b/2020/ferguson1/troubleshooting.md @@ -37,8 +37,8 @@ it as structured as possible/easiest to find. Because the score line is dynamic in length depending on the terminal size it can happen that the score/status wraps to the next line(s). This can be fixed by -modifying the status line (see [HACKING.md][]) but you shouldn't need it to be very -wide. +modifying the status line (see [HACKING.html][] or on GitHub [HACKING.md][]) but +you shouldn't need it to be very wide. * RESOLUTION #0: Use a bigger screen (it doesn't take that many columns) @@ -58,9 +58,10 @@ wide. #define J Z(B:%zu\n), c); - Recompile and try again. That will then show only the number of bugs eaten. See - the [HACKING.md][] file for other data you can include (though there are some - discrepancies here and there as you'll see). + Recompile and try again. That will then show only the number of bugs eaten. + See the [HACKING.html][] ([HACKING.md][] on GitHub) file for other data you + can include (though there are some discrepancies here and there as you'll + see). ## The snake isn't moving! @@ -90,7 +91,8 @@ e.g. when the snake is growing. numerous causes for this some of which are a busy computer but ultimately it'll catch up; just give it the time it needs. -* BOTTOM LINE: If you want more information then see the [bugs.md][] file. +* BOTTOM LINE: If you want more information then see the [bugs.html][] +([bugs.md][] on GitHub) file. ## I can't see the snake head (or other part of the snake)! @@ -296,10 +298,11 @@ so that's probably why; in CentOS I did have to install it specially. And then on your white background terminal the game should keep the background white and the foreground black. This will of course mean you have no colour but unfortunately changing the background colour of curses would - eat too many bytes in the entry (I cite the functions in the [HACKING.md][] file). + eat too many bytes in the entry (I cite the functions in the + [HACKING.html][] ([HACKING.md][] on GitHub) file). I discuss colours and terminals in much more detail in - [terminals.md][] ([terminals.html][]). + [terminals.html][] ([terminals.md][] on GitHub). ## The text is hard to see (not bright enough)! @@ -403,7 +406,8 @@ is invalid input because octal only has digits 0 - 7: the resulting size will be I discuss the signed/unsigned issue to do with curses and sizes in C being -unsigned in [bugs.md][] but probably there isn't anything more to say here. +unsigned in [bugs.html][] ([bugs.md][] on GitHub) but probably there isn't +anything more to say here. ## Errors and error reporting @@ -446,8 +450,10 @@ is 0 and I limit the size to be no bigger than the max size. [HACKING.md]: HACKING.md +[HACKING.html]: HACKING.html [prog.c]: prog.c [bugs.md]: bugs.md +[bugs.html]: bugs.html [terminals.md]: terminals.md [terminals.html]: terminals.html [snake-colours]: snake-colours