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

29
LINES

< > BotCompany Repo | #1025600 - Counter in Philosophy Engine [OK]

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

Uses 788K of libraries. Click here for Pure Java version (6169L/30K).

!7

cmodule PhilosophyBot2 extends DynPrintLog {
  transient int i;
  
  transient S program = [[
    count

    count => proc {
      while (i < 100):
        inc i
    }
  ]];
  
  transient new PhilosophyBot1 bot;

  start-thread {
    bot.program = program;
    bot.addNativePredicate("i < 100",
      () -> i < 100);
    bot.addNativePredicate("inc i",
      () -> {
        ++i;
        print("Incremented i to " + i);
        true;
      });
    bot.run();
  }
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1025600
Snippet name: Counter in Philosophy Engine [OK]
Eternal ID of this version: #1025600/6
Text MD5: 2a14e4989c07a337e226b29f5f301cdf
Transpilation MD5: cc816d7cdf8aa16eda5d74a1024ad5bc
Author: stefan
Category:
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-07 13:47:43
Source code size: 469 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 10 / 584
Version history: 5 change(s)
Referenced in: [show references]