Scuttle - A Fungeoid With Moving Parts

What is Scuttle?

Scuttle is one of those esoteric programming languages, whose purpose is less to make useful programs, but rather to make people (or at least programmers) shudder with horror and question the sanity of the author.

I'd been reading about various esoteric languages and thought I'd try my hand at one of my own. I admired Befunge's style and Brainfuck's simplicity, and so decided to make one based on the two. As an added twist, I decided that pieces of code should be able to move, or scuttle about. I started writing the spec, and decided that the code should be self modifying as well, beyond movement. So far I've implemented only one of the 4 or so code manipulation instructions.

So what can I do with Scuttle?

In theory, everything that you can do with a Turing machine since the language supports all of Brainfuck's instructions with only two variations. Like Brainfuck (and unlike Befunge), Scuttle uses an array of memory. Like Befunge (and unlike Brainfuck) program execution can flow in any direction. Code is divided into blocks called rafts, which can move independently of each other. Once set into motion, the raft will continue moving until it either hits another raft, is told to stop, or hits the edge of the program.

The instruction set is as follows:

InstructionMeaning
+Increase value in current memory position
-Decrease value in current memory position
!Set current memory position to 0
a s d fMove current raft west, north, south or east respectively.
xStop movement of current raft
h j k lChange direction of program execution to west, north, south or east respectively.
< > and ^ vStore the hexadecimal value indicated between the executed instruction and the corresponding closing one into the current memory position. The order the parts of the hexadecimal value are read in depends on which of the instructions was executed.
[ ] and ~ _Program flow continues at the corresponding closing instruction. The direction that it searches depends on the current memory value. If zero, [ will search west and ] east, ~ up and _ down, otherwise [ will search east and ] west, ~ down and _ up.
oRock. Never moves and never part of a raft. Will stop rafts. A NOP if executed.
$Cannon. Destroys instructions. Which instructions are destroyed depend on the adjacent instructions. If a or h are to its west, the next instruction to the west will be destroyed. Likewise s or j to the north, d or k to the south and f or l to the east.
)Move to the next memory position
(Move to the previous memory position
.Tar. Program execution halts one cycle, but rafts still continue to move.
"Prints ASCII character with value equal to current memory position
#Prints integer value of current memory position
?Gets character from user and stores its ASCII value into current memory position
@Indicates program starting position. Blatent Nethack reference.
SpaceEnds program execution. Freely traversed by rafts.
Pretty much everything elseBlocks rafts, included in rafts, NOP if executed.
!, >, >, ^, v and # were added mostly for convenience once I started writing the sample code. Purists can feel free to ignore them.

How can I get my hands on something that can run Scuttle code?

I've written a quick and dirty interpretter in Python which you can find here. I'm not kidding about the dirty part.

And sample Scuttle programs?

Here you can find Hello World and and an abbreviated 99 Bottles of Beer.