From 0a78720644e45bd27c4a57cbddf2d32aacb555c3 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 29 Jun 2022 00:59:59 -0500 Subject: Probably version ... whatever the next higher one is --- examples/helloworld.trainfuck | 152 ------------------------------------------ 1 file changed, 152 deletions(-) delete mode 100644 examples/helloworld.trainfuck (limited to 'examples/helloworld.trainfuck') diff --git a/examples/helloworld.trainfuck b/examples/helloworld.trainfuck deleted file mode 100644 index 1f68f11..0000000 --- a/examples/helloworld.trainfuck +++ /dev/null @@ -1,152 +0,0 @@ -TRAINFUCK BABEEE -CHOO CHOO MUTHERFUCKER - -This example adapted from https://en.wikipedia.org/wiki/Brainfuck - -This program prints "Hello World!" and a newline to the screen, its -length is 106 active command characters. - -The program doesn't start until we have ALL ABOARD on a line by itself, so -we've got one better than an initial comment loop. - -This file was handwritten, but soon(TM) we'll have a fucktrain command, -that'll translate to trainfuck from brainfuck. - -ALL ABOARD -chug chug chug chug chug chug chug chug -END OF THE LINE - Set Cell #0 to 8 - (Also note: you can have comments betwen END OF THE LINE and ALL ABOARD) -ALL ABOARD -tickets please -choo -chug chug chug chug -END OF THE LINE - Add 4 to Cell #1; this will always set Cell #1 to 4 -ALL ABOARD -tickets please -END OF THE LINE - as the cell will be cleared by the loop -ALL ABOARD -choo -chug chug -END OF THE LINE - Add 2 to Cell #2 -ALL ABOARD -choo -chug chug chug -END OF THE LINE - Add 3 to Cell #3 -ALL ABOARD -choo -chug chug chug -END OF THE LINE - Add 3 to Cell #4 -ALL ABOARD -choo -chug -END OF THE LINE - Add 1 to Cell #5 -ALL ABOARD -choo choo -choo choo -choo choo -choo choo -chugga -END OF THE LINE - Decrement the loop counter in Cell #1 -ALL ABOARD -your ticket please -END OF THE LINE - Loop till Cell #1 is zero; number of iterations is 4 -ALL ABOARD -choo -chug -END OF THE LINE - Add 1 to Cell #2 -ALL ABOARD -choo -chug -END OF THE LINE - Add 1 to Cell #3 -ALL ABOARD -choo -chugga -END OF THE LINE - Subtract 1 from Cell #4 -ALL ABOARD -choo -choo -chug -END OF THE LINE - Add 1 to Cell #6 -ALL ABOARD -tickets pleasechoo choo -your ticket please -END OF THE LINE - Move back to the first zero cell you find; this will -ALL ABOARD - -END OF THE LINE - be Cell #1 which was cleared by the previous loop -ALL ABOARD -choo choo -chugga -END OF THE LINE - Decrement the loop Counter in Cell #0 -ALL ABOARD -your ticket please -END OF THE LINE - Loop till Cell #0 is zero; number of iterations is 8 -ALL ABOARD -END OF THE LINE -The result of this is: -Cell No : 0 1 2 3 4 5 6 -Contents: 0 0 72 104 88 32 8 -Pointer : ^ - -ALL ABOARD -choo -choo -click -END OF THE LINE - Cell #2 has value 72 which is 'H' -ALL ABOARD -choo -chugga chugga chugga click -END OF THE LINE - Subtract 3 from Cell #3 to get 101 which is 'e' -ALL ABOARD -chug chug chug chug chug chug chug click click chug chug chug click -END OF THE LINE - Likewise for 'llo' from Cell #3 -ALL ABOARD -choo -choo -click -END OF THE LINE - Cell #5 is 32 for the space -ALL ABOARD -choo choo -chugga click -END OF THE LINE - Subtract 1 from Cell #4 for 87 to give a 'W' -ALL ABOARD -choo choo -click -END OF THE LINE - Cell #3 was set to 'o' from the end of 'Hello' -ALL ABOARD -chug chug chug click chugga chugga chugga chugga chugga chugga click chugga chugga chugga chugga chugga chugga chugga chugga click -END OF THE LINE - Cell #3 for 'rl' and 'd' -ALL ABOARD -choo -choo -chug click -END OF THE LINE - Add 1 to Cell #5 gives us an exclamation point -ALL ABOARD -choo -chug chug click -END OF THE LINE -- cgit 1.4.1-21-gabe81