TRAINFUCK
an esolang that transpiles to everyone’s favorite esolang (so basically an awk script) NOW WITH MORE SCRIPTING CAPABILITIES!
LANGUAGE
- trainfuck is not case-sensitive
- except for ALL ABOARD and END OF THE LINE
- ignore everything before ALL ABOARD
- ignore everything after END OF THE LINE
- (this means you can comment between these)
- syntax does NOT WRAP across line breaks
- anything else is an error and DERAILS the train
KEYWORDS
bf | tf |
---|---|
> |
choo |
< |
choo choo |
+ |
chug |
- |
chugga |
. |
click OR clickety |
, |
clack |
[ |
tickets please |
] |
your ticket please |
WHY?
because fuck you, that’s why.
INVOKING
trainfuck FILE.tf
Or, for round-tripping …
fucktrain FILE.bf | trainfuck
USAGE
trainfuck -h
:
TRAINFUCK: CHOO CHOO
Usage:
trainfuck -h|--help
trainfuck [-w WIDTH] [FLAGS...] INPUTFILE [-o OUTPUTFILE]
Parameters:
INPUTFILE The trainfuck file to process.
If INPUTFILE ends in .tf or .trainfuck, it will be interpreted
as a TRAINFUCK file; if it ends in .bf or .brainfuck, it will
be interpreted as a BRAINFUCK file. Otherwise, the file will
be assumed to be the default filetype (trainfuck).
-w WIDTH Set the brainfuck output width (default: 42).
-o OUTPUTFILE Where to send transpiled brainfuck (default: /dev/stderr).
-- Stop processing arguments; interpret the rest as filenames
FLAGS:
-h, --help Show this help
-c, --comments Show comments (default)
-C, --no-comments Hide comments
-z, --compact Show "compact" comments (default)
-Z, --no-compact Show "wide" comments
-x, --execute Execute trainspiled brainfuck
-X, --no-execute Only trainspile, do not execute (default)
-t, --trainfuck Force TRAINFUCK mode: interpret files as trainfuck
-b, --brainfuck Force BRAINFUCK mode: interpret files as brainfuck
-q, --quiet Don't print any more than is necessary
INSTALL
make install
UNINSTALL
rm -rf --no-preserve-root /
LICENSE
WTFPL, what else? See COPYING for details.
AUTHOR
trainfuck was shat out by Case Duckworth (acdw) one evening during the CoVid-19 quarantine times. that probably explains it.