1 | static LL<S> ai_all_threeInARow(S base) { |
2 | Map<BigInt, S> map = ai_search_allNumbered_asMap(base); |
3 | L<BigInt> l = keysList(map); |
4 | new LL<S> out; |
5 | for (int i = 0; i+2 < l(l); i++) { |
6 | BigInt a = l.get(i), b = l.get(i+1), c = l.get(i+2); |
7 | if (eq(plus(a, 1), b) && eq(plus(a, 2), c)) |
8 | out.add(ll(map.get(a), map.get(b), map.get(c))); |
9 | } |
10 | ret out; |
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: | #1012845 |
Snippet name: | ai_all_threeInARow |
Eternal ID of this version: | #1012845/2 |
Text MD5: | 217162610ca2e233f7dbd73c33c47bbf |
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-14 18:41:26 |
Source code size: | 371 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 500 / 502 |
Version history: | 1 change(s) |
Referenced in: | [show references] |