Bitter

From Esolang
Jump to: navigation, search

Like Brainfuck - only much, much, worse.
The blame rests solely on User:DMC.

  • another brainfuck variation that uses 1-bit memory cells
  • four commands < > ( )
  • two interpreter commands  ! # used for debuging purposes, do not have to implemented
  • Influenced by: Brainfuck, Smallfuck

Description

  • an array of bits starting at zero and going to the right
  • infinite and unbounded in the positive direction
  • all memory initialized to 0
  • for practical purposes, memory only needs to be large enough to accommodate a particular program
  • setting p to < 0 is an error and should halt the program
  • [p] bit value at memory location p
  • input: defined in initial program state
  • output: determined by examining memory
  • possibly Turing complete
  • Mathematically equivalently to smallfuck if certain memory usage procedures are followed

Commands

Command Description
>
p += 1, [p] = not[p]
<
p -= 1, [p] = not[p]
(
if [p] == 1, proceed to next command, otherwise advance to command after matching ')'
)
go back to matching )
!
interpreter command: dump memory from 0 to highest value of data pointer
#
interpreter command: pause program and dump memory

Initialization process

  • Initialize each bit in succession using: > and >><.
  • If the next bit is already what you want, use >><.
  • If the next bit is not what you want, > will invert it.

Examples

Hello, World!\n

Load memory 0 through 111 with 'Hello, World!\n'
>>><>>>><>>><>>>>><>>>><>><>>>>><>><>><>>><>>>>><>
><>><>>><>>>>><>><>><>><>><>>><>><>>>>><>>><>>>><>
>><>>><>>>><>><>>>>>><>><>><>>>>>>><>><>><>><>>><>
><>>><>><>><>>>>><>>><>><>><>>><>><>>><>>><>><>>><
>>><>><>>><>>><>><>>>><!

Tedious memory initialization

0100 1000
> >>< > > >>< > > ><
0110 0101
> > > >>< > > >>< >><
0110 1100
> > > >>< >>< >>< > >><
0110 1100
> > > >>< >>< >>< > >><
0110 1111
> > > >>< >>< >>< >>< >><
0010 1100
> >>< > >< > > > >>< >
0010 0000
>>< > > >>< > >>< > >><>
0101 0111
> >>< > >< > > > >
0110 1111
>>< >>< >>< > > > > >
0111 0010
>>< >>< >>< >>< > >>< >>< >
0110 1100
>>< >>< >>< > > > >>< >
0110 0100
>>< >>< >>< > >>< >>< > >><
0010 0001
> >>< >>< > >>< > >>< >>
0000 1010
> >>< > >>< >>< > > >><

External resources

  • Bitter – Interpreter in Python 3