Format/typo check + add try.sh to 2012/blakely
The bugs.md was also updated with a INABIAF section.
This commit is contained in:
1 parent
290c40dba8
commit
75ab4869e2
4 files changed
+69
-2
No files matched your search
+18
-2
@@ -5,6 +5,17 @@ make
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Bugs and (Mis)features:
|
||||||
|
|
||||||
|
The current status of this entry is:
|
||||||
|
|
||||||
|
```
|
||||||
|
STATUS: INABIAF - please **DO NOT** fix
|
||||||
|
```
|
||||||
|
|
||||||
|
For more detailed information see [2012 blakely in bugs.md](/bugs.md#2012-blakely).
|
||||||
|
|
||||||
|
|
||||||
## To use:
|
## To use:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -46,7 +57,7 @@ This program renders a generic
|
|||||||
[GIF](https://en.wikipedia.org/wiki/GIF) form. The expression in spatial
|
[GIF](https://en.wikipedia.org/wiki/GIF) form. The expression in spatial
|
||||||
variables `x` and `y` is specified on the command-line with the required
|
variables `x` and `y` is specified on the command-line with the required
|
||||||
resolution, and an animated GIF showing a fly-around of the resulting surface is
|
resolution, and an animated GIF showing a fly-around of the resulting surface is
|
||||||
output to stdout.
|
output to `stdout`.
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
@@ -77,7 +88,7 @@ x - x coordinate value
|
|||||||
y - y coordinate value
|
y - y coordinate value
|
||||||
```
|
```
|
||||||
|
|
||||||
NB all arithmetic is done in double precision, so `23/` is two-thirds, rather
|
NB: all arithmetic is done in double precision, so `23/` is two-thirds, rather
|
||||||
than 0.
|
than 0.
|
||||||
|
|
||||||
The surface plotted corresponds to `-1 <= x,y <= 1` and for best results, the
|
The surface plotted corresponds to `-1 <= x,y <= 1` and for best results, the
|
||||||
@@ -86,6 +97,7 @@ generated `z` value should lie between `-1` and `1`.
|
|||||||
If there is a division by zero, square-root of a negative number, or similar
|
If there is a division by zero, square-root of a negative number, or similar
|
||||||
operation, then the results are undefined.
|
operation, then the results are undefined.
|
||||||
|
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
For test-runs, use a resolution of 32. For simple expressions, the
|
For test-runs, use a resolution of 32. For simple expressions, the
|
||||||
@@ -103,6 +115,7 @@ processor](https://en.wikipedia.org/wiki/Intel_Core#Core_i7).
|
|||||||
./blakely xx*yy*1++d5*ct/ 64 > ripple.gif
|
./blakely xx*yy*1++d5*ct/ 64 > ripple.gif
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Algorithm
|
### Algorithm
|
||||||
|
|
||||||
A generic root-finding algorithm to find the point of intersection between a ray
|
A generic root-finding algorithm to find the point of intersection between a ray
|
||||||
@@ -111,6 +124,7 @@ make the rendering realistic, both the value of the expression, and its
|
|||||||
derivative with respect to `x` and `y` must be tracked. This is done using an
|
derivative with respect to `x` and `y` must be tracked. This is done using an
|
||||||
obvious stack-based approach.
|
obvious stack-based approach.
|
||||||
|
|
||||||
|
|
||||||
### Obfuscations
|
### Obfuscations
|
||||||
|
|
||||||
Much of the obfuscation is achieved through the use of single-letter variables
|
Much of the obfuscation is achieved through the use of single-letter variables
|
||||||
@@ -120,6 +134,7 @@ and wonderful ways, making use of
|
|||||||
[XOR](https://en.wikipedia.org/wiki/Exclusive_or), return values from
|
[XOR](https://en.wikipedia.org/wiki/Exclusive_or), return values from
|
||||||
`putchar()`, and odd expressions. The layout is in the form of `X Y Z`.
|
`putchar()`, and odd expressions. The layout is in the form of `X Y Z`.
|
||||||
|
|
||||||
|
|
||||||
### Limitations
|
### Limitations
|
||||||
|
|
||||||
ASCII is assumed since many bytes for the
|
ASCII is assumed since many bytes for the
|
||||||
@@ -128,6 +143,7 @@ given in the source code. On compilation a few warnings about parentheses come
|
|||||||
up when using gcc 4.6.3, and one about no return value from `main()` (who uses
|
up when using gcc 4.6.3, and one about no return value from `main()` (who uses
|
||||||
exit codes anyway?), but clang 3.1 emits no warnings.
|
exit codes anyway?), but clang 3.1 emits no warnings.
|
||||||
|
|
||||||
|
|
||||||
### Questions
|
### Questions
|
||||||
|
|
||||||
* Apart from their appearance when computing the [RPN
|
* Apart from their appearance when computing the [RPN
|
||||||
|
|||||||
Executable
+35
@@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 2012/blakely
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
echo "$ ./blakely "xx*yy*+" 64 > paraboloid.gif" 1>&2
|
||||||
|
./blakely "xx*yy*+" 64 > paraboloid.gif
|
||||||
|
|
||||||
|
echo "$ ./blakely 9 32 > empty.gif 1>&2"
|
||||||
|
./blakely 9 32 > empty.gif
|
||||||
|
|
||||||
|
echo "$ ./blakely xy* 32 > saddle.gif" 1>&2
|
||||||
|
./blakely xy* 32 > saddle.gif
|
||||||
|
|
||||||
|
echo "$ ./blakely xx*yy*1++d5*ct/ 64 > ripple.gif" 1>&2
|
||||||
|
./blakely xx*yy*1++d5*ct/ 64 > ripple.gif
|
||||||
|
|
||||||
|
echo "This might take a bit of time:" 1>&2
|
||||||
|
echo "$ time ./blakely 0 250 > flat.gif" 1>&2
|
||||||
|
time ./blakely 0 250 > flat.gif
|
||||||
|
|
||||||
|
echo "Now open paraboloid.gif, empty.gif, saddle.gif, ripple.gif and flat.gif in a" 1>&2
|
||||||
|
echo "viewer that shows animated GIFs." 1>&2
|
||||||
@@ -2728,6 +2728,20 @@ fire](https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing)) :-)
|
|||||||
# 2012
|
# 2012
|
||||||
|
|
||||||
|
|
||||||
|
## 2012 blakely
|
||||||
|
|
||||||
|
### STATUS: INABIAF - please **DO NOT** fix
|
||||||
|
### Source code: [2012/blakely/blakely.c](2012/blakely/blakely.c)
|
||||||
|
### Information: [2012/blakely/README.md](2012/blakely/README.md)
|
||||||
|
|
||||||
|
The author stated:
|
||||||
|
|
||||||
|
```
|
||||||
|
If there is a division by zero, square-root of a negative number, or similar
|
||||||
|
operation, then the results are undefined.
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## 2012 deckmyn
|
## 2012 deckmyn
|
||||||
|
|
||||||
### STATUS: INABIAF - please **DO NOT** fix
|
### STATUS: INABIAF - please **DO NOT** fix
|
||||||
|
|||||||
@@ -3330,6 +3330,8 @@ dies.
|
|||||||
[Cody](#cody) added explicit linking of libm (`-lm`) as not all systems do this
|
[Cody](#cody) added explicit linking of libm (`-lm`) as not all systems do this
|
||||||
implicitly (Linux doesn't seem to but macOS does).
|
implicitly (Linux doesn't seem to but macOS does).
|
||||||
|
|
||||||
|
Cody also added the [try.sh](2012/blakely/try.sh) script.
|
||||||
|
|
||||||
|
|
||||||
## [2012/deckmyn](2012/deckmyn/deckmyn.c) ([README.md](2012/deckmyn/README.md]))
|
## [2012/deckmyn](2012/deckmyn/deckmyn.c) ([README.md](2012/deckmyn/README.md]))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user