REG.TYPE = STR TRUE

From Esolang
Jump to navigation Jump to search

REG.TYPE = STR TRUE is a esolang (made by User:yayimhere) with a register. but the register is a string. it can be modified copied printed ect. REG.TYPE = STR TRUE or R.T=ST's goal is to see if using only a single unbounded string can there be made a turing complete esolang.

overview

the string starts with the following string inside at the start:

fgr45fevre4er5>1<2u31i<y7<3698yugtkhjsdfbjkgdbøfsopgt50r8y69re8988)()UYHJFCŸŸÂ˜{\ÜÁ»Ü‡\}\}\\}≈{}≈\\˜$¢¢‰‰{\}}≈¿

there is no explicit reason for this. REG.TYPE = STR TRUE & "" will start with a empty string
the register is circular so it wraps around. If a parameter has "" its a full string else its a single char

syntax

the syntax of REG.TYPE=STR TRUE:

Caption text
R.T=ST description pseudocode
+"A" will concatenate A with the register REG concatenate A
[i]"A" replace what's at index i with A REG[i] = A
[i]! replace what's at index i with EOF input REG[i] = input
\(e) start at index 0 and do the operation(s) e on the whole string repeat operation until i has been found at index 0 twice while i < length(REG) do e and i+1
A/(e) start at index 0 and do the operation(s) e on the string until A is met in the string while REG[i] != A do e and i+1
# clear the string REG = ""
"A"->"B" replace all instances of A with B if REG[i] == A do REG[i] = B
o output the register print(REG)
[i]o output whats at index i print(REG[i])
[i]:A save the index i with label A. any i used in any instruction can be replaced with a label A = i
A+= increment index of label A A+1
A-= decrement index of label A A-1
[i]:+ increment the ascii value of the ascii char at index i REG[i]+1
[i]:- decrement the ascii value of the char at index i REG[i]-1
[i]+"A"> add A after index i REG[i] concatenate A
[i]+"A"< add A before index i reverse(REG[i] concatenate A)
; line initial ; will make it comment ?

examples

hello, world!:

#+"Hello, world!"o

truth-machine:

#[0]!0/(o)o

looping counter:

#+"*"A/(o[1]+"*"<+"/n")

quine:

+"+#"[1]-o[1]+o#+"#\2^.p\2^,p $,#Z#\1^;J!)\J^pJ,>*![0)\1^*!\1^!)\J^.J,>*!"[0]:I\([I]oI+=)Z/([0]"")[0]""\([I]-I+=)o

turing completeness

this program emulates the 2-tag system that calculates the Collatz sequence:

;  alphabet: {a, b, c}
;  reserved: {E, B, D, I}
;  a -> bc
;  b -> a
;  c -> aaa
;  initial word: aaa

#+"aaaD"  
;setup

I/(
  ; separate head
  [1]+"B"<
  ; halt if only one char left
  "aBD"->"I"
  "bBD"->"I"
  "cBD"->"I"
  ; apply rules
  "aB"->"bcE"
  "bB"->"aE"
  "cB"->"aaaE"
  ; perform second deletion
  "Ea"->""
  "Eb"->""
  "Ec"->""
  "E"->""
)

with no comments and such:

#+"aaaD"I/([1]+"B"<"aBD"->"I"bBD"->"I""cBD"->"I""aB"->"bcE""bB"->"aE""cB"->"aaaE""Ea"->"""Eb"->"""Ec"->"""E"->"")