REGH
Jump to navigation
Jump to search
REGH (Random Esolang Goes Here) is an esoteric programming language created by User:Cleverxia.
Syntax
It's generated by the following python program:
def spec(sed): t=['add %d to the cell under pointer', 'substract %d from the cell under pointer', 'add %d to the pointer', 'substract %d from pointer', 'multiply %d to the cell under pointer', 'divide %d from the cell under pointer', 'modulo %d from the cell under pointer', 'clear the cell under pointer', 'push from stack to queue', 'push from stack to cell', 'push from queue to stack', 'push from cell to stack', 'push from cell to queue', 'push from queue to cell', 'jump %d instructions forward', 'jump %d instructions backward', 'jump %d instructions forward if current cell is %d', 'jump %d instructions forward if current cell is >=%d', 'jump x instructions backward where x is current cell', 'jump to the previous %c', 'jump to the previous %c if current cell >=%d', 'jump to the next %c', 'jump to the next %c if current cell >=%d', 'input to cell','output to cell'] from random import randint,shuffle,seed r,s=randint,shuffle seed(sed) T=t f=[chr(i)for i in range(33,127)] s(f) def g(f,z): p=T[r(0,len(t)-1)] q=f[z] a1,a2=r(0,255),r(0,255) #print(p) if p.count('%c'):return'%s %s'%(q,([p%(ord(q),a1)][0]if p.count('%d')else[p%ord(q)][0])) else:return'%s %s'%(q,(p%(a1,a2)if p.count('%d')==2 else(p%a1 if p.count('%d')else p))) return'\n'.join([g(f,i)for i in range(r(15,25))]) a='' try:a=input() except:a='This is not a QUINE'*10+'K$I@(*FWUCPRWO{FIS}WRF"GRG' a=10**20+hash(a) print('Seed: '+a) print(spec(a))
It also prints the internal seed.
Example programs
With input 'a'
Seed: 104580486437404859896 C push from queue to cell y clear the cell under pointer z add 200 to the cell under pointer ` jump 136 instructions forward E modulo 84 from the cell under pointer ^ add 209 to the pointer 6 jump 166 instructions forward if current cell is >=82 n jump 185 instructions backward P jump to the next P if current cell >=167 d multiply 233 to the cell under pointer b push from queue to cell Y jump 235 instructions forward if current cell is 17 D push from queue to cell 3 clear the cell under pointer W push from cell to stack o divide 3 from the cell under pointer : jump to the next : ; add 207 to the cell under pointer T jump x instructions backward where x is current cell . push from queue to cell 4 push from stack to cell ? jump to the next ? | jump 28 instructions forward # push from cell to queue
With input 'abcdefghijklmnopqrstuvwxyz'
Seed: 96230173013605888330 { add 23 to the cell under pointer ; jump 64 instructions forward if current cell is 12 I jump to the next I 5 jump to the next 5 if current cell >=187 i push from cell to stack S jump to the previous S if current cell >=202 [ output to cell h push from queue to stack B jump 87 instructions forward if current cell is >=71 j push from cell to stack p jump to the previous p if current cell >=220 * jump 145 instructions backward P jump 40 instructions backward M add 83 to the pointer Z jump 132 instructions backward E jump 45 instructions forward if current cell is >=226 C input to cell < jump 124 instructions forward if current cell is 98 _ modulo 13 from the cell under pointer O add 76 to the cell under pointer t add 107 to the pointer 4 add 249 to the cell under pointer
With input 'brainfuck'
Seed: 98799906572967967935 D clear the cell under pointer k jump to the previous k if current cell >=228 4 divide 39 from the cell under pointer u jump 204 instructions forward + jump x instructions backward where x is current cell Q clear the cell under pointer & substract 122 from pointer ! jump to the next ! if current cell >=238 8 jump to the previous 8 h modulo 57 from the cell under pointer ' jump 9 instructions forward if current cell is 13 @ jump x instructions backward where x is current cell - jump to the next - if current cell >=235 d modulo 29 from the cell under pointer y jump 250 instructions forward if current cell is >=183
With no input
Seed: 92011690251192381199 k push from cell to queue W push from queue to stack 6 jump to the next 6 if current cell >=117 V jump 69 instructions forward if current cell is >=26 $ push from stack to queue 0 substract 248 from pointer ' jump to the next ' if current cell >=25 w divide 15 from the cell under pointer f jump x instructions backward where x is current cell | jump to the next | I substract 56 from pointer o push from stack to queue i push from cell to queue - push from cell to stack ( jump 219 instructions forward if current cell is 255 U output to cell # push from cell to stack N modulo 199 from the cell under pointer
Computational class
Depends on the input, it can be Total, a FSM, a PDM, or TC,
The category "Turing complete" is being added to random pages without proof. Does this page need a "Meta-language" tag? ColorfulGalaxy's CA discoveries (talk) 12:26, 25 November 2024 (UTC)