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

11
LINES

< > BotCompany Repo | #1012845 // ai_all_threeInARow

JavaX fragment (include)

static LL<S> ai_all_threeInARow(S base) {
  Map<BigInt, S> map = ai_search_allNumbered_asMap(base);
  L<BigInt> l = keysList(map);
  new LL<S> out;
  for (int i = 0; i+2 < l(l); i++) {
    BigInt a = l.get(i), b = l.get(i+1), c = l.get(i+2);
    if (eq(plus(a, 1), b) && eq(plus(a, 2), c))
      out.add(ll(map.get(a), map.get(b), map.get(c)));
  }
  ret out;
}

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: 499 / 500
Version history: 1 change(s)
Referenced in: [show references]