User:Tokigun/malbolge.mgl

From Esolang
Jump to navigation Jump to search
// Malbolge Interpreter in Migol 09.
// 2009-06-11 Kang Seonghoon
// This program is placed in the public domain, just like the original one.

100<53,101<122,102<93,103<38,104<103,105<113,106<116,107<121,108<102,109<114
110<36,111<40,112<119,113<101,114<52,115<123,116<87,117<80,118<41,119<72
120<45,121<90,122<110,123<44,124<91,125<37,126<92,127<51,128<100,129<76
130<43,131<81,132<59,133<62,134<85,135<33,136<112,137<74,138<83,139<55
140<50,141<70,142<104,143<79,144<65,145<49,146<67,147<66,148<54,149<118
150<94,151<61,152<73,153<95,154<48,155<47,156<56,157<124,158<106,159<115
160<98,161<57,162<109,163<60,164<46,165<84,166<86,167<97,168<99,169<96
170<117,171<89,172<42,173<77,174<75,175<39,176<88,177<126,178<120,179<68
180<108,181<125,182<82,183<69,184<111,185<107,186<78,187<58,188<35,189<63
190<71,191<34,192<105,193<64

0<-59049

1<[@], #<190?<[1], #<96?=[1]
2<[1]<$-9, #<125?<[2]
2<$-5, #<96?<[2]
2<$-18, #<125?<[2], #<96?=[2]
2<$-95, #<125?>=[2]
2<[1]<$+[0]<$+59049<$%94
2<$-4,  #<164?=[2]
2<$-1,  #<164?=[2]
2<$-18, #<164?=[2]
2<$-16, #<164?=[2]
2<$-1,  #<164?=[2]
2<$-22, #<164?=[2]
2<$-6,  #<164?=[2]
2<$-13, #<164?=[2]
'E>,'r>,'r>,'o>,'r>,':>,' >,'i>,'n>,'v>,'a>,'l>,'i>,'d>,' >
'c>,'h>,'a>,'r>,'a>,'c>,'t>,'e>,'r>,' >,'i>,'n>,' >,'t>,'h>,'e>,' >
'c>,'o>,'d>,'e>,'.>,10>, #<326
3<[0]<$+59249, [3]<[1], 0<$+1, #<96?<[0]
'E>,'r>,'r>,'o>,'r>,':>,' >,'t>,'o>,'o>,' >,'l>,'o>,'n>,'g>,' >
'c>,'o>,'d>,'e>,10>, #<326

1<[0]<$+59249, 2<[1]<$-1, 7<[[2]], 2<$-1, 8<[[2]], 9<[#]<$+2, #<256, [1]<[10], 0<$+1, #<190?<[0]

0<0, 1<0, 2<0
3<[1]<$+200, 4<[[3]]<$-33, #<326?<[4], 5<[4]<$-94, #<326?>=[5], 5<[[3]]<$+[1]<$%94
5<$-4, #<213?<>[5], 1<[2]<$+200<[[1]], #<250
5<$-1, #<218?<>[5], 5<[0]<$&255, [5]>, #<250
5<$-18, #<223?<>[5], 0<[@], 0<59048?<[0], #<250
5<$-16, #<230?<>[5], 5<[2]<$+200, 6<[[5]]<$/3, 0<[[5]]<$%3<$*19683<$+[6], [5]<[0], #<250
5<$-1, #<234?<>[5], 2<$+200<[[2]], #<250
5<$-22, #<244?<>[5], 5<[2]<$+200, 7<[0], 8<[[5]], 9<[#]<$+2, #<256, 0<[10], [5]<[10], #<250
5<$-6, #<247?<>[5], #<250
5<$-13, #<250?<>[5], #<326
3<[1]<$+200, 4<[[3]]<$+67<[[4]], [3]<[4], 1<$+1<$%59049, 2<$+1<$%59049, #<203

10<0
11<[7]<$%3, 12<[8]<$%3<$*3, 7<$/3, 8<$/3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3, 10<$+[12]
11<[7]<$%3, 12<[8]<$%3<$*3, 7<$/3, 8<$/3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3<$*3, 10<$+[12]
11<[7]<$%3, 12<[8]<$%3<$*3, 7<$/3, 8<$/3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3<$*9, 10<$+[12]
11<[7]<$%3, 12<[8]<$%3<$*3, 7<$/3, 8<$/3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3<$*27, 10<$+[12]
11<[7]<$%3, 12<[8]<$%3<$*3, 7<$/3, 8<$/3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3<$*81, 10<$+[12]
11<[7]<$%3, 12<[8]<$%3<$*3, 7<$/3, 8<$/3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3<$*243, 10<$+[12]
11<[7]<$%3, 12<[8]<$%3<$*3, 7<$/3, 8<$/3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3<$*729, 10<$+[12]
11<[7]<$%3, 12<[8]<$%3<$*3, 7<$/3, 8<$/3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3<$*2187, 10<$+[12]
11<[7]<$%3, 12<[8]<$%3<$*3, 7<$/3, 8<$/3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3<$*6561, 10<$+[12]
11<[7]<$%3, 12<[8]<$%3<$*3, 11<$+[12]<$*2, 12<108609<$>>[11]<$&3<$*19683, 10<$+[12]
#<[9]

Some brief notes:

  • [0], [1], [2] is respectively A, C, D register in Malbolge.
  • Crazy operation routine starts at statement 256: requires [7] and [8], returns the result at [10] and give the flow back at statement [9].
  • Translation table starts at [100]; the actual code starts at [200].