#set 0xmin.settings.language("0xmin");#set 0xmin.settings.log_table=1;#def let: os={#let mainPart(){{$set main;move=>0xmin 1;jump->titleScreen;def getOctal;def terminal;$move=>0xmin 1;def titleScreen;def fileSystem;};def getInput_dist1;def clearScreen;{def restart;def hello;def morros;def hi;def clearScreenProgram;def addStuff;};{def addStuff.main.stringData;};jump 0;};let loadExecutables(){#let addStuff=Executable()::{#let endState;#let endTest;def let data=Data();#let stringData;{def let mainLoop_state,mainLoop_state.line;#set stringData=Menu()::{}::{move=>mainLoop_state;jump->mainLoop_state.line;}::{"input\n";":";};#def Menu.goto(stringData);$mainLoop_state=>move;#def mainLoop_state.line;delete mainLoop_state;};def let mainLoop=forever()::{getInput_dist1.call();move=>data.const("\x00");or;{move=> 3;set;null;null};def endTest;};$move=>endState;#set endTest{move=>data.const("h");#def if({xor})::{}::{$endState=>move;jump ->mainLoop..return;};};};#let restart=Executable()::{"\p00restarting... ";#def clearScreen.call(24);move-0xff;move-0xff;move-0xff;move 1;$move=>0xmin 1;jump -> titleScreen;};repeat 0 def let Executable.hault_mid{#let self=..this;#let state;$state=>move;def Executable.hault();#let Executable.hault(){move=>state;jump->self;};};let clearScreenProgram=Executable()::{"clearScreen";def clearScreen.call(24);};#let hello=Executable()::{"Hello World!";};#let morros=Executable()::{"Morros Maulmn!";};#let hi=Executable()::{"Hi mom!";};};let loadMenus(){;#let clearScreen=Function(1)::{#let mainLoop=loop(1)::{" ";};move=>mainLoop.times;set;"\p00";#def mainLoop;"\pff";}{let callBase=call;let call(reps){def let data=Data();#set reps=data.const(1<<(reps-1));#def callBase(reps);};};let titleScreen=Menu=({},{})::{let a=2;"\p00\c0f";def let logoString={"\c0f\/\c050\c04@\c0a$\c0b#\c0f\\\n";"\c0f\\\c05Z\c04A\c0aS\c0bM\c0f\/\n";};"press any key\n";"to continue;\n\n";#def getInput.call();};let getOctal=Function(1)::{def let data=Data();let ans=data.var(1);let i=data.var(1);let startVal=data.var(1);let input{};move=>i;set;move=>ans;set;#let endLoopState,endLoop;#def let mainLoop=forever()::{#let end,endState;let continueIf(condision){def condision;move=>endState;if;jump +2;jump->end;};let continueElse(condision){def condision;move=>endState;if;jump->end;};move=>data.const({!jump +1;});get;move=>getInput.returnStart;set;#def getInput;let inputChar=data.var(0);move=>inputChar;set;{if;null;move=>data.var(~0b111);#def continueIf({and});move=>data.var(0b110000);#def continueElse({xor});};{move=>ans;get;move=>data.const(8);red;move=>ans;set;move=>inputChar;get;if 1;move=>data.const(0b111);and;move=>ans;#def: {}{let then;if;jump -> then;jump -> ..return;#def: then{or;set;};};};{move=>inputChar;get;move=>data.const("\x00");or;move=>keyboard.output;set;};{move=>i;get;if;move=>data.const(8);red;move=>endLoopState;{if;jump+2;jump->endLoop;};move=>i;set;};$set end;$set endState=>move;};$set endLoopState=>move;$set endLoop;move=>ans;get;}{1 #def let defaultInput;let baseCall=call;#set call=#(len){def let data=Data();#def baseCall(data.const(1<<(30-(len*3))));};};let getInput_dist1=Function(0)::{getInput.call();};let getOctal_dist1=Function(1)::{def let data=Data();let length=data.var(0);move=>length;set;getOctal.call(length);};let Folder(size)={#;#def ifDef(!size)::{#set size=8;};#let files;$move=>terminal.returner.startState;@!jump +1 #def let fileSwitch;#let addFile(program){let fileList=arguments;#set files{jump->program;};};#def files;#set this(){};};let terminal=Menu({},{jump 0})::{#def let: data=Data();"run program:";#let returner{let startState,endState;};#let Folder_enterState;#let Folder_enterState;let fileSystem;#def let mainLoop=forever()::{"\n";"file num 0-7 :";{#def getOctal.call(1);move=>data.const({0 1}..compile[0]);red;move=>data.const({jump}..compile[0]);or;};"\n";let progAddress=data.var(0);move=>progAddress;set;move=>progAddress;get;{let statement=Folder_enterState;move=>statement;set;null;jump->Folder_enterState;$set returner;$set returner.startState=>move;$set returner.endState=>move;};};}#{let Folder_enterState=..this.main.Folder_enterState;let returner=..this.main.returner;};let Executable(block)={#;let exe_address;#set: return = Menu({$set move=>Executable.returner.startState;},Executable.hault(),block)#{let address=exe_address;};#set fileSystem.addFile(block);}{let hault(){move=>Executable.returner.startState;jump->Executable.returner;};let returner=terminal.returner;let fileSystem;};let fileSystem=Folder(4)#{$set terminal.Folder_enterState=>..this;};#set titleScreen.exit{Menu.goto(terminal)};};import lib "io.0xmin";let keyboard=terminal;#let: types(){#let: Type(size,otherProperties){#set: return(val){#set: return = val;};#set: return{...let set: otherProperties;};#let: return.size = size;};let int30 = Type(1)::(){};let pointer = Type(1)::(){};};...def types;#let: macros(){let ifDef(condision,then,else){let bool=condision;#let callers;repeat (!(!(!(!(+bool))&&then))): #set caller{...set then();};repeat (!(!(!(+bool)&&else))): #set caller{...set else();};};let if(condision,then,else)={#let state;let bool=condision;if;null;def condision;$set state=>move;if;jump->then;def else;#def ifDef(else)::(){jump->..return;};$set move=>state;def then;};};...def macros;#let: classes(){let LinkedList(itemSize)={1 #def let tail;let base()={#def let last{1};#def let first{1};};let item()={!move base-> this;#def let last{!move->lastItem;!jump->lastItem+1;};#def let next{!move->firstItem;!jump->firstItem+1;};#def let portal{move->;jump->data;};#def let data{};};};let Data()={delete;jump->..this..return;#let def: consts;#let def: vars;#let: var(val)={#set: vars{#def: val;};#set: return=val;};#let: const(val)={let isFound=0;#let i=0;repeat (consts..length*(+isFound==0)):{#set isFound = #((+consts[+i][1]) == (+val));#set i=i+1;};repeat (+isFound==0):#set: consts{$set def: val;};repeat (+isFound==1):#set val=consts[i-1][1];#set: return=val;};#let: remove(label){#set: ..this{$ram=>label;};};};let forever(do)={#let state,endState,endLoopState;$set state=>move;#def do;$endLoopState=>move;move=>state;jump->this;$set endState=>move;};let min(a,b){#set return=#(a<b) * a + ((a>=b) *b);};let max(a,b){#set return=#(a>b) * a + ((a<=b) *b);};let sleep(time){let minLen=wait.loopLen;let innerLoopLen=wait.innerLen;repeat time null;repeat 0: def defIf(time>minLen)::{def loop()};}{let emptyLoop=loop(1,"");let innerLen=emptyLoop.mainLoop..length;let loopLen=..length;};let loop(times,do){def let data=Data();...let data;let i=var(0);#let times=const(1<<(times-1));move=>times;get;move=>i;set;#def let:mainLoop{#let state;$set state=>move;#def do;move=>i;get;move=>const(2);if;null;blue;move=>i;set;move=>state;if;jump->..this;jump->..return;};};#let: Function(inputLength,block)={let enterState,exitState;$set enterState=>move;def block;move=>ram;$set exitState=>move;jump 0#def let returnStart;let self=this;let call(){let doReturn=!(!(1));let returnStatement,returnEnd;#set ifDef(doReturn)::(){move=>returnStatement;get;move=>returnStart;set;};let args=arguments;let len=min(inputLength,args..length);#set ifDef(len)::(){#let i=0;repeat (len-1) #{move=>args[+i];get;move=>block.input[+i][0];set;#set i=i+1;};move=> args[+i];get;};{move=>enterState;jump->block;$move=>exitState;repeat 0 {$jump=>returnStart;$jump->returnEnd;$jump=>0;};!jump returnStart->returnEnd#def returnStatement;#def returnEnd;};}};def let hault(){let hault={jump 0;};move=>hault;get;move -> 0xmin 0;set;"\c0f\n";jump -> 0xmin 0;def hault;};let Menu(enter,exit,main)={#;let enter=enter,exit=exit,main=main;let enter.state;let exit.state;let a2=2;$set enter.state=>move;@;#def enter;#def main;#def exit;move=>ram;$set exit.state=>move;}{let goto(menu){move=>menu.enter.state;jump->menu.main;};};};...def classes;#let getInput=Function(0)::{let setWait(bool){repeat(+bool):{move=>isWait;get;move=>waitLine;set;};repeat(1-bool):{move=>isNotWait;get;move=>waitLine;set;};};let waitLine;let confirm;let isWait,isNotWait;#def set checkResponse{let start,end;$start=>move;move=>confirm;get;if 1;move=>keyboard.input;xor;move=>start;if;jump->..this#def waitLine;$end=>move;};delete checkResponse;def let recieveInput{move=>keyboard.input;"\a" #def confirm;repeat 8 or;};def let cleanInput{def let data=Data();let chars=#{"\a\x00"}..compile;let keyboard.inputTag=data.const(chars[0]|chars[1]);move=>keyboard.inputTag;xor;};};...loadMenus;...loadExecutables;def mainPart();};