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

40
LINES

< > BotCompany Repo | #1022077 // Gazelle Things Lister [Demo]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (4474L/24K).

1  
!7
2  
3  
cmodule GThingsLister > DynPrintLog {
4  
  GModuleInfo gInfo;
5  
  
6  
  S ruleID = 'invcwuqfdjvuloyv; // take fulfillments from there
7  
  S varName = "toes";
8  
  
9  
  LS thingsNotYetSaid, thingsSaid = syncList();
10  
  
11  
  start {
12  
    if (thingsNotYetSaid == null)
13  
      thingsNotYetSaid = asSyncList(gazelle_varFulfillments(varName, ruleID));
14  
  }
15  
  
16  
  S giveMeOne() {
17  
    if (empty(thingsNotYetSaid)) {
18  
      dm_gazelle_stopThisModule();
19  
      ret "I don't know any more body parts...";
20  
    }
21  
    S s = removeRandom(thingsNotYetSaid);
22  
    thingsSaid.add(s);
23  
    ret s + "!";
24  
  }
25  
  
26  
  S answer(S s) {
27  
    if "ok|cool|yes|good|next one please|yo|ack"
28  
      ret giveMeOne();
29  
    null;
30  
  }
31  
  
32  
  S initialAnswer(O... _) {
33  
    S s = [[I'll list body parts for you. Say "done" or "stop" to quit.]] + "\n";
34  
    if (empty(thingsNotYetSaid)) {
35  
      s += "Sadly, I don't know any body parts";
36  
      dm_gazelle_stopThisModule();
37  
    } else s += "Here is one: " + giveMeOne();
38  
    ret s;
39  
  }
40  
}

Author comment

Began life as a copy of #1021930

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022077
Snippet name: Gazelle Things Lister [Demo]
Eternal ID of this version: #1022077/25
Text MD5: 8c2c2490c93d699dc68039e72a03d072
Transpilation MD5: d18f42d0f1e871327dd2f60453bbe36f
Author: stefan
Category: javax / gazelle
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-11 12:32:25
Source code size: 1006 bytes / 40 lines
Pitched / IR pitched: No / No
Views / Downloads: 305 / 922
Version history: 24 change(s)
Referenced in: [show references]