1 | ln dropeveryother { |
2 | boolean b; |
3 | |
4 | io(L in, L out) { |
5 | if (!in.isEmpty()) |
6 | b = in[0] == out[0]; |
7 | } |
8 | |
9 | i(L in) { |
10 | new L out; |
11 | for (int i = b ? 0 : 1; i < #in; i += 2) |
12 | out.add(in[i]); |
13 | ret out; |
14 | } |
15 | }= |
Began life as a copy of #1000489
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: | 646 / 136 |
Referenced in: | [show references] |