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

14
LINES

< > BotCompany Repo | #1012656 // tripleIndexOf

JavaX fragment (include)

static <A> int tripleIndexOf(T3<A> t, A a) {
  if (t == null) ret -1;
  if (eq(t.a, a)) ret 0;
  if (eq(t.b, a)) ret 1;
  if (eq(t.c, a)) ret 2;
  ret -1;
}

static <A> int tripleIndexOf(A a, A b, A c, A x) {
  if (eq(a, x)) ret 0;
  if (eq(b, x)) ret 1;
  if (eq(c, x)) ret 2;
  ret -1;
}

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: #1012656
Snippet name: tripleIndexOf
Eternal ID of this version: #1012656/4
Text MD5: 57a9d20837270f67654bbc687754721d
Author: stefan
Category: javax / structures
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-10 00:39:03
Source code size: 302 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 403 / 422
Version history: 3 change(s)
Referenced in: [show references]