From 74d106265b3e0e07c0db5e062741208575b0098f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 8 Jun 2022 10:49:02 -0500 Subject: Add fucktrain Now you can turn your brainfuck programs into trainfuck!!! --- README.md | 3 +++ fucktrain | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 fucktrain diff --git a/README.md b/README.md index 957af04..cb84572 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,9 @@ because fuck you, that's why. trainfuck FILE | BRAINFUCK_INTERPRETER ``` +**NEW**: `fucktrain`, which transpiles brainfuck programs into trainfuck +programs! Now it's *even easier* to trainfuck!! + ## INSTALL ``` diff --git a/fucktrain b/fucktrain new file mode 100755 index 0000000..c93a708 --- /dev/null +++ b/fucktrain @@ -0,0 +1,35 @@ +#!/bin/awk -f +# FUCKTRAIN: FUCKAMUTHA CHOO CHOO -*- awk -*- +# Author: Case Duckworth +# License: WTFPL +# Version: #9 +BEGIN { + print "ALL ABOARD" +} + +{ + gsub(/[^-+<>.,\[\]]/, "", $0) + gsub(/+/, "chug ", $0) + gsub(/-/, "chugga ", $0) + gsub(/>/, "choo\n", $0) + gsub(/