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

34
LINES

< > BotCompany Repo | #1001325 // Heart (loud)

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

Libraryless. Click here for Pure Java version (1344L/9K/31K).

!747

m {
  static volatile long beatCount;
  static volatile int delay = 1000;
  static long booted;
  static volatile boolean loud = true;
  
  p {
    booted = now();
    readLocally("beatCount");
    makeAndroid3("Heart.");
    print("Beat count " + beatCount + ". Beating at 1/" + delay + " ms...");
    
    while (true) {
      if (loud)
        print("beep!");
      ++beatCount;
      saveLocally("beatCount");
      sleep(delay);
    }
  }
  
  static synchronized S answer(S s, L<S> history) {
    if (match3("get beat count", s))
      return "" + beatCount;
    if (match3("get delay", s))
      return "" + delay;
    if (match3("booted when", s))
      return "" + booted;
      
    return null;
  }
}

Author comment

Began life as a copy of #1001324

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, dhtvkmknsjym, gwrvuhgaqvyk, ishqpsrjomds, jmyaexzvplwz, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001325
Snippet name: Heart (loud)
Eternal ID of this version: #1001325/1
Text MD5: d8ec4390a0cbf937d37387e8665ab04f
Transpilation MD5: 880df359f56a63c61f589682eaa73093
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-11 00:52:49
Source code size: 750 bytes / 34 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 669 / 1322
Referenced in: #1001327 - Kill & zip a bot
#1001341 - Kill, zip & upload a bot
#1001342 - Data of #1001325 on teubizvjbppd at 1444494742313
#1001343 - Data zip of #1001325 on teubizvjbppd at 1444494887177
#1001344 - Data zip of #1001325 on teubizvjbppd at 1444494991094
#1001351 - Kill, zip, upload & MOVE a bot
#1001358 - Jumping Heart (jumps between two machines)
#3000037 - Data zip of #1001325 on teubizvjbppd at 1444495149312
#3000038 - Data zip of #1001325 on dhtvkmknsjym at 1442178592972
#3000039 - Data zip of #1001325 on teubizvjbppd at 1444514320275
#3000040 - Data zip of #1001325 on teubizvjbppd at 1444514376767
#3000041 - Data zip of #1001325 on teubizvjbppd at 1444514883604
#3000042 - Data zip of #1001325 on dhtvkmknsjym at 1442179442504
#3000043 - Data zip of #1001325 on teubizvjbppd at 1444516952406
#3000044 - Data zip of #1001325 on teubizvjbppd at 1444517519805
#3000190 - Answer for stefanreich(>> t 20 questions)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)