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

38
LINES

< > BotCompany Repo | #1007335 // Dialog With Smiley 1 [WORKS]

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

Uses 3874K of libraries. Click here for Pure Java version (7911L/54K/194K).

1  
!7
2  
3  
static Smiley smiley;
4  
5  
svoid initConsole {
6  
  swing {
7  
    veryBigConsole();
8  
    showControls(jCenteredLine(
9  
      jbutton("!happy", r { consoleSend("!happy") }),
10  
      jbutton("!sad", r { consoleSend("!sad") }),
11  
      jbutton("!angry", r { consoleSend("!angry") }),
12  
      jbutton("!random", r { consoleSend("!random") }),
13  
      jbutton("!list", r { consoleSend("!list") })
14  
    ));
15  
  }
16  
}
17  
18  
p-subst {
19  
  bot();
20  
  initConsole();
21  
  clearConsole();
22  
  smiley = new Smiley;
23  
  coActivateFrames(consoleFrame(), smiley.show());
24  
  focusConsole();
25  
  sleepQuietly();
26  
}
27  
28  
answer {
29  
  if (eq(s, "!list"))
30  
    ret join(", ", map(func(S s) { "!" + s }, values(smiley.names)));
31  
  if (startsWith(s, "!")) {
32  
    int i = smiley.emotionToIndex(s);
33  
    if (i != 0) {
34  
      smiley.emotion(i);
35  
      ret "Yo";
36  
    }
37  
  }
38  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007335
Snippet name: Dialog With Smiley 1 [WORKS]
Eternal ID of this version: #1007335/22
Text MD5: 8c3113fcdc31c3bea9be4ec3edee3e51
Transpilation MD5: b148358e900c2bba303d04a41f76c82a
Author: stefan
Category: javax / gui / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-22 22:35:15
Source code size: 832 bytes / 38 lines
Pitched / IR pitched: No / No
Views / Downloads: 467 / 660
Version history: 21 change(s)
Referenced in: [show references]