Improve 2013/misaka/try.alt + Format/typo check

This commit is contained in:
Cody Boone Ferguson committed 2023-12-02 11:28:06 -08:00
1 parent 250a5a12be
commit c109cd23cc
3 files changed
+43 -40

No files matched your search

+15 -20
View File
@@ -26,21 +26,6 @@ make understanding
Also try: Also try:
```sh
seq 1 12 | ./horizontal_cat - - -
./long_cat
./long_faat_cat
./long_fat_cat
./loong_cat
./loooong_cat
./loooooooong_cat
seq -f '%.0f ' 45 | ./horizontal_cat - misaka.c
```
Alternately you can just try:
```sh ```sh
./try.sh ./try.sh
``` ```
@@ -57,6 +42,7 @@ NOTE: Use - for standard input. For example:
There is more to cat than [mere cats](http://cheezburger.com/1680494336). Be There is more to cat than [mere cats](http://cheezburger.com/1680494336). Be
they tall, fat, long or squat, this source code is sure to amuse. they tall, fat, long or squat, this source code is sure to amuse.
#### Slight diversion #### Slight diversion
While one of the judges was reviewing this entry on the stern of the While one of the judges was reviewing this entry on the stern of the
@@ -66,7 +52,7 @@ in the middle of the Atlantic Ocean waiting for the
the judge was struck by a the judge was struck by a
[flying fish](http://en.wikipedia.org/wiki/Flying_fish). [flying fish](http://en.wikipedia.org/wiki/Flying_fish).
While the result of the impact was that the While the result of the impact was that the
[Port](http://en.wikipedia.org/wiki/Port_wine) from Portugal was lost, but the [Port](http://en.wikipedia.org/wiki/Port_wine) from Portugal was lost, the
[Grog](https://web.archive.org/web/20130702003043/http://www.travelforpassion.com/grog-factory-cape-verde-santo-antao-cape-verde-1602-photo) [Grog](https://web.archive.org/web/20130702003043/http://www.travelforpassion.com/grog-factory-cape-verde-santo-antao-cape-verde-1602-photo)
from Cape Verde and the laptop containing this entry was saved. from Cape Verde and the laptop containing this entry was saved.
@@ -92,7 +78,8 @@ cc misaka2.c -o vertical_cat
./vertical_cat [files...] > [output] ./vertical_cat [files...] > [output]
``` ```
Where `[files...]` are a list of text file names. Use `-` to read from stdin. Where `[files...]` is a list of text file names. Use `-` to read from `stdin`.
### Details ### Details
@@ -118,7 +105,7 @@ original text alignments are preserved.
If `-` is specified as a file name, `horizontal_cat` will read from `stdin`. If `-` is specified as a file name, `horizontal_cat` will read from `stdin`.
Unlike `cat`, `horizontal_cat` loads all input to memory first. Thus you Unlike `cat`, `horizontal_cat` loads all input to memory first. Thus you
can specify `-` multiple times to get stdin multiplied horizontally. For can specify `-` multiple times to get `stdin` multiplied horizontally. For
example, if you have `seq(1)` in your shell, you can add line numbers to both example, if you have `seq(1)` in your shell, you can add line numbers to both
sides of [misaka.c](misaka.c) like this: sides of [misaka.c](misaka.c) like this:
@@ -126,6 +113,7 @@ sides of [misaka.c](misaka.c) like this:
seq -f ' %.0f ' 45 | ./horizontal_cat - misaka.c - seq -f ' %.0f ' 45 | ./horizontal_cat - misaka.c -
``` ```
### Vertical cat ### Vertical cat
Because `horizontal_cat` must know the maximum width of all files before Because `horizontal_cat` must know the maximum width of all files before
@@ -151,6 +139,7 @@ gcc misaka2.c -o vertical_cat
./vertical_cat - - ./vertical_cat - -
``` ```
### Long cat ### Long cat
After `horizontal_cat` and `vertical_cat`, I thought, maybe all I really wanted After `horizontal_cat` and `vertical_cat`, I thought, maybe all I really wanted
@@ -214,6 +203,7 @@ MISAKA
MISAKA MISAKA MISAKA MISAKA
``` ```
### Return value ### Return value
`horizontal_cat` and `vertical_cat` will exit with zero status on success. `horizontal_cat` and `vertical_cat` will exit with zero status on success.
@@ -224,6 +214,7 @@ report the offending file name to `stdout`, and exit with nonzero status.
If `horizontal_cat` and `vertical_cat` ran out of memory, they will exit If `horizontal_cat` and `vertical_cat` ran out of memory, they will exit
with nonzero status without outputting anything. with nonzero status without outputting anything.
### Compatibility ### Compatibility
`horizontal_cat` makes the following assumptions about input files: `horizontal_cat` makes the following assumptions about input files:
@@ -242,6 +233,7 @@ with nonzero status without outputting anything.
`Misaka` requires a C99 compiler due to the use of single line comments. `Misaka` requires a C99 compiler due to the use of single line comments.
`Misaka` does not depend on any other C99 features. `Misaka` does not depend on any other C99 features.
### Obfuscation ### Obfuscation
Main obfuscation is in having a C program that compiles when tiled Main obfuscation is in having a C program that compiles when tiled
@@ -263,21 +255,24 @@ Other features to look for:
`gcc -Wall` should provide a hint to where the mode switch happens, it `gcc -Wall` should provide a hint to where the mode switch happens, it
does not output any irrelevant other warnings (verified on 4.6.3). does not output any irrelevant other warnings (verified on 4.6.3).
### Extra files ### Extra files
Extra files included in my submission are informational only, they are not Extra files included in my submission are informational only, they are not
needed for the program to work. needed for the program to work.
* [bf.pl](bf.pl) - a brainfuck interpreter, in case you don't have one handy. * [bf.pl](bf.pl) - a perl brainfuck interpreter, in case you don't have one
handy.
* [spoiler.html](spoiler.html) - making of this program. * [spoiler.html](spoiler.html) - making of this program.
### About `Misaka` ### About `Misaka`
The name, layout, and functionality of `Misaka` is inspired by a particular The name, layout, and functionality of `Misaka` is inspired by a particular
stackable figure: stackable figure:
* [Google images](http://google.co.jp/search?q=%E3%83%9F%E3%82%B5%E3%82%AB%E7%9B%9B%E3%82%8A&tbm=isch) * [Google images](http://google.co.jp/search?q=%E3%83%9F%E3%82%B5%E3%82%AB%E7%9B%9B%E3%82%8A&tbm=isch)
* [Kotobukiya](http://main.kotobukiya.co.jp/figure/tsubucole_tmi_misakamori/) * [Kotobukiya](https://web.archive.org/web/20140325175014/http://main.kotobukiya.co.jp/figure/tsubucole_tmi_misakamori/)
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License:
+27 -17
View File
@@ -15,33 +15,43 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown # clear screen after compilation so that only the entry is shown
clear clear
echo "$ seq 1 12 | ./horizontal_cat - - -" read -r -n 1 -p "Press any key to run: seq 1 12 | ./horizontal_cat - - -: "
echo 1>&2
seq 1 12 | ./horizontal_cat - - - seq 1 12 | ./horizontal_cat - - -
sleep 1 echo 1>&2
echo "$ ./long_cat" read -r -n 1 -p "Press any key to run: ./long_cat: "
echo 1>&2
./long_cat ./long_cat
sleep 1 echo 1>&2
echo "$ ./long_faat_cat" read -r -n 1 -p "Press any key to run: ./long_faat_cat: "
echo 1>&2
./long_faat_cat ./long_faat_cat
sleep 1 echo 1>&2
echo "$ ./long_fat_cat" read -r -n 1 -p "Press any key to run: ./long_fat_cat: "
echo 1>&2
./long_fat_cat ./long_fat_cat
sleep 1 echo 1>&2
echo "$ ./loong_cat" read -r -n 1 -p "Press any key to run: ./loong_cat: "
echo 1>&2
./loong_cat ./loong_cat
sleep 1 echo 1>&2
echo "$ ./loooong_cat" read -r -n 1 -p "Press any key to run: ./loooong_cat: "
echo 1>&2
./loooong_cat ./loooong_cat
sleep 1 echo 1>&2
echo "$ ./loooooooong_cat" read -r -n 1 -p "Press any key to run: ./loooooooong_cat (space = next page, q = quit): "
./loooooooong_cat echo 1>&2
sleep 1 ./loooooooong_cat | less -EX
echo 1>&2
echo "$ seq -f '%.0f ' 45 | ./horizontal_cat - misaka.c" echo "Press any key to run: seq -f '%.0f ' 45 | ./horizontal_cat - misaka.c"
seq -f '%.0f ' 45 | ./horizontal_cat - misaka.c read -r -n 1 -p "(space = next page, q = quit): "
echo 1>&2
seq -f '%.0f ' 45 | ./horizontal_cat - misaka.c | less -EX
echo 1>&2
+1 -3
View File
@@ -3617,9 +3617,7 @@ this broke `make` which Cody also fixed.
## [2013/misaka](2013/misaka/misaka.c) ([README.md)[2013/misaka/README.md)) ## [2013/misaka](2013/misaka/misaka.c) ([README.md)[2013/misaka/README.md))
As there are a lot of commands to try, [Cody](#cody) added the [Cody](#cody) added the [try.sh](2013/misaka/try.sh) script.
[try.sh](2013/misaka/try.sh) script to do this, sleeping for approximately 1
second between commands.
## [2013/morgan1](2013/morgan1/morgan1.c) ([README.md](2013/morgan1/README.md)) ## [2013/morgan1](2013/morgan1/morgan1.c) ([README.md](2013/morgan1/README.md))