Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

33
LINES

< > BotCompany Repo | #1001794 - Command processor experiment

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2395L/17K/53K).

!752

p {
  makeBot("Get Text Bot.");
  askMyself(loadSnippet("#1001791"));
}

static S answer(S s) {
  new Matches m;
  if (matchStart("get", s, m)) {
    //print("Get! rest: " + quote(m.rest()));
    ret get(m.rest());
  }
  ret null;
}

static S get(S s) {
  new Matches m;
  
  if (match3("transpilation of *", s, m)) {
    S snippetID = m.unq(0);
    ret dropFirstLine(getServerTranspiled(snippetID));
  }
  
  if (matchStart("line * of", s, m)) {
    S text = get(m.rest());
    int lineNr = parseInt(m.unq(0));
    ret getLine(text, lineNr);
  }
  ret null;
}
  
!include #1000619 // get

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1001794
Snippet name: Command processor experiment
Eternal ID of this version: #1001794/1
Text MD5: 0a568a556eb9a990d68d718dae07ce49
Transpilation MD5: 48e2dc985f69af003c5bdafda1b95f36
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-07-28 15:12:31
Source code size: 628 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 424 / 413
Referenced in: [show references]

Formerly at http://tinybrain.de/1001794 & http://1001794.tinybrain.de