|
| 1 | +BIG(1) |
| 2 | +------ |
| 3 | + |
| 4 | +#### NAME #### |
| 5 | + |
| 6 | +**big** - Befunge integer generator |
| 7 | + |
| 8 | +#### SYNOPSIS #### |
| 9 | + |
| 10 | + big [options...] <number> |
| 11 | + big [options...] <number>..<number> |
| 12 | + |
| 13 | +#### DESCRIPTION #### |
| 14 | + |
| 15 | +The Befunge Integer Generator attempts to generate the shortest possible |
| 16 | +Befunge expression that will evaluate to a given number. |
| 17 | + |
| 18 | +It can accept a list of individual numbers (e.g. `5 10 15`) or a number range |
| 19 | +(e.g. `10..20`). The input is interpreted as decimal by default, but can be |
| 20 | +marked as hexadecimal with an `h` suffix (e.g. `7Fh`). |
| 21 | + |
| 22 | +The following options are also available: |
| 23 | + |
| 24 | +| Option | Description | |
| 25 | +|---------------|-------------------------------------------------------------| |
| 26 | +| -h, --help | Display this help | |
| 27 | +| -f, --fast | Prefer faster results over shorter string literals | |
| 28 | +| -n, --numeric | Only allow numeric expressions (no strings) | |
| 29 | +| -s, --safe | Disallow unsafe characters: SPACE, ';' and '@' | |
| 30 | +| -a, --all | Show all variants matching the minimal length | |
| 31 | +| --93 | Befunge-93 compatible expressions (default) | |
| 32 | +| --98 | Befunge-98 compatible expressions | |
| 33 | + |
| 34 | +By default the generator prefers expressions with shorter string literals, |
| 35 | +since those can more easily be split when having to change direction in a |
| 36 | +piece of Befunge code. If the **fast** option is set, though, the generator |
| 37 | +will just return the first minimal-length result it finds. |
| 38 | + |
| 39 | +If the **numeric** option is set, the generator will avoid strings literals |
| 40 | +altogether, which can be useful in certain restricted-source scenarios. |
| 41 | + |
| 42 | +The **safe** option will prevent the use of a few characters that are known |
| 43 | +to have portability problems. This include the SPACE character (which some |
| 44 | +interpreters drop), the `;` character (which can be misinterpreted as a jump |
| 45 | +operation), and the `@` character (which can force some implementation to |
| 46 | +terminate). |
| 47 | + |
| 48 | +If the **all** option is set, the generator will return every minimal-length |
| 49 | +expression it can find for a particular number. |
| 50 | + |
| 51 | +By default, the generated expression are compatible with Befunge-93, but if |
| 52 | +the **98** option is set, they may use language extensions specific to the |
| 53 | +Befunge-98 standard. This includes hex literals, as well as the one-shot |
| 54 | +string mode. Technically these extensions are also supported by Befunge-96 |
| 55 | +and -97, but those versions of the language are rarely used anymore. |
| 56 | + |
| 57 | +#### LIMITATIONS #### |
| 58 | + |
| 59 | +In most cases the generated expressions should be optimal, but that can't |
| 60 | +always be guaranteed. The **numeric** mode in particular is known to produce |
| 61 | +results that are less than optimal for some values. |
| 62 | + |
| 63 | +Even when optimal, the **all** option will not be guaranteed to return every |
| 64 | +possible expression that matches the best length. There are a limited set of |
| 65 | +strategies used by the generator, so those are obviously the only variants |
| 66 | +that will be returned. |
| 67 | + |
| 68 | +#### AUTHOR #### |
| 69 | + |
| 70 | +Written by James Holderness. |
| 71 | + |
| 72 | +#### SEE ALSO #### |
| 73 | + |
| 74 | +[BefunRep](https://github.com/Mikescher/BefunRep), |
| 75 | +[Fungify](https://deewiant.iki.fi/projects/fungify), |
| 76 | +[Befour](https://codegolf.stackexchange.com/a/78561) |
0 commit comments