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

35
LINES

< > BotCompany Repo | #1009831 // "Every Day Bot" [dev.]

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

Download Jar. Uses 4489K of libraries. Click here for Pure Java version (13878L/98K).

!7

static Web web;
static Canvas canvas;

svoid initWeb { web.node("Every day"); }

p-subst {
  web = persistentObject("Web", Web);
  web.useCLParse = false;
  web.onNewLabel.add(voidfunc(WebNode node, O label) {
    processNode(node);
    change();
  });
  initWeb();
  
  canvas = showCAL(webToCAL(web), 650, 450);
  calcOnConceptChanges(1000, r { canvas = showCAL(webToCAL(web), canvas) }, false);
  botWithCommandList("Every Day Bot.");
}

answer {
  if "every day *" {
    web.relation("Every day", "I should", $1);
    ret "OK";
  }
  if "clear" { web.clear(); change(); initWeb(); ret "OK"; }
  if "add day *" { web.node($1).addLabel("Day"); ret "OK"; }
  if "process" { web_processAllNodes(web); ret "OK"; }
}

svoid processNode(WebNode node) { if (node.hasLabel("Day")) processDay(node); }
svoid processDay(WebNode day) {
  web_copyForwardRelations(web, "Every day", day, "I should");
}

Author comment

Began life as a copy of #1009821

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1009831
Snippet name: "Every Day Bot" [dev.]
Eternal ID of this version: #1009831/22
Text MD5: d431bb49e582275c17401da72529ad95
Transpilation MD5: 51c920d699e28154ad92643dcec6dada
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-21 15:33:14
Source code size: 930 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 743 / 1643
Version history: 21 change(s)
Referenced in: [show references]