How dare you fuck the brain

From Esolang
(Redirected from How dare you f*** the brain)
Jump to navigation Jump to search
Official logo

How dare you fuck the brain is "brainfuck but it's only purpose to be a golf esolang"-like esolang, created by User:Ractangle and is by far the best thing he has made (excluding the unimplemented languages)

Syntax

Command Meaning
I Increment current cell
D Decrement current cell
^ Move the cell pointer right
v Move the cell pointer left
) Go to the nearest last newline if the cell is not 0
P Print a character from the cell's value
N Print the cell's value
= Copy the current cell's value to the cell next to it
+ Sum the current cell's value of and the cell next to it and put the result to the first cell of the operator and empty the cell next to it
H Halts program
/ Skips a command if the cell is not zero
Sets the the claw to the cell's value
Sets the cell's value to the claw
G Goto statement. Does nothing if the current cell is negative
; Gets user input and stores the interger into the currently pointing cell
-> Comment. Ignores all characters until encounters a newline

Examples

Disan Count

;
D^INv)H

Truth-machine

;/N/H^I
N)

Erase data in a cell

D)

Hello, world!

IIII=+=+=+=+IIIIIIIIP=DDDP^IIIIPPIIIP^IIII=+=+=+^IIII=+=+DDDDv+P
DvD^)IIII=+=+=+P=+^IIII=+=+v+IIIIIIIP=
vD^D)^DDDDDDDDv+P=IIIP^DDDP^DDDD=+v+P^IIII=+=+=+IPH

Move data from a cell to an another cell

= ->Copy from the other cell before erasing the data from it
D)

Using the claw:

↑ ->some value from the other cell
^^^ ->you can move the value basicly anywhere
↓ ->the claw will replace the current cotent of the cell that the pointer is currently pointing at and replcade it with the value from the grabed cell

A+B Problem

;=;+NH

computational class

HDYFTB is Turing-complete since Brainfuck can be translated into HDYFTB (proof by User:Yayimhere)

[...] -> \n...) yes the \n is a newline
+ -> I
- -> D
> -> ^
< -> v
. -> P

However. Nested loops are literally impossible due to the fact that the starting point of the loop is the beginning of the line (or the newline) and is only in one position, and since you cannot backtrack to an upper line, it's impossible to nest loops, so this proves that HDYFTB cannot be powerful as brainfuck

Interpreter

Xyzzy made a python interpreter of HDYFTB, modified majorly by User: Ractangle.

debug=0;tape=[0]*16;code="""H""";cp=0;dp=0;c=""
while 1:
  if code[cp]=="I":tape[dp]+=1
  elif code[cp]=="D":tape[dp]-=1
  elif code[cp]=="^":dp+=1
  elif code[cp]=="v":dp-=1
  elif code[cp]=="P":print(chr(tape[dp]),end="")
  elif code[cp]=="N":print(tape[dp],end="")
  elif code[cp]=="=":tape[dp+1]=tape[dp]
  elif code[cp]=="+":p=tape[dp+1]+tape[dp];tape[dp]=p;tape[dp+1]=0
  elif code[cp]==")":
    if tape[dp]!=0:
      while code[cp]!="\n":cp-=1
  elif code[cp]=="/":
    if tape[dp]!=0:cp+=1
  elif code[cp]=="↑":
    if c!="":print("claw aready defined");break
    c=tape[dp];tape[dp]=0
  elif code[cp]=="↓":
    if c=="":print("claw undefined");exit()
    tape[dp]=c;c=""
  elif code[cp]=="H":exit()
  elif code[cp]=="G":
      if tape[dp]>0:cp=tape[dp]
      else:...
  elif code[cp]==";":
      try:tape[dp]=int(input())
      except EOFError:print("EOF reached",end="");exit()
  elif code[cp]=="-"and code[cp+1]==">":
    while code[cp]!="\n":cp+=1
  cp+=1
if debug:print("\n",tape,"\npointing at ",dp+1,"\nbytes:"+str(len(code)),sep="")