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

36
LINES

< > BotCompany Repo | #1016718 // Sock Puppet [Dyn Module]

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

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

!7

sclass SockPuppet > DynCalculatedList {
  new L<S> dialog; // user, bot, user, bot...

  void start {
    onUserUtterance(voidfunc(S s) {
      addUserUtterance(s)
    });
    onBotUtterance(voidfunc(S s) {
      addBotUtterance(s)
    });
  }

  void addUserUtterance(S s) {
    synchronized(dialog) {
      if (odd(l(dialog))) dialog.add("");
      add(dialog, s);
      updateMe();
      scrollDown();
    }
  }
  
  void addBotUtterance(S s) {
    synchronized(dialog) {
      if (even(l(dialog))) dialog.add("");
      add(dialog, s);
      updateMe();
      scrollDown();
    }
  }

  L<S> calc() {
    ret dialog;
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016718
Snippet name: Sock Puppet [Dyn Module]
Eternal ID of this version: #1016718/4
Text MD5: e1e284c8fc3c43c7267fe05bb58ea593
Transpilation MD5: 6df9d7cc3535c54c62b71a779919724c
Author: stefan
Category:
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-29 16:04:30
Source code size: 667 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 362 / 1090
Version history: 3 change(s)
Referenced in: [show references]