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

16
LINES

< > BotCompany Repo | #1030386 - ackermann_int_vstackComputable

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2788L/18K).

srecord ackermann_int_vstackComputable(int a, int b) implements VStack.Computable<Int> {
  public void step(VStack stack, O subComputationResult) {
    if (subComputationResult == null) {
      if (a == 0)
        stack._return(b+1);
      else if (b == 0) {
        a--;
        b = 1;
      } else
        stack.push(new ackermann_int_vstackComputable(a, b-1));
    } else {
      a--;
      b = subComputationResult/Int;
    }
  }
}

download  show line numbers  debug dex   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1030386
Snippet name: ackermann_int_vstackComputable
Eternal ID of this version: #1030386/3
Text MD5: 4106f0b33f6ba2c1fba33ed811fcd985
Transpilation MD5: 3501dc432eb2453989dbe45a3e126e58
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-12-10 20:32:10
Source code size: 450 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 26 / 59
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1030386 & http://1030386.tinybrain.de