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

7
LINES

< > BotCompany Repo | #1024709 // oddEntries - entries of list at odd positions (counting from 0)

JavaX fragment (include)

static <A> L<A> oddEntries(L<A> l) {
  int n = l(l)/2;
  L<A> out = emptyList(n);
  for i to n:
    out.add(l.get(i*2+1));
  ret out;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024709
Snippet name: oddEntries - entries of list at odd positions (counting from 0)
Eternal ID of this version: #1024709/3
Text MD5: a7a3fcff45456b8d9121dc700bbcdee6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-01 11:34:10
Source code size: 141 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 235 / 279
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1025010 - evenEntries - entries of list at even positions (counting from 0)