-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDOCUMENTATION.txt
1360 lines (1318 loc) · 50.8 KB
/
DOCUMENTATION.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{{Lowercase}}
'''backrooms''' uses a 3D memory space that holds a single Extended ASCII character per room “cell”.
It has 10 registers and 2 built in stacks per conscious "thread". Rules “instructions” can be more than one character long.
It also has 5 data types that can be used with the registers and stacks.
Data can be stored across multiple rooms and can be read as instructions during run-time or be re-read into data.
== About ==
{| class="wikitable"
!About
|-
| Author
| Charles McMarrow
|-
| User
| [[User:Ch44d]]
|-
| Conceived
| 5/22/2021
|-
| Birthday
| 8/16/21
|}
{| class="wikitable"
!Official Interpreter
|-
| '''pip install backrooms'''
|-
| https://github.com/cmcmarrow/backrooms
|}
{| class="wikitable"
!Inspiration
|-
| Backrooms Creepypasta/MEME
|-
| [[AsciiDots]]
|-
| CISC Architecture
|}
{| class="wikitable"
!Backrooms is designed to be:
|-
| Hackable VIA memory overflow attacks and poor error handling.
|-
| Visually pleasing.
|-
| Enjoyable to write small/medium programs.
|-
| Capable of rewriting all of a program at run-time.
|}
== Programs ==
=== Hello World ===
~GATE
/rs"Hello World!"e~ha
=== bottles ===
~GATE
/ri10ibri99>ers" bottles of beer on the wall, "epers" bottles of beer."epzez-V
/V".llaw eht no reeb fo selttob "srepe" ,dnuora ti ssap dna nwod eno ekaT"sr.<
/e>e~ha 1 >rs"1 bottle of beer on the wall, 1 bottle of beer."epers"Take one"epV
/pp p pVe".llaw eht no reeb fo selttob erom on ,dnuora ti ssap dna nwod "sr<
/ze . p>peers"No more bottles of beer on the wall, no more bottles of beer"V
/>...eezd-N^.^ e
/ ^".llaw eht no reeb fo selttob 99 ,erom emos yub dna erots eht ot oG"srepe"."srp<
=== [[truth-machine]] ===
# 1 will echo forever and 0 will echo a single time.
# Any other input will default to a 1.
~GATE
/cicOvZVpri1V
/ p >.e>NV~ha
/ >ri1e^e<
=== fibonacci ===
~GATE
/V ah~<
/>ri0>dri18isZ^pdrs"FIB"V
/ ^+pe" "srpech......<
~FIB
/>ZVdri3isLVpd-rs"FIB"hcz--rs"FIB"hciahr
/rh<rh1irpp<
=== tic tac toe ===
~GATE
/>ri0>...+dri10isNVpprs"x"k0pri10ibrs"Tic Tac Toe!"epepri0V
/. . p a >p+....>dri9isNVpprs"E_BOARD"hcrs"Cats!"ep...V
/. . d h >..rs"C_BOARD"hcZ^rs"E_BOARD"hceprs" won!"epri10ibeppVpebi01ir<
/. ^..hujbz"k"sr< ~ ^................huch"DRAOB_U"sr< .
/^...........................p^Zeb"a"srcpe+ >>+srpebi01irpe+!niaga yalp ot "a" retnE+sr<
# Echo board
~E_BOARD
/>ri10ibrs"#"s1epes2epes3epzezeeeeezezs4epes5epes6epzezeeeeezezs7epes8epes9eppephr
# Update board
~U_BOARD
/>rs"rs+"s0bjrs"+k"bjV >pbjrs"prs+"bjs0rs"x"beZVprs"o">bjrs"+k0p">bjhr
/ Vpe0sch"DRAOB_E"sr<.pebi01irpe"RORRE"srpp^Nib"123456789"sr< >prs"x"^
/ >rs": "epcdri10ibeprs"1~2~3~4~5~6~7~8~9"biZVpdrs"s"zbjuh..^
/ ^....ebi01irpe"RORRE"srpp<
# Check for winner
~C_BOARD
/V >ppzphr
/>s5ds1beNVpd.....V >beN^ppp..V >ppzphr
/ >pds9beZVphr ^oupp< 3 V..ppp^Neb<
/ >pds3beNVpd.....V . >ppuo^
/ >pds7beZVphr V+....<pppp^Nebou..hujbz"s"srai3ir<
/ 2 >ppri0>dri3isNVpprs""hr z
/ >rs"s"zbjuh..uobeN^pppp>d+....drs"s"z1pbjuh..zri3iadrs"s"zbjuh..^
/ ^+z..hujbz"s"srd+z..hujbz"s"srd+mi3ird<
=== 8 bit ===
~GATE
/V >p~ha
/>ri512>Z^rs"READ"hcrs"INC"hcbjV
/ ^-pebi01irpejbjbjbjbjbjb<
~READ
/>V
~INC
/V>ri0k0pV >p...V >p...V >p...V >p...V >p...V >p...V >p...V rhp<
/. >2>1wri0s0Z^pV>2>1wri0s0Z^pV>2>1wri0s0Z^pV>2>1wri0s0Z^pV>2>1wri0s0Z^pV>2>1wri0s0Z^pV>2>1wri0s0Z^pV>2>1wri0s0Z^pV
/. ^................ch"PILF"sr<^................ch"PILF"sr<^................ch"PILF"sr<^................ch"PILF"sr<
/. rhp<^................ch"PILF"sr<^................ch"PILF"sr<^................ch"PILF"sr<.
/>rs"READ"hcri1k0rs"FLIP"hc..............................................................................^
~FLIP
/>iaZV-ZVri0hr
/ d r
/ h i
/ r 1
/ h
/ r
=== dynamic ===
~GATE
/rs"Vrs+hello!+epri10ibep"ri47ri0ri0ri0ri-1ri0ud
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/
/ >~ha
== Rules ==
The rules "instructions" do not care if they are read up, down, left, right, etc, as long as the order of characters matches the rules signature. If a character does not match a rule backrooms will run NOP.
{| class="wikitable"
!Name
!Signatrue
!Action
!Example
|-
| style="vertical-align: top"| <code><nowiki>BackMirror</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>\</nowiki></span></code>
| style="vertical-align: top"| Changes Vector based off the direction the conscious comes from.
* <1, 0, 0> -> <0, -1, 0>
* <0, -1, 0> -> <1, 0, 0>
* <-1, 0, 0> -> <0, 1, 0>
* <0, 1, 0> -> <-1, 0, 0>
| style="vertical-align: top"|
~GATE
/\ >~ha
/>....\.....<
/ . .
/ \.....^
|-
| style="vertical-align: top"| <code><nowiki>BranchLessThanZero</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>L</nowiki></span></code>
| style="vertical-align: top"| Sets branch condition to LESS_THAN_ZERO.
|-
| style="vertical-align: top"| <code><nowiki>BranchGreaterThanZero</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>G</nowiki></span></code>
| style="vertical-align: top"| Sets branch condition to GREATER_THAN_ZERO.
|-
| style="vertical-align: top"| <code><nowiki>BranchZero</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>Z</nowiki></span></code>
| style="vertical-align: top"| Sets branch condition to ZERO.
|-
| style="vertical-align: top"| <code><nowiki>BranchNotZero</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>N</nowiki></span></code>
| style="vertical-align: top"| Sets branch condition to NOT_ZERO.
|-
| style="vertical-align: top"| <code><nowiki>BranchIsInteger</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>I</nowiki></span></code>
| style="vertical-align: top"| Sets branch condition to IS_INTEGER.
|-
| style="vertical-align: top"| <code><nowiki>BranchIsString</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>S</nowiki></span></code>
| style="vertical-align: top"| Sets branch condition to IS_STRING.
|-
| style="vertical-align: top"| <code><nowiki>BranchIsNone</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>O</nowiki></span></code>
| style="vertical-align: top"| Sets branch condition to IS_NONE.
|-
| style="vertical-align: top"| <code><nowiki>BranchIsStackFrame</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>F</nowiki></span></code>
| style="vertical-align: top"| Sets branch condition to IS_STACK_FRAME.
|-
| style="vertical-align: top"| <code><nowiki>BranchIsStackBottom</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>B</nowiki></span></code>
| style="vertical-align: top"| Sets branch condition to IS_STACK_BOTTOM.
|-
| style="vertical-align: top"| <code><nowiki>Cite</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>c</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[input, ...]
* <nowiki>Gets input from user and removes all characters not in <INPUT_CHARACTER>.</nowiki>
|
~GATE
/ce~ha
|-
| style="vertical-align: top"| <code><nowiki>ClearStack</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>n</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[]
* Clears the Stack of all data.
|
~GATE
/ri44rs"cats"ne~ha
Output
StackBottom
|-
| style="vertical-align: top"| <code><nowiki>CoordinateX</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>x</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[x, ..]
* Gets conscious current x coordinate.
|-
| style="vertical-align: top"| <code><nowiki>CoordinateY</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>y</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[y, ..]
* Gets conscious current y coordinate.
|-
| style="vertical-align: top"| <code><nowiki>CoordinateFloor</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>f</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[floor, ..]
* Gets conscious current floor coordinate.
|-
| style="vertical-align: top"| <code><nowiki>Decrement</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>-</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ..]
* results = to_integer(item) - 1
* Subtract one to the item on top of the stack.
|
~GATE
/ri40-e~ha
Output
39
|-
| style="vertical-align: top"| <code><nowiki>Duplicate</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>d</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[item, item, ...]
* Copy the top item on the stack and place the copy onto the stack.
|
~GATE
/ri10depe~ha
Output
1010
|-
| style="vertical-align: top"| <code><nowiki>Echo</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>e</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[item, ...]
* Print the item on top of the stack onto the console.
|
~GATE
/e~ha
|-
| style="vertical-align: top"| <code><nowiki>ForwardMirror</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>/</nowiki></span></code>
| style="vertical-align: top"| Changes Vector based off the direction the conscious comes from.
* <1, 0, 0> -> <0, 1, 0>
* <0, 1, 0> -> <1, 0, 0>
* <-1, 0, 0> -> <0, -1, 0>
* <0, -1, 0> -> <-1, 0, 0>
| style="vertical-align: top"|
~GATE
/.....V
/ . /.~ha
/ . .
/ /./.../
/ . .
/ . .
/ >./
|-
| style="vertical-align: top"| <code><nowiki>HallwayCall</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>hc</nowiki></span></code>
| style="vertical-align: top"| WS[hallway, ...] -> WS[...]
* to_hallway(hallway)
* Jumps to a hallway on the same floor.
* Saves registers onto the Function Stack.
* If StackBottom is in a register it will be replaced by None when put on the Function Stack.
* The return location and current vector will also be saved onto the Function Stack.
| style="vertical-align: top"|
~GATE
/ri3ri4rs"ADD"hc~ha
~ADD
/iaephr
Output
7
|-
| style="vertical-align: top"| <code><nowiki>HallwayLevelCall</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>hl</nowiki></span></code>
| style="vertical-align: top"| WS[hallway, floor, ...] -> WS[...]
* to_hallway(hallway), to_floor(floor)
* Jumps to a hallway on any floor.
* Saves registers onto the Function Stack.
* If StackBottom is in a register it will be replaced by None when put on the Function Stack.
* The return location and current vector will also be saved onto the Function Stack.
| style="vertical-align: top"|
~GATE
/ri3ri4rs"math"rs"ADD"hl~ha
+math
~ADD
/iaephr
Output
7
|-
| style="vertical-align: top"| <code><nowiki>HallwayReturn</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>hr</nowiki></span></code>
| style="vertical-align: top"|
* Restores registers.
* Jump back to return location.
* Restore vector.
|-
| style="vertical-align: top"| <code><nowiki>HallwayGetName</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>hn</nowiki></span></code>
| style="vertical-align: top"| WS[hallway, floor, ...] -> WS[name, ...]
* to_integer(hallway), to_floor(floor)
* If no name exist None will be given back.
* The exact coordinates must be given.
|
~GATE
/fyhne~ha
Output
GATE
|-
| style="vertical-align: top"| <code><nowiki>HallwayGetLocation</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>hg</nowiki></span></code>
| style="vertical-align: top"| WS[hallway, floor, ...] -> WS[y_location, ...]
* to_floor(floor)
* If hallway is not a String then it will to_integer.
* If no name exist None will be given back.
* As long as the y coordinate is with in the hallway the hallway location will be found.
* If coordinates are not in a hallway then None will be given back.
|
~GATE
/frirs"Hallway"hge~ha
~Hallway
/
Output
-1
|-
| style="vertical-align: top"| <code><nowiki>HallwaySet</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>hs</nowiki></span></code>
| style="vertical-align: top"| WS[hallway, floor, name, ...] -> WS[...]
* to_integer(hallway), to_floor(floor)
* If name is not None then it will to_string.
* Name must fit <NAME>.
* Will make a hallway and remove the hallway with the same name on the same floor if it exists.
|-
| style="vertical-align: top"| <code><nowiki>HallwayRemove</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>hd</nowiki></span></code>
| style="vertical-align: top"| WS[hallway, floor, ...] -> WS[...]
* to_hallway(hallway), to_floor(floor)
* Will remove the specified hallway.
|-
| style="vertical-align: top"| <code><nowiki>HallwayPast</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>hp</nowiki></span></code>
| style="vertical-align: top"| WS[hallway, floor, ...] -> WS[y_location, ...]
* to_hallway(hallway), to_floor(floor)
* Will get the past hallway.
* If no past hallway exist then None will be given.
|
~GATE
/fyhpe~ha
~Hallway
/
Output
-1
|-
| style="vertical-align: top"| <code><nowiki>HallwayNext</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>he</nowiki></span></code>
| style="vertical-align: top"| WS[hallway, floor, ...] -> WS[y_location, ...]
* to_hallway(hallway), to_floor(floor)
* Will get the next hallway.
* If no next hallway exist then None will be given.
|
~Hallway
/
~GATE
/fyhee~ha
Output
0
|-
| style="vertical-align: top"| <code><nowiki>Halt</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>~ha</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will stop the program.
|
~GATE
/~ha
|-
| style="vertical-align: top"| <code><nowiki>HopOne</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>1</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will hop over one room.
|
~GATE
/1^~ha
|-
| style="vertical-align: top"| <code><nowiki>HopTwo</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>2</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will hop over two rooms.
|
~GATE
/2^^~ha
|-
| style="vertical-align: top"| <code><nowiki>HopThree</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>3</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will hop over three rooms.
|
~GATE
/3^w^~ha
|-
| style="vertical-align: top"| <code><nowiki>HopFour</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>4</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will hop over four rooms.
|
~GATE
/4^^^^~ha
|-
| style="vertical-align: top"| <code><nowiki>HopFive</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>5</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will hop over five rooms.
|
~GATE
/5^OwO^~ha
|-
| style="vertical-align: top"| <code><nowiki>HopSix</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>6</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will hop over six rooms.
|
~GATE
/6^^^^^^~ha
|-
| style="vertical-align: top"| <code><nowiki>HopSeven</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>7</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will hop over seven rooms.
|
~GATE
/7^^^^^^^~ha
|-
| style="vertical-align: top"| <code><nowiki>HopEighth</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>8</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will hop over eighth rooms.
|
~GATE
/8^^^^^^^^~ha
|-
| style="vertical-align: top"| <code><nowiki>HopNine</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>9</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will hop over nine rooms.
|
~GATE
/9^^^^^^^^^~ha
|-
| style="vertical-align: top"| <code><nowiki>Increment</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>+</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* results = to_integer(item) + 1
* Add one to the item on top of the stack.
|
~GATE
/ri40+e~ha
Output
41
|-
| style="vertical-align: top"| <code><nowiki>IntegerCast</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ic</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* Intgerer -> Integer
* String -> Integer | None
* None -> None
* StackFrame -> None
* StackBottom -> None
|
~GATE
/rs"+12"ice~ha
Output
12
|-
| style="vertical-align: top"| <code><nowiki>IntegerAdd</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ia</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[results, ...]
* results = item + item2
|
~GATE
/ri3ri4iae~ha
Output
7
|-
| style="vertical-align: top"| <code><nowiki>IntegerSubtract</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>is</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[results, ...]
* results = item - item2
|
~GATE
/ri3ri4ise~ha
Output
-1
|-
| style="vertical-align: top"| <code><nowiki>IntegerMultiply</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>im</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[results, ...]
* results = item * item2
|-
| style="vertical-align: top"| <code><nowiki>IntegerDivide</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>id</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[results, ...]
* results = ⌊item / item2⌋
* results = None if operation causes a divide by zero.
|-
| style="vertical-align: top"| <code><nowiki>IntegerModular</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>io</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[results, ...]
* results = item % item2
* results = None if operation causes a divide by zero.
|-
| style="vertical-align: top"| <code><nowiki>IntegerPower</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ip</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[results, ...]
* results = ⌊item ** item2⌋
|-
| style="vertical-align: top"| <code><nowiki>IntegerByte</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ib</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* if to_integer(item) can be made into an Extended ASCII then that Extended ASCII character will be the results as a String.
* if to_integer(item) can't be made into an Extended ASCII then the results will be a None.
|
~GATE
/ri67ibe~ha
Output
c
|-
| style="vertical-align: top"| <code><nowiki>IntegerAbsolute</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>il</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* results = |to_integer(item)|
|
~GATE
/ri-44ile~ha
Output
44
|-
| style="vertical-align: top"| <code><nowiki>LevelGetFloorName</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ln</nowiki></span></code>
| style="vertical-align: top"| WS[floor_location, ...] -> WS[name, ...]
* to_integer(floor_loaction)
|-
| style="vertical-align: top"| <code><nowiki>LevelGetFloorLevel</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ll</nowiki></span></code>
| style="vertical-align: top"| WS[floor_name, ...] -> WS[f_location, ...]
* to_string(floor_name)
* If floor can't be found the f_location will be None.
|-
| style="vertical-align: top"| <code><nowiki>LevelSetFloorName</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ls</nowiki></span></code>
| style="vertical-align: top"| WS[floor_name, floor_location, ...] -> WS[...]
* to_string(floor_name) must fit <NAME>.
* to_integer(floor_loaction)
|-
| style="vertical-align: top"| <code><nowiki>NOP</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>.</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* No operation.
* Any time Backrooms cant find a rule Backrooms falls back to NOP.
|-
| style="vertical-align: top"| <code><nowiki>Keep</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>k</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[item, ...], R<DIGIT>: item
* Copy's the top item on the stack into the specific register.
|
~GATE
/ri4k3ps3e~ha
Output
4
|-
| style="vertical-align: top"| <code><nowiki>Pop</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>p</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[...]
* Pops the top item on top of the stack.
|-
| style="vertical-align: top"| <code><nowiki>PopFrame</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>a</nowiki></span></code>
| style="vertical-align: top"| WS[..., ...] -> WS[...]
* Pops items from the stack till a StackFrame or StackBottom is popped.
|
~GATE
/ri4rfrs"cats"ri1ri-9ae~ha
Output
4
|-
| style="vertical-align: top"| <code><nowiki>Read</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>r</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[item, ...]
* "ri" will try to read in an integer. If an invalid integer is found nothing will be placed onto the stack.
* "rs" will try to read in an String. If the String is never close then Backrooms will never stop running the rule.
* "rn" will load None onto the stack.
* "rf" will load StackFrame onto the stack.
|
~GATE
/ri-44e~ha
Output
-44
~GATE
/rs@STRING@e~ha
Output
STRING
~GATE
/rne~ha
Output
None
~GATE
/rfe~ha
Output
StackFrame
|-
| style="vertical-align: top"| <code><nowiki>ShifterRight</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>></nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will set the current consciences vector to <1, 0, 0>
* If the Signature is repeated Immediately. The rule when enter fast mode.
* If the rule is in fast mode it will keep take steps till it hits another shifter.
* If the rule is in fast mode and sees "!" it will skip the next shift.
* If the rule is in fast mode "!" can stack.
* Shifter will only shift if the branch condition is meet.
* Shifters will always set the branch condition to Clear after checking it.
|
~GATE
/V
/>......V
/ >......~ha
~GATE
/ri0.N.V.Z.V
/ >~ha
~GATE
/....>>...!.!..V....^...V
/ >~ha
|-
| style="vertical-align: top"| <code><nowiki>ShifterLeft</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki><</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will set the current consciences vector to <-1, 0, 0>
* If the Signature is repeated Immediately. The rule when enter fast mode.
* If the rule is in fast mode it will keep take steps till it hits another shifter.
* If the rule is in fast mode and sees "!" it will skip the next shift.
* If the rule is in fast mode "!" can stack.
* Shifter will only shift if the branch condition is meet.
* Shifters will always set the branch condition to Clear after checking it.
|-
| style="vertical-align: top"| <code><nowiki>ShifterUp</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>^</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will set the current consciences vector to <0, 1, 0>
* If the Signature is repeated Immediately. The rule when enter fast mode.
* If the rule is in fast mode it will keep take steps till it hits another shifter.
* If the rule is in fast mode and sees "!" it will skip the next shift.
* If the rule is in fast mode "!" can stack.
* Shifter will only shift if the branch condition is meet.
* Shifters will always set the branch condition to Clear after checking it.
|-
| style="vertical-align: top"| <code><nowiki>ShifterDown</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>v</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will set the current consciences vector to <0, -1, 0>
* If the Signature is repeated Immediately. The rule when enter fast mode.
* If the rule is in fast mode it will keep take steps till it hits another shifter.
* If the rule is in fast mode and sees "!" it will skip the next shift.
* If the rule is in fast mode "!" can stack.
* Shifter will only shift if the branch condition is meet.
* Shifters will always set the branch condition to Clear after checking it.
|-
| style="vertical-align: top"| <code><nowiki>ShifterDownUpper</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>V</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will set the current consciences vector to <0, -1, 0>
* If the Signature is repeated Immediately. The rule when enter fast mode.
* If the rule is in fast mode it will keep take steps till it hits another shifter.
* If the rule is in fast mode and sees "!" it will skip the next shift.
* If the rule is in fast mode "!" can stack.
* Shifter will only shift if the branch condition is meet.
* Shifters will always set the branch condition to Clear after checking it.
|-
| style="vertical-align: top"| <code><nowiki>ShifterUpper</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>{</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will set the current consciences vector to <0, 0, 1>
* If the Signature is repeated Immediately. The rule when enter fast mode.
* If the rule is in fast mode it will keep take steps till it hits another shifter.
* If the rule is in fast mode and sees "!" it will skip the next shift.
* If the rule is in fast mode "!" can stack.
* Shifter will only shift if the branch condition is meet.
* Shifters will always set the branch condition to Clear after checking it.
|-
| style="vertical-align: top"| <code><nowiki>ShifterLower</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>}</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will set the current consciences vector to <0, 0, -1>
* If the Signature is repeated Immediately. The rule when enter fast mode.
* If the rule is in fast mode it will keep take steps till it hits another shifter.
* If the rule is in fast mode and sees "!" it will skip the next shift.
* If the rule is in fast mode "!" can stack.
* Shifter will only shift if the branch condition is meet.
* Shifters will always set the branch condition to Clear after checking it.
|-
| style="vertical-align: top"| <code><nowiki>Store</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>s</nowiki></span></code>
| style="vertical-align: top"| R<DIGIT>: item, WS[...] -> WS[item, ...], R<DIGIT>: item
* Copy's the item in specific register and put it on the Working Stack.
|-
| style="vertical-align: top"| <code><nowiki>StringLength</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>bl</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* results = len(to_string(item))
|
~GATE
/rs"cats"ble~ha
Output
4
|-
| style="vertical-align: top"| <code><nowiki>StringCast</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>bc</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* results = to_string(item)
|
~GATE
/rnbce~ha
Output
None
|-
| style="vertical-align: top"| <code><nowiki>StringAt</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ba</nowiki></span></code>
| style="vertical-align: top"| WS[at, item, ...] -> WS[results, ...]
* results = to_string(item)[to_integer(at)]
* If at is out of index results will be None.
* at can be negative and read the string backwards.
|
~GATE
/rs"cats"ri1bae~ha
Output
a
|-
| style="vertical-align: top"| <code><nowiki>StringByte</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>bb</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* to_string(item)
* Gets the Extended ASCII Integer for the first characters from the String.
* If the String is empty then results will be None.
|
~GATE
/rs"c"bbe~ha
Output
67
|-
| style="vertical-align: top"| <code><nowiki>StringSplit</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>bs</nowiki></span></code>
| style="vertical-align: top"| WS[at, item, ...] -> WS[front, back, ...]
* to_integer(at) to_string(item)
* If at is out of index the front or back will just be empty.
* at can be negative and split the string backwards.
|
~GATE
/rs"12345"ri2bseprs" "epe~ha
Output
12 345
|-
| style="vertical-align: top"| <code><nowiki>StringJoin</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>bj</nowiki></span></code>
| style="vertical-align: top"| WS[back, front, ...] -> WS[results, ...]
* results = to_string(front) + to_string(back)
|
~GATE
/rs"cats"rs" 0w0"bje~ha
Output
cats 0w0
|-
| style="vertical-align: top"| <code><nowiki>StringEqual</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>be</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[results, ...]
* to_string(item) == to_string(item2)
* results is 1 if Strings are equal.
* results is 0 if Strings are not equal.
|
~GATE
/rs"cats"rs"cats"bee~ha
Output
1
|-
| style="vertical-align: top"| <code><nowiki>StringEqual</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>bi</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[results, ...]
* to_string(item) in to_string(item2)
* results is 1 if item is in item2.
* results is 0 if item is not in item2.
|
~GATE
/rs"cats"rs"%^*&cats$"bie~ha
Output
1
|-
| style="vertical-align: top"| <code><nowiki>StringUpper</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>bu</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* to_string(item).upper()
* Will put the String into upper form.
|-
| style="vertical-align: top"| <code><nowiki>StringLower</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>bo</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* to_string(item).lower()
* Will put the String into lower form.
|-
| style="vertical-align: top"| <code><nowiki>StringReverse</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>br</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[results, ...]
* to_string(item).reverse()
* Will reverse the string.
|-
| style="vertical-align: top"| <code><nowiki>Switch</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>z</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[item, item2, ...]
* Will switch the top two items on the Working Stack.
|-
| style="vertical-align: top"| <code><nowiki>ThreadThread</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>tt</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will make a new conscious and copy registers, Working Stack, location and vector.
* The new conscious will get a ID that it not in use.
|
~GATE
/ttrs"cats"e.~ha
Output
catscats
|-
| style="vertical-align: top"| <code><nowiki>ThreadJoin</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>tj</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will terminate the conscious but not the program.
* The main conscious thread 0 wont terminate if it encounters this rule.
* If the conscious holds the ThreadLock it will be release.
|
~GATE
/ttrs"cats"etje.~ha
Output
catscatscats
|-
| style="vertical-align: top"| <code><nowiki>ThreadID</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ti</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[ID, ...]
* Will put the conscious ID on to the Working Stack.
|-
| style="vertical-align: top"| <code><nowiki>ThreadLock</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>tl</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will claim the ThreadLock if available if not the conscious will wait.
* A conscious can claim the ThreadLock multiple times which will stack.
|
~GATE
/tttlrs"cats"eprs"0w0"etutj~ha
Output
cats0w0cats0w0
|-
| style="vertical-align: top"| <code><nowiki>ThreadUnLock</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>tu</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[...]
* Will unlock a single thread lock if conscious has the lock.
|-
| style="vertical-align: top"| <code><nowiki>UncommonReadFlip</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ur</nowiki></span></code>
| style="vertical-align: top"| WS[...] -> WS[item, ...]
* Works just like the rule Read but after the read the rule will go back to the start and inverse the conscious vector.
* "uri" will try to read in an integer. If an invalid integer is found nothing will be placed onto the stack.
* "urs" will try to read in an String. If the String is never close then Backrooms will never stop running the rule.
* "urn" will load None onto the stack.
* "urf" will load StackFrame onto the stack.
|
~GATE
/1Vuri44
/ >e~ha
Output
44
|-
| style="vertical-align: top"| <code><nowiki>UncommonWriteFlip</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>uw</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[...]
* Works just like the rule Write but after the write the rule will go back to the start and inverse the conscious vector.
|
~GATE
/ri44.1Vuw
/ >e~ha
Memory
ri44.1Vuw>1vuri44
>e~ha
~GATE
/rs"cats".1Vuw$
/ >e~ha
Memory
rs"cats".1Vuw$>1vurs$cats$
>e~ha
|-
| style="vertical-align: top"| <code><nowiki>UncommonHotPatch</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>uh</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[...]
* to_string(item)
* Will write the data into the room cells after the rule.
|
~GATE
/rs"rs+cats+e"uh.............~ha
Memory
rs"rs+cats+e"uhrs+cats+e....~ha
|-
| style="vertical-align: top"| <code><nowiki>UncommonSimpleDump</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>us</nowiki></span></code>
| style="vertical-align: top"| WS[floor, y, x, item ,...] -> WS[...]
* to_floor(floor) to_integer(x) to_string(item)
* Will to_hallway(y) if y is not an Integer.
* Will write the data starting out the location <x, y, floor> given. The write vector is the current conscious vector.
|-
| style="vertical-align: top"| <code><nowiki>UncommonDynamicDump</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>ud</nowiki></span></code>
| style="vertical-align: top"| WS[v_floor, v_y, v_x, floor, y, x, item, ...] -> WS[...]
* to_integer(v_floor) to_integer(v_y) to_integer(v_x) to_floor(floor) to_integer(x) to_string(item)
* Will to_hallway(y) if y is not an Integer.
* Will write the data starting out the location <x, y, floor> given using the given vector <x_v, y_v, floor_v>.
|-
| style="vertical-align: top"| <code><nowiki>UncommonDoubleDuplicate</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>uo</nowiki></span></code>
| style="vertical-align: top"| WS[item2, item, ...] -> WS[item2, item, item2, item, ...]
* Will duplicate the first two items on top of the Working Stack.
|-
| style="vertical-align: top"| <code><nowiki>Write</nowiki></code>
| style="vertical-align: top"| <code><span style="color:red"><nowiki>w</nowiki></span></code>
| style="vertical-align: top"| WS[item, ...] -> WS[...]
* Will write the item into rooms and the next rule will be after the last write.
* If item is StackBottom item will become None.
|
~GATE
/ri44w.....~ha
Memory
ri44wri44.~ha
~GATE
/rs"cats"w+........~ha
Memory
rs"cats"w+rs+cats+~ha
~GATE
/rnw+........~ha
Memory
rnwrn.......~ha
~GATE
/rfw.........~ha
Memory
rfwrf.......~ha
|}
'''Convert Functions'''<br>
'''to_integer'''
{| class="wikitable"
!From
!To
|-