From b88193f3601dc173ed4b66f267baa60f8915b945 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 5 Dec 2023 12:34:27 -0800 Subject: [PATCH] Format/typo check 2014/maffiodo1, add scripts The mario.sh script runs Super Mario Brothers and the giana.sh script runs the Great Giana Sisters but each allows the user to specify the width and height of the game. Format/typo check README.md. The bugs.md was updated with features, not bugs to fix. --- 2014/maffiodo1/README.md | 82 +++++++++++++++++++++++++++------------- 2014/maffiodo1/giana.sh | 26 +++++++++++++ 2014/maffiodo1/mario.sh | 26 +++++++++++++ bugs.md | 33 ++++++++++++++++ thanks-for-fixes.md | 6 +++ 5 files changed, 147 insertions(+), 26 deletions(-) create mode 100755 2014/maffiodo1/giana.sh create mode 100755 2014/maffiodo1/mario.sh diff --git a/2014/maffiodo1/README.md b/2014/maffiodo1/README.md index 382fc9341..2cde4af7c 100644 --- a/2014/maffiodo1/README.md +++ b/2014/maffiodo1/README.md @@ -1,30 +1,59 @@ ## To build: -This entry requires SDL to be installed. See the [faq.md](/faq.md) if you don't -know how to do this for your system. +This entry requires SDL to be installed. See [FAQ 3.8](/faq.md#faq3_8) if you +don't know how to do this for your system. + ```sh make ``` +### Bugs and (Mis)features: + +The current status of this entry is: + +``` +STATUS: INABIAF - please **DO NOT** fix +``` + +For more detailed information see [2014 maffiodo1 in bugs.md](/bugs.md#2014-maffiodo1). + + + ## To use: ```sh -cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 +cat game.level | ./prog 320 200 800 300 128 144 game.rgba game.wav 10343679 ``` +The parameters to the program are: + +1. Window width. +2. Window height. +3. Level width. +4. Level height. +5. Sprites image width. +6. Sprites image height. +7. Filename of the sprites image (raw RGBA image). +8. Filename of the music (WAVE 8000 Hz 8bit Mono). +9. Sky color. This number depends on the system where you run the program. See +note on macOS. + + ### Try: ```sh -cat giana.level | ./prog 320 200 1000 300 192 168 giana.rgba giana8.wav 5459393 +./giana.sh -cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet telehack.com 23 +./mario.sh ``` -If you end up telnetting to the server you can try: +If you end up telnetting to the server (feature of [mario.sh](mario.sh)) you can +try: + ``` ls # show files including games @@ -33,18 +62,14 @@ advent.gam # you know what this is! :-) starwars # animated Star Wars 'film' ``` -NOTE: the author stated that the sky colour is incorrect in some versions of -macOS, offering a workaround. Others tested this out in the most recent macOS -version and this does not seem to be a problem any more. As he played (and beat) -the entire series many times years ago he can confirm that the sky is more or -less correct though it's possible that because he's practically blind he might -have missed something :-) He guesses that the problem might have been the -version of `SDL1` but he does not know this either way. +If you wish to change the width and height, defaulting at 640 x 480, say to +800 x 800, try: -Others notes ironically that the author stated that in Super Mario Bros one cannot -go through walls but there are known glitches where you can in some areas (as he -recalls this also applied to the arcade version, Mario Bros, but he cannot -confirm this now) :-) +```sh +ROWS=800 COLS=800 ./mario.sh + +ROWS=800 COLS=800 ./giana.sh +``` ## Judges' remarks: @@ -60,9 +85,9 @@ the code. In `vim` you can do: ``` in command mode to see this effect. You don't need to modify your `.vimrc` file! -You can also use `expand` as described below if your terminal has enough rows -and you don't want to move about in the code. The vim command should immediately -take effect. +You can also use `expand` as described below by the author if your terminal has +enough rows and you don't want to move about in the code. The vim command should +immediately take effect. ## Author's remarks: @@ -95,7 +120,7 @@ for free! In my two tests I tried to create one level of [Super Mario Bros](http://en.wikipedia.org/wiki/Super_Mario_Bros.) and one of [The Great -Giana The Sisters](http://en.wikipedia.org/wiki/The_Great_Giana_Sisters). +Giana Sisters](http://en.wikipedia.org/wiki/The_Great_Giana_Sisters). Both games are classic [platform games](https://en.wikipedia.org/wiki/Platform_game) and both share the same @@ -109,9 +134,10 @@ character more or different powers or abilities! - There are walls, floors and ceilings. The character can move and jump over these type of obstacles but cannot walk through them. -- There are enemies and; if the character collides with an enemy, the character +- There are enemies and if the character collides with an enemy, the character dies or loses its powers. + ### Running under macOS [NOTE: this seems to no longer be the case as of 2023 and most likely much @@ -124,11 +150,12 @@ last parameter of the program: * GIANA LAST PARAMETER: `3243070463` + ### Regarding how to compile The code requires `SDL1`. -The build process will generate some warnings (60~ on clang) about: +The build process will generate some warnings (~60 with clang) about: - `incompatible pointer types`: because all pointers are declared to `int` or `char`, to save bytes. @@ -136,6 +163,7 @@ The build process will generate some warnings (60~ on clang) about: - `using the result of an assignment as a condition without parentheses`: because `while(c=getchar())` is not evil. + ### How it works ## Parameters @@ -194,6 +222,7 @@ Position | Description All the others sprites can be used as you want, depending on the game you want to create. + ## Levels The program reads the level description from `stdin`. @@ -259,7 +288,7 @@ Each row has six columns: * `DESTROY` (`64`) When the player hits the object (e.g. the classic Mario coin) the - object disappears but the engine does not counts the points, so, + object disappears but the engine does not count the points, so, from the player point of view, this object is useless. * `DESTROYUP` (`128`) @@ -272,6 +301,7 @@ If `CLASSFLAGS` is `0` the object only has an aesthetic function. The last row of the level descriptor must have all its columns set equal to `-1`. + ### Limitations Some classical features are missing: throwing objects, shooting, multiple lives, @@ -306,12 +336,12 @@ only demonstrates the operation of the program. From my point of view this is a tribute to the legendary game [Super Mario Bros](http://en.wikipedia.org/wiki/Super_Mario_Bros.)! -[The Great Giana The +[The Great Giana Sisters](http://en.wikipedia.org/wiki/The_Great_Giana_Sisters) is the game created by [Time Warp Productions](https://www.ign.com/games/producer/time-warp-productions) and my justification for the sprites for Mario are the same for this game. Long live -[The Great Giana The +[The Great Giana Sisters](http://en.wikipedia.org/wiki/The_Great_Giana_Sisters) !! :) diff --git a/2014/maffiodo1/giana.sh b/2014/maffiodo1/giana.sh new file mode 100755 index 000000000..845b19696 --- /dev/null +++ b/2014/maffiodo1/giana.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# giana.sh - demonstrate IOCCC winner 2014/maffiodo1 The Great Giana Sisters +# + +# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it +# this way allows us to have the user specify a different compiler in an easy +# way. +if [[ -z "$CC" ]]; then + CC="cc" +fi + +make CC="$CC" all >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear + +# see if the user wants to override width and height +if [[ -z "$ROWS" ]]; then + ROWS="480" +fi +if [[ -z "$COLS" ]]; then + COLS="640" +fi + +cat giana.level | ./prog "$COLS" "$ROWS" 1000 300 192 168 giana.rgba giana8.wav 5459393 diff --git a/2014/maffiodo1/mario.sh b/2014/maffiodo1/mario.sh new file mode 100755 index 000000000..d73de499d --- /dev/null +++ b/2014/maffiodo1/mario.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# mario.sh - demonstrate IOCCC winner 2014/maffiodo1 Super Mario Bros. +# + +# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it +# this way allows us to have the user specify a different compiler in an easy +# way. +if [[ -z "$CC" ]]; then + CC="cc" +fi + +make CC="$CC" all >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear + +# see if the user wants to override width and height +if [[ -z "$ROWS" ]]; then + ROWS="480" +fi +if [[ -z "$COLS" ]]; then + COLS="640" +fi + +cat mario.level | ./prog "$COLS" "$ROWS" 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet telehack.com 23 diff --git a/bugs.md b/bugs.md index 49805ac20..bc46279bf 100644 --- a/bugs.md +++ b/bugs.md @@ -2955,6 +2955,39 @@ it out as a known limitation it is not a bug but a feature. # 2014 +## 2014 maffiodo1 + +### STATUS: INABIAF - please **DO NOT** fix +### Source code: [2014/maffiodo1/prog.c](2014/maffiodo1/prog.c) +### Information: [2014/maffiodo1/README.md](2014/maffiodo1/README.md) + +The author noted that in macOS the colours might be wrong. They gave a solution. +However Cody didn't see any problem with it and he beat the series many times. +Of course the game here is small and he's practically blind and it's been a +while since he last played so it might be wrong. Nevertheless the author does +give a way to reconfigure the colours. + +The author noted that the character cannot go through walls and the impression +is that this is how it was believed but Cody ironically pointed out that there +are known glitches where in some places you actually could go through walls. +This might even have applied to the arcade version, Mario Bros, though that can +no longer be confirmed by Cody. The point here is that in this game you cannot +go through walls but it's not a bug. + +On the other hand, the author also stated: + +-- + +When the `Super character` becomes bigger (`ZOOM` flag), the character can +collide with blocks and get stuck inside them. This is a KNOWN BUG. When your +player become bigger, stay away from blocks! + + +-- + +but since it's documented it's considered a feature, not a bug to fix. + + ## 2014 vik ### STATUS: known bug - please help us fix diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index daadd39c0..52a1fdc24 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3715,6 +3715,12 @@ it is a file with spoilers (and too close to README.md?). [Cody](#cody) fixed the build for this entry: it does not require [SDL2](https://www.libsdl.org) but SDL1 so there were linking errors. +Cody also added the [mario.sh](2014/maffiodo1/mario.sh) and +[giana.sh](2014/maffiodo1/giana.sh) scripts which play, respectively, [Super +Mario Bros](http://en.wikipedia.org/wiki/Super_Mario_Bros.) and one of [The +Great Giana Sisters](http://en.wikipedia.org/wiki/The_Great_Giana_Sisters), but +which let one configure the width and height of the game. + ## [2014/morgan](2014/morgan/prog.c) ([README.md](2014/morgan/README.md))