Libraryless. Click here for Pure Java version (1692L/12K/40K).
//TODO: // //Add more features. //Add + and > signs // !752 p{ makeBot("Code generator."); } answer{ if (matchStart("make code *",s ,m)) { S command = m.unq(0); S encodedcmmnd = ""; command = command.replace("make code", ""); if(command == null){ ret null; } if(command.indexOf("newbot") != -1){ encodedcmmnd += [[ ``` !752 p{ makeBot('BOT NAME HERE'); } answer{ ret "hello"; }``` ]]; } if(command.indexOf("ifelifelse") != -1){ encodedcmmnd += " ```if() {\n\n}else if() {\n\n}else{\n\n}``` "; }else if(command.indexOf("ifelse") != -1){ encodedcmmnd += " ```if{\n\n}else{\n\n}``` "; }else if(command.indexOf("if") != -1){ encodedcmmnd += " ```if() {\n\n}``` "; } if(command.indexOf("for") != -1){ encodedcmmnd += " ```for(INIT;TERMINATE;INC;){ //you know what to do,right? RIGHT??\n\n}``` "; } if(command.indexOf("calculator") != -1){ encodedcmmnd += [[ ``` import java.util.Scanner; double n1, n2; String operation; Scanner scannerObject = new Scanner(System.in); System.out.println("Enter first number"); n1 = scannerObject. nextDouble(); System.out.println("Enter second number"); n2 = scannerObject. nextDouble(); Scanner op = new Scanner(System.in); System.out.println("Enter your operation"); operation = op.next(); switch (operation) { case "+": System.out.println("Your answer is " + (n1 + n2)); break; case "-": System.out.println("Your answer is " + (n1 - n2)); break; case "/": System.out.println("Your answer is " + (n1 / n2)); break; case "*": System.out.println("Your asnwer is " + (n1 * n2)); break; default: System.out.println("Dunno"); }```]]; } if(command.indexOf("fibonacci") != -1){ encodedcmmnd += [[``` int febCount = 15; //You can change this. int[] feb = new int[febCount]; feb[0] = 0; feb[1] = 1; for(int i=2; i < febCount; i++){ feb[i] = feb[i-1] + feb[i-2]; } for(int i=0; i< febCount; i++){ System.out.print(feb[i] + " "); } ```]]; } //ntUpload(programID(), programID() + " generated code", encodedcmmnd); Uncomment this later ret encodedcmmnd; } }
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, jlatgrcjtklg, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment