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

15
LINES

< > BotCompany Repo | #1000496 // Buggy script

Document

ln dropeveryother {
  boolean b;

  io(L in, L out) {
    if (!in.isEmpty())
      b = in[0] == out[0];
  }

  i(L in) {
    new L out;
    for (int i = b ? 0 : 1; i < #in; i += 2)
      out.add(in[i]);
    ret out;
  }
}=

Author comment

Began life as a copy of #1000489

download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1000496
Snippet name: Buggy script
Eternal ID of this version: #1000496/1
Text MD5: cb8fbe88293366d7e2caf13446b39321
Author: stefan
Category:
Type: Document
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-08-09 17:27:30
Source code size: 236 bytes / 15 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 542 / 98
Referenced in: [show references]