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

44
LINES

< > BotCompany Repo | #1025938 // Philosophy Bot Text Area v2 [with logic rules list]

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

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

1  
!7
2  
3  
cmodule PhilosophyBotTextArea > DynTextArea {
4  
  S output, logicRules;
5  
  transient PhilosophyBot1 bot;
6  
  transient ReliableSingleThread rstRunProgram = dm_rst(this, r runProgram);
7  
  transient JLabel lblStatus;
8  
  transient ReliableSingleThread rstLogicRules = dm_rst(this, r showLogicRules);
9  
  
10  
  visual jvsplit(
11  
    jCenteredSection("Program", super),
12  
    centerAndSouth(
13  
      jhsplit(
14  
        jCenteredSection("Output", dm_textArea_scrollDown_readOnly output()),
15  
        jCenteredSection("Logic rules",
16  
          dm_textArea_scrollDown_readOnly logicRules())
17  
      ),
18  
      withRightMargin(lblStatus = jRightAlignedLabel())));
19  
  
20  
  start {
21  
    grabInterval = 1.0;
22  
    dm_watchFieldAndNow text(rstRunProgram);
23  
  }
24  
  
25  
  void runProgram {
26  
    temp tempMiniLoadingAnim();
27  
    time {
28  
      setField(output := hijackPrint(r {
29  
        pcall {
30  
          bot = new PhilosophyBot1(text);
31  
          bot.onLogicRuleAdded.add(rule -> rstLogicRules.run());
32  
          bot.standardImports();
33  
          bot.run();
34  
          bot.checkExpectations();
35  
        }
36  
      }));
37  
    }
38  
    main setText(lblStatus, lastTiming_formatted());
39  
  }
40  
  
41  
  void showLogicRules {
42  
    setField(logicRules := joinWithEmptyLines(allToString(cloneList(bot.logicRules)));
43  
  }
44  
}

Author comment

Began life as a copy of #1025777

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1025938
Snippet name: Philosophy Bot Text Area v2 [with logic rules list]
Eternal ID of this version: #1025938/9
Text MD5: cca068e175925663a37d171435316684
Transpilation MD5: 6b132a29c08e63ceb988624f120f5ea3
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-01 13:33:33
Source code size: 1283 bytes / 44 lines
Pitched / IR pitched: No / No
Views / Downloads: 147 / 1341
Version history: 8 change(s)
Referenced in: [show references]