nixpulvis / brainfuck

A simple brainfuck interpreter in Rust.
http://nixpulvis.com/brainfuck
23 stars 3 forks source link

Tape #17

Closed nixpulvis closed 8 years ago

nixpulvis commented 8 years ago

This implements the abstraction of a tape. Currently this undoes some of the overflowing work but things are still checked, just the errors are panics now. See #16 for more discussion on what we want to do exactly about overflows.

The tape uses overloaded operators as it's primary interface. For example:

let mut tape = Tape::new();
tape += 1;
tape >>= 1;
tape += 2;
tape <<= 1;
tape -= 1;
tape >>= 2;
*tape = 42;
println!("{}", *tape);

Fixes #15