about summary refs log tree commit diff stats
path: root/README.md
blob: 423401ea4a7a7cb226656ddfb543852591f0764d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# 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](https://git.acdw.net/trainfuck/tree/COPYING) for details.

## AUTHOR

trainfuck was shat out by Case Duckworth (acdw) one evening during the
CoVid-19 quarantine times.
that probably explains it.