123 part - kenrube/Esopoly GitHub Wiki

123 is another language from the author of asdf, with even fewer instructions: there are only 3 of them.

Just like asdf, 123 generates a symbol code from individual bits and one instruction prints the entire 8-bit range. After reading the instructions, it's easy to come up with an algorithm for generating the symbol code:

  1. Moving to cell #7: 2222222
  2. If we want to invert the bit, call 1, otherwise 121 (there is no easy way to save the bit value without shifting) and shift to the left
  3. Putting all 8 bits in this way, we'll be in cell #-1
  4. Calling 1, we move still to the left, to cell #-2
  5. We call 2 that prints a character with an ASCII code whose binary representation is in cells 0-7, and will throw us into cell #0
  6. Repeat until readiness ...
  7. Call 1 or 121, setting the current bit to 0, and then 3, which finish the program.

Now it's easy to write the source code (for convenience, the generation of individual bits is divided by |):

2222222|  1|121|121|121|  1|  1|121|121|  1|  2|        print '1' (00110001)
2222222|  1|  1|121|121|121|121|121|121|  1|  2|        print '2' (00110010)
2222222|  1|121|121|121|121|121|121|121|  1|  2|        print '3' (00110011)
2222222|  1|  1|121|121|  1|121|121|121|  1|  2|        print ' ' (00100000)
2222222|121|121|121|121|  1|121|  1|121|  1|  2|        print 'p' (01110000)
2222222|121|  1|121|121|121|121|121|121|  1|  2|        print 'r' (01110010)
2222222|  1|121|  1|  1|  1|121|121|121|  1|  2|        print 'o' (01101111)
2222222|121|121|121|  1|121|121|121|121|  1|  2|        print 'g' (01100111)
2222222|  1|121|  1|121|  1|121|121|121|  1|  2|        print 'r' (01110010)
2222222|  1|  1|121|121|  1|121|121|121|  1|  2|        print 'a' (01100001)
2222222|121|121|  1|  1|121|121|121|121|  1|  2|        print 'm' (01101101)
13

Let's unite all the languages that we have at the moment. Notice that Spoon has given us a lot of 1 instructions, which in 123 are escaped with jump instruction 3: 31 ... 13

DCBA@?\nZ;|38x0SA3tsN`Lo98*G"'&%$#Sc>`v<zLxwI5tWrDpoAm?Oj)Laf8dc\aZ~X|?U=Y;v9ONS54JnHG/jJCBGF(
>b%;_"876Z{321U5.-Qr*N('K%$H(hEf${Abaw=^zs9Zp6Wm3kj0Qglk+voosooooa3o1oo>>o+dosaooooo11ooDo++oo
oasAooooooooo1ooAos+aoooo+oooooo1ASooo+oos[ooooso11oAoooo<oosooooaoo1Aoooo+oooaooooo100ooo++oo
oasoooooooooo10SS32+0oooo+ooooo2o0Aooo+oosooooo3o10oAoo++ooaoooooaoo1Aoooo+oooaooooo11oooo++oo
>aaAooooooooo1oSS-s1aooo]ooooooo1oSoaa<oosoooooso11S.oo>+ooasooooaoo10oooo+oooaSoooo11oooo++So
oosAooooooo32o0SAo2+0oooo+[oooo2o0Aoaa<ooooooooo2200Aoo++ooasooooooo1ooooS+oosaSoooo10oooo++oo
oaaAoooooooo210oAos+ooooo+oooooo1oSooo+oosoooooo2100Aoo>oooosooooaoo10oo-oooooaooo]2100ooooAoo
oa<oooooooo3o1oS.os>ooooo+oooo3o1oSoao+oosooooooo11oAoo++ooasoooo[o21oooo<ooossoooo3110o--oAoo
oosAoooooooooo0oA-o10oo-ooooooooo0Ao>aooosooooosoo0SA-oooooosoo]oa3o10ooo<ooooaoooo211oo-ooAoo
oasooooooooo21oS.os+aoooo+oooooo1oSoaa+oosoooooso110ooo++ooosooooooo1AoooS+oooaooooo100ooo++oo
oaaAoooooooooo0o.oo+0oooo+ooooooo0Aoao+oosoooooso110ooo++ooosooooaoo10o.-Sooooaoooooo00o--oAoo
oaaooooooooooo0SS-so0oo-ooooooooo0Ao-oooosooooooo10oA--ooooaoooooaoo10o.>o+oooaSooooo00ooo++So
oosAooo[<ooooo0SAoo+0oooo+ooooooo0Aoaa+oosoooooso10SAoo++ooosooooaoo10o>-oooooaooo]o200ooooAoo
oa<Aooooooo3o10o.oo>aoooo+oooooo10Sooo+oosooooos3200Aoo++ooosoooo[o2o0ooo<ooooaoooo2200o--oAoo
oosoooooooo3o10SS-o10oo-oooooo32o0Ao>oooosooooo3o100A-oooooaooo]oaoo10ooo<ooooaooooo11oo--oAoo
oaaAooooooooo1oo.32+aoooo+ooooo21oAoaa+oosoooooso11SAoo++ooosooooao21Aoooo+oooaooo3o100ooo++oo
oaaAooooooo3o10S.os>0oooooooooooo0So>a+oosoooooo211oAoo++ooaoooooao21Aoooo+oooaooooo11oooo++oo
oaaAoooooooo210oAo2+aoooo+[oooo210Sooo<oosooooos2o00Aoo++ooosooooaooo0oooo+oooaoooooo00ooo+Aoo
>aaAooooooooo1oSS-s10ooo]ooooo3o1oAooo<oosooooooo100.ooooooaooooo[oo10oo-oooooaooo]o100ooooAoo
oa<oooooooo32o0SSos+aoooo+oooooo10Sooa+ooooooooo2200Aoo++ooosoooooooo0o.oS+oosaSooooo00ooo+Aoo
oaaAoooooooooo0S.-s1ooo-ooooooo210So-aooosoooooo211o.--ooooaoooooao21Aoo-oooooaSoooo100o--oooo
oosooooooooo210SA-s10oo-ooooooo21oAo-aooosoooooso100.oo++ooosooooaoo10oooS+oooaooo3o100ooo++oo
oaaAooooooo32o0oAo2+0oooo+ooooo2o0Aoaa+oosooooos2200ooo++ooosooooao2o0oooS+oooaoooo2200.oooAoo
>osooooooooooo0SSoo+0oooo+oooooo10Aooo+oosooooooo100Aoo+oooaooooo[ooo0ooo<ooooaoooooo00o--oAoo
oosooooooooooo0SS-oo0oo-ooooooooo0Ao>oooosoooooooo00A-oooooaooo]oaooo0ooo<ooooaSooooo00o-ooooo
oosooooooooooo0S.oo+0oooo+ooooooo0Aooo+oosoooooooo00Aoo++<oaoooooaooo0o>oo+oooaoooooo00ooo++oo
oaaooooooooooo0SSos+0oooo+ooooooo0Aooo+oosoooooooo00Aoo+oooasoooooooo0o.oSoooooSooo210oooooAoo
oosAooooooooo10oAo21aooooooooooo1oAoaaooosooooos211SAooooooosooooao21Aooooooooaooooo11oooooAoo
oosooooooooo21oSSo21aoooooooooo21oSoaaooosooooos3100oooooooosooooaoo10oooSooooaooooo100ooooAoo
oaaoooooooooo10SSos1aooooooooooo1oSoaaooooooooooo110Aooooooasoooooooo0oooSoooooSoooo100ooooAoo
oosAoooooooooo0oA321aoooooooooo210Aoaaoooooooooo2200Aooooooasoooooooo0oooSoooooSooooo00ooooAoo
oosAoooooooooo0oAoso0oooooooooooo0Soooooosoooooooo00Aooooooosooooaooo0ooooooooaSooooo0oooooooo
oosoooooooooo10SAoso0oooooooooo2o0Aoaaoooooooooooo00Aooooooosoooooooo0oooSoooooSoooo110ooooAoo
oosAoooooooo21ooAos10oooooooooo2o0Soooooosoooooo2o00Aooooooosooooaooo0ooooooooaooooo10oooooAoo
oasooooooooo210SS3o1aooooooooooo1oSoaaooosoooooso11SAooooooosooooaoo1oooooooooaooooo11oooooooo
ooooooooooooo1ooooo1oooooooooooo1oooooooooooooooo110oooooooooooooo32o0ooooooooooooo210oooooooo
oooooooooooo210ooooo0oooooooooooo0oooooooooooooo210ooooooooooooooooo1oooooooooooooo211oooooooo
oooooooooooo21ooooo1ooooooooooo2oooooooooooooooo22ooooooooooooooooo2ooooooooooooooo22ooooooooo
oooooooooooo2ooooo21oooooooooooo1oooooooooooooooo1ooooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1oooooooooooo1ooooooooooooooo211oooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo2oooooooooooooooo22ooooooooooooooooo2ooooooooooooooo22ooooooooo
oooooooooooo2ooooo21ooooooooooo21oooooooooooooooo1ooooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo21oooooooooooooooo11oooooooooooooooo21ooooooooooooooo11oooooooo
oooooooooooo21ooooo1ooooooooooo2oooooooooooooooo22ooooooooooooooooo2ooooooooooooooo22ooooooooo
oooooooooooo2ooooo21ooooooooooo21oooooooooooooooo11oooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo21oooooooooooooooo1ooooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo21oooooooooooooooo1ooooooooooooooooo2ooooooooooooooo22ooooooooo
oooooooooooo2ooooo2oooooooooooo2oooooooooooooooo221ooooooooooooooooo1oooooooooooooo211oooooooo
ooooooooooooo1ooooo1oooooooooooo1ooooooooooooooo211oooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo2oooooooooooooooo22ooooooooooooooooo2ooooooooooooooo22ooooooooo
oooooooooooo2ooooo21ooooooooooo21oooooooooooooooo1ooooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1oooooooooooo1ooooooooooooooo211oooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo21oooooooooooooooo1ooooooooooooooooo2ooooooooooooooo22ooooooooo
oooooooooooo2ooooo2oooooooooooo2oooooooooooooooo221ooooooooooooooooo1oooooooooooooo211oooooooo
ooooooooooooo1oooo21oooooooooooo1oooooooooooooooo1ooooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo21oooooooooooooooo1ooooooooooooooooo2ooooooooooooooo22ooooooooo
oooooooooooo2ooooo2oooooooooooo2oooooooooooooooo221ooooooooooooooooo1ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo21oooooooooooooooo11oooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo21oooooooooooooooo1ooooooooooooooooo2ooooooooooooooo22ooooooooo
oooooooooooo2ooooo2oooooooooooo2oooooooooooooooo221oooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1oooooooooooo1oooooooooooooooo1ooooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooooo1ooooooooooo21oooooooooooooooo1ooooooooooooooooo21ooooooooooooooo1ooooooooo
oooooooooooo21ooo3oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

As you can see, because of 123 the source code has grown a lot in size. You can check it in the author's interpreter (local copy).

Follow on