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

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   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

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: 287 / 400
Version history: 21 change(s)
Referenced in: [show references]

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