1 | static Long ai_search_highestNumber(S term) { |
2 | term += " "; |
3 | long max = Long.MIN_VALUE; |
4 | for (S s : fullIndexedTermsStartingWith(term)) { |
5 | S i = trim(substring(s, l(term))); |
6 | if (isInteger(i)) pcall-short { |
7 | max = max(max, parseLong(i)); |
8 | } |
9 | } |
10 | ret max == Long.MIN_VALUE ? null : max; |
11 | } |
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: | #1012520 |
Snippet name: | ai_search_highestNumber |
Eternal ID of this version: | #1012520/1 |
Text MD5: | 9730d1d881b7d2f5909b21c2dd6035f1 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-12-06 17:38:09 |
Source code size: | 315 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 441 / 491 |
Referenced in: | [show references] |