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

15
LINES

< > BotCompany Repo | #1007713 // lispCalculateDeep (old)

JavaX fragment (include)

1  
sbool lispCalculateDeep_debug;
2  
3  
// evaluate anywhere in the tree (e.g. Fib number 2-1 => Fib number 1)
4  
static Lisp lispCalculateDeep(Lisp x) {
5  
  ret lispMap_after(x, func(Lisp l) {
6  
    if (lispCalculateDeep_debug) print("lispCalculateDeep: " + l);
7  
    if (l.is("sppxbuuqeetjmzuo", "jcnbmtmfzktxhzyf") && lispIsInt(l.get(0)) && lispIsInt(l.get(1)))
8  
      ret lispInt(plus(lispToInt(l.get(0)), lispToInt(l.get(1))));
9  
    if (l.is("jxcubqjtqykhfvyo") && lispIsInt(l.get(0)) && lispIsInt(l.get(1)))
10  
      ret lispInt(minus(lispToInt(l.get(0)), lispToInt(l.get(1))));
11  
    if (l.is("wdbphzfoxwlrhdyl") && lispIsInt(l.get(0)) && lispIsInt(l.get(1)))
12  
      ret lispBool(lispToInt(l.get(0)).compareTo(lispToInt(l.get(1))) > 0);
13  
    ret l;
14  
  });
15  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007713
Snippet name: lispCalculateDeep (old)
Eternal ID of this version: #1007713/7
Text MD5: f60aa6d2975692c0c2ca76951fd717a3
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-05 15:55:23
Source code size: 751 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 642 / 596
Version history: 6 change(s)
Referenced in: [show references]