text:
Separate a list into even-indexed and odd-indexed parts
Inspired by this question:
Make a function (or a full program) that receives a list of numbers and outputs the list rearranged, so that even-indexed numbers appear first, and odd-indexed numbers follow. The values of the numbers themselves don't affect ordering - only their indices do. All indices are zero-based.
For example:
Input: [0, 1, 2, 3, 4]
Output: [0, 2, 4, 1, 3]
Another example:
Input: [110, 22, 3330, 4444, 55555, 6]
Output: [110, 3330, 55555, 22, 4444, 6]
Use most natural representation for lists that your language has. There are no limitations on complexity (e.g. allocating a temporary list is OK - no need to do it in-place).
P.S. It should work for the empty list (empty input => empty output).

This is effectively the inverse of the current answers to this question

Can we assume that all list elements are positive or non-negative or something?

@MartinBüttner Assume anything reasonable, maybe even that they are in the range 0...255.

Related

Can we output a comma-separated list?

If it's natural, yes. I wrote "most natural representation", which is kinda vague; I think we have best practices documented somewhere.

Does the operation have to be stable (preserving input order)? Or could I give e.g. 4,2,0,3,1 for the first example?

No, the idea is to keep the order. I didn't mention this explicitly.

Japt, 1 byte
ó

Try it online!

Is this valid??

I had this originally, too. Might be worth asking if the output format is acceptable.

Python, 23 bytes
lambda x:x[::2]+x[1::2]

Try it online

Why lambda? Why not mu or nu? :P

@rayryeng I was only joking as you can see by the ":P" at the end of my comment :)

@ΚριτικσιΛίθος oh :) hah.  Sorry. I couldn't tell... darn Internet language.

Yeah, you definitely should replace lambda by λ and reduce byte count by 5! :P

@anatolyg sounds like an idea for PEP submission!

The rare idiomatic code golf solution!

@ThomasKwa It's the right tool for the job :P

Pyth, 5
o~!ZQ

Try it online, or run a Test Suite
Explanation
o~!ZQ    ## implicit: Z = 0; Q = eval(input)
o   Q    ## sort Q using a supplied function
 ~!Z     ## Use the old value of Z, then set Z to be not Z
         ## This assigns a weight to each number in the list, for example given [0,1,2,3,4]
         ## This will give (value, weight) = [(0,0), (1,1), (2,0), (3,1), (4,0)]
         ## The values are sorted by weight and then by index
         ## This happens because Pyth is written in Python, which performs stable sorts

Genius! Beautiful.

Wait, how does this work?

@justhalf I've added some more explanation, does that clear it up?

CJam, 7 bytes
{2/ze_}

Pushes a block (the closest thing to an unnamed function) which transforms the top stack element as required.
Test it here.
Explanation
The explanation assumes that the top of the stack is the array [0 1 2 3 4]. The actual values don't affect the computation.
2/  e# Split the array into chunks of two: [[0 1] [2 3] [4]]
z   e# Zip/transpose, which works on ragged arrays: [[0 2 4] [1 3]]
e_  e# Flatten the result: [0 2 4 1 3]

Labyrinth, 28 25 24 23 22 bytes
" >
?!?:|}\{@
@\?"":)!

This was mad fun! :) That is by far the most densely compressed Labyrinth program I've written so far. I had so many versions at 20 and 21 bytes which almost worked that I'm still doubting this is optimal...
This takes input as a list of positive integers (with an arbitrary delimiter), and prints the result to STDOUT as linefeed-delimited integers.
The hunt for 20/21 bytes: I've checked all programs of the form
" XX
?!?X}\{@
@\?XX)!

where X is any reasonable character by brute force, but didn't find any valid solutions. Of course that doesn't mean that a shorter solution doesn't exist, but it's not possible to force 20-byte programs without a decent amount of assumptions on its structure.
Explanation
(The explanation is slightly outdated, but I'm still not convinced the solution is optimal, so I'll wait with updating this.)
So, normally Labyrinth programs are supposed to look like mazes. While the instruction pointer is in a corridor, it will follow that corridor. When the IP hits any kind of junction, the direction is determined based on the top value of Labyrinth's main stack (Labyrinth has two stacks, with an infinite amount of zeroes at the bottom). That normally means that any non-trivial loop will be quite expensive, because if you have non-wall cells all over the place everything is a junction, and in most cases the top of the stack won't have the right value for the IP to take the path you would like it to take. So what you do is you enlarge the loops such that they have a whole in the centre with only one well-defined entry and exit point each.
But this time I was really lucky and everything fit so well together, that I could squash it all into one big clump. :)
Control flow starts at the _ going South. The _ pushes a zero onto the main stack. That may seem like a no-op, but this increases the (non-implicit) stack depth to 1 which we'll need later.
? reads an integer from STDIN. If there are no more integers to be read, this pushes zero. In that case, the IP keeps moving South and @ terminates the program right away (because the input list is empty). Otherwise, the IP turns East.
We're now entering a very tight loop with two exit points:
 !?;
 \?
  ;

! prints the integer back to STDOUT, leaving only a zero on the stack. The IP keeps moving East, and ? reads the next integer. If that is non-zero, we take a right and move South. ? reads another one (the next even index). Again, if that is non-zero, we take a right and move West.
Then \ prints a linefeed without changing the stack, so we take another right, moving North. ! prints that next even-index integer. Since now there is at least one (positive) odd-index integer on the stack, we keep turning right and the loop repeats.
Once either of those ? hits the end of the list, they push a zero and move straight onto the corresponding ;, which discards that zero.
In the case that there was only a single element in the list, we're done (because we've printed that right away), so the IP would keep moving East all the way to the @, again terminating the program (printing a trailing linefeed on the way).
Otherwise, we need to print the odd-index integers as well. In that case the two paths (from the two exit points of the first loop) merge on the middle ", turning East in either case.
_ pushes a zero to avoid taking a left into the @, and ; discards that zero. Now we enter a new loop:
     "}
     ""

The IP enters this on the bottom-left cell, moving North, going around the loop in a clockwise sense. The } shifts the top of the main stack over to the auxiliary stack. While there is still an element on the stack, the IP keeps doing its thing. Once everything has been shifted to the auxiliary stack (and reversed in the process), the IP keeps moving East instead, entering the last loop:
       \{@
       #!

\ prints a linefeed again, { moves an item from the auxiliary stack back to main. If that was still an item of the list, it will be positive, and the IP turns South, where the item is printed with !. Then # pushes the stack depth (and now this is where the initial _ is important, because this # ensures a positive stack depth), so that the IP still turns right, through the \ and { again.
After we've printed everything, { pulls a zero from the bottom of the auxiliary stack, the IP continues East, and @ terminates the program.

MATLAB, 24
@(x)x([1:2:end 2:2:end])

similar to the python one.
Thanks @LuisMendo for saving 2 bytes!

Hey! Nice to see you in PPCG!

A little shorter: @(x)x([1:2:end 2:2:end])

@LuisMendo Haha I am a bit scared of codegolf, but this one was so easy  for MATLAB! Thanks for the tip ;)

Haskell, 37 bytes
concat.foldr(\x[l,r]->[x:r,l])[[],[]]

Try it online!
The foldr recursively builds up the even list and odd list. Prepending an element to the list is updated by prepending it to the odd list and calling it the new even list, and calling the previous even list the new odd list. Then, the pair [l,r] is concaternated to l++r.
Thanks to Ørjan Johansen for saving 5 bytes using two-element lists in place of tuples.

42 bytes:
f l=[x|p<-[even,odd],(i,x)<-zip[0..]l,p i]

Adds indices to the list l and filters either the even or the odd ones.

g(a:_:l)=a:(g l)
g l=l
f l=g l++(g$drop 1 l)

Yet another format, for 44. The function g takes every even-indexed element. The odd indices are gotten by first dropping an element, then applying g. If l was guaranteed non-empty, we could safely just do tail for 41
g(a:_:l)=a:(g l)
g l=l
f l=g l++g(tail l)

yet another variant (39 bytes): l#(a:b:c)=a:(l++[b])#c;l#x=x++l;f=([]#) with f being the main function.

@nimi That's a nice solution, you should post it.

No, please include it in your post. It's just a combination of your #2 and #3.

You can save 5 bytes on your second version by using lists and concat instead of tuples and uncurry(++).

J, 8 bytes
/:0 1$~#

This is a monadic (one-argument) verb, used as follows:
  (/:0 1$~#) 110 22 3330 4444 55555 6
110 3330 55555 22 4444 6

Explanation
/:        Sort the input array according to
  0 1     the array 0 1
     $~   repeated enough times to be of length
       #  length of input

An alternative is /:0:`1:\ which is also 8 bytes.

PowerShell v3+, 75 67 49 47 bytes
$l=,@()*2
$args|%{$l[($f=!$f)]+=$_}
$l[0]
$l[1]

Try it online!
Expects input via splatting, as shown on the TIO link.
Creates an matrix $l as an array of arrays, then pipes the input $args into a loop |%{}. Each time through the loop, we add an element to one of the two child arrays of $l by flip-flopping the $f variable using Boolean logic. The first time through, $f is $null, the ! of which is $true, or 1 when indexing into an array. This means the first element gets put into the second array of $l, so that's why $l[1] gets output first.
Props to TessellatingHeckler for the golfing assistance and this variation.
-2 bytes thanks to mazzy.

Caveats
Going strictly as the question is written, this is technically invalid, as PowerShell doesn't have a concept of "lists" as pseudo-immutable objects, only arrays or hash tables (aka dictionaries). So, I'm treating the question's line "Use most natural representation for lists that your language has" as asking about arrays, as that's the closest PowerShell has. Additionally, output is one element per line, since that's the default PowerShell way to write out an array. This means an input of (0,1,2,3,4) will output 0\r\n2\r\n4\r\n1\r\n3\r\n.

47 bytes - $args+splatting instead $input and ,@()*2 instead @(),@()

Jelly, 4 3 bytes
ŒœF

Try it online!
How it works
ŒœF - Main link. Argument: L (a list) e.g.
Œœ  - Odd-even; Group elements at even and odd indices
  F - Flatten

F#, 79 77 56
fun x->List.foldBack(fun x (l,r)->x::r,l)x ([],[])||>(@)

Based on one of the Haskell answer
fun x->x|>List.indexed|>List.partition(fst>>(&&&)1>>(=)0)||>(@)|>List.map snd

We first index the list, then partition it with criteria : first item (the index) anded with 1 equal 0.
That gives us a pair of list of pairs ; first list will contains all indexed evens and the other the indexed odds.
From that we reassemble the two list with append operator and finally discard the index.
Edit : missed an obvious one there is no need to name the arg "xs" (habits) so can reduce to a 1-letter name

I also have a potential 76 bytes one which is basically the same one but defined as function composition. Problem is it doesn't compile as a value but will effectively work with any list argument given so unsure if it's ok or not :
List.indexed>>List.partition(fst>>(&&&)1>>(=)0)>>fun(e,o)->e@o|>List.map snd

Note: List.indexed is only available from F#4.0 despite not being documented in MSDN yet

Cutting-edge technology, cool!

@anatolyg It's fun, isn't it?

I think this is similar to the Perl 6 code that I first tried. -> \xs { xs.pairs.classify( *.key%%2, :as( *.value ) ).map( *.value.Slip ) } Assuming |> in F# is roughly equivalent to the rightward feed operator ==> in Perl 6. I'm also only guessing as to what fst>>(&&&)1>>(=)0 does

JavaScript (ES6), 52 bytes
It also does it in one pass
x=>x.map((v,i)=>x[(i*=2)>=(z=x.length)?i-z+--z%2:i])

F=x=>x.map((v,i)=>x[(i*=2)>=(z=x.length)?i-z+--z%2:i])

input.oninput = setValue;

function setValue() {
  var arr = input.value.match(/\d+/g) || [];
  unsorted.innerHTML = arr.join(', ');
  sorted.innerHTML = F(arr).join(', ');
}

setValue();
* {
  font-family: monospace
}

th {
  text-align: right;
  padding-right: 0.5em;
}
<input id="input" type="text" value="0 1 2 3 4 5 6"/>

    Unsorted:

    Sorted:

You can omit the F= from the beginning; you can save a byte by using this: (i*=2)>=(z=x.length)?i-z+--z%2:i

@CᴏɴᴏʀO'Bʀɪᴇɴ Nice idea thanks!

convey, 16 bytes
{
"\`0
|@&;`}
2}

Try it online!

Get the input { at the top, copy " down and left. The list mod | 2 chooses @ if the elements go down straight into the output } or right into the queue &. After the last element has passed through \, the length n of the list gets pushed to :, where n elements from the queue then gets passed through.

Julia, 23 bytes
i->i[[1:2:end;2:2:end]]

Perl 6, 25 bytes
This is the shortest lambda I could come up with.
{|.[0,2...*],|.[1,3...*]} # 25 byte "Texas" version
{|.[0,2…*],|.[1,3…*]}     # 25 byte "French" version

say {|.[0,2…*],|.[1,3…*]}( ^5 ); # (0 2 4 1 3)␤

say ((0..4),('m'..'q'),(5..9)).map: {|.[0,2…*],|.[1,3…*]}
# ((0 2 4 1 3) (m o q n p) (5 7 9 6 8))␤

# bind it as a lexical sub
my &foo = {|.[0,2…*],|.[1,3…*]}

say foo [110, 22, 3330, 4444, 55555, 6]; # (110 3330 55555 22 4444 6)␤

say [~] foo 'a'..'z' # acegikmoqsuwybdfhjlnprtvxz␤

Japt, 3 bytes
ñÏu

Try it
ñÏu     :Implicit input of array
ñ       :Sort by
 Ï      :Passing the 0-based index of each through a function
  u     :  Modulo 2 of index

ó c

Try it
ó c     :Implicit input of array
ó       :Split into 2 arrays of every 2nd item
  c     :Flatten
        :Implicit output

Husk, 4 bytes
ΣTC2

Try it online!
  C2    # split list into 2-element sublists
 T      # transpose
Σ       # flatten list of lists

Perl 5 -p, 30 bytes
s/\S+\K( \S+)( ?)/$\.=$1;$2/ge

Try it online!
Input and output are space separated.

05AB1E, 2 bytes
ι˜

Try it online!
How it works
ι˜ - Program. Push the input L to the start
ι  - Uninterleave L
 ˜ - Flatten

uninterleave is a great command to have

K (ngn/k), 21 bytes
{t,x^t:x@&(0=2!)'!#x}

Try it online!
Down 2 bytes thanks to ngn
K (ngn/k), 23 bytes
{t:x@&(0=2!)'!#x;t,x^t}

Try it online!
The old solution is kept because of the explanations.
Explanations:
{t:x@&(0=2!)'!#x;t,x^t}  Main function. Takes x as input
             !           Create a range from 0 to
              #x         Length of x - 1
            '            For each number in the range (i)
      (    )             Check if
         2!              i mod 2
       0=                is equal to 0
     &                   Where (get indices of truthy values)
   x@                    x at each indices
 t:             ;        Assigned to variable t
                 t,      t concat with
                   x^t   x without the elements in t

assignments can happen in the middle of an expression: {t,x^t:x@&(0=2!)'!#x}

Fig, \$2\log_{256}(96)\approx\$ 1.646 bytes
fy

Try it online!
fy
 y # Uninterleave
f  # Flatten

Perl, 35 33 bytes
perl -ape 'push@{$|--},$_ for@F;$_="@0 @1"'

31 bytes + 2 bytes for -ap. Reads a space-delimited string from STDIN:
$ echo 0 1 2 3 4 | perl -ape 'push@{$|--},$_ for@F;$_="@0 @1"'
0 2 4 1 3

$ echo 110 22 3330 4444 55555 6 | perl -ape 'push@{$|--},$_ for@F;$_="@0 @1"'
110 3330 55555 22 4444 6

When the input is empty, prints a single space, which I would consider equivalent to an empty list. If not, can be fixed at a cost of 4 bytes with:
perl -anE 'push@{$|--},$_ for@F;$,=$";say@0,@1'

(requires Perl 5.10+, prints a trailing newline)
or at a cost of 5 bytes with:
perl -ape 'push@{$|--},$_ for@F;$_=join$",@0,@1'

(no trailing whitespace)
How it works
This solution uses the -a flag, which splits the input on whitespace and puts the results in the @F array.
The real magic happens in the push:
push@{$|--},$_

The $| variable is normally used to force output flushing, but it has another interesting property: when decremented repeatedly, its value toggles between 0 and 1.
perl -E 'say $|-- for 0..4'
0
1
0
1
0

Taking advantage of the fact that there are no restrictions on identifiers specified via symbolic dereferencing, we alternately push array elements onto the @0 and @1 arrays, so @0 ends up with all the even-indexed elements and @1 with the odds. Then we simply concatenate the stringified arrays to get our output.

Mathematica, 40 bytes
#[[;;;;2]]~Join~If[#=={},#,#[[2;;;;2]]]&

{}[[2;;;;2]] will throw an error.

Burlesque, 12 Bytes
J2ENj[-2EN_+

Usage as in:
blsq ) {0 1 2 3 4}J2ENj[-2EN_+
{0 2 4 1 3}
blsq ) {110 22 3330 4444 55555 6}J2ENj[-2EN_+
{110 3330 55555 22 4444 6}

Explanation:
J     -- duplicate
2EN   -- every 2nd element
j     -- swap
[-    -- tail
2EN   -- every 2nd element
_+    -- concatenate parts

Although once the new update is released you can do this with the new
Unmerge built-in (which does the opposite of the merge ** built-in):
blsq ) {110 22 3330 4444 55555 6}J2ENj[-2EN**
{110 22 3330 4444 55555 6}

K, 10 bytes
{x@<2!!#x}

Based on the 5-byte Pyth answer.

C, 70
Nothing special, just a index mapping function.
a=0;main(int c,int** v){for(c--;a<c;)puts(v[1+a*2%c+!(a++<c/2|c%2)]);}

Less golfed
a=0;
main(int c, int** v) {
  for(c--; a<c;)
    puts(v[1 + a*2%c + !(a++ < c/2 | c%2) ]);
}

APL (Dyalog Unicode), 11 bytes
{⍵[⍒2|⍳≢⍵]}

Alternatively:
{⍵[⍒≠\=⍨⍵]}

Try it online!
Explanation:
{⍵[⍒2|⍳≢⍵]}
      ⍳≢⍵       ⍝ indices from 1 to the length of the input vector.
    2|          ⍝ their divisibility by two; essentially generate 1 0 1 0...
   ⍒            ⍝ grade down: put odd indices first before even indexed indices.
 ⍵[      ]      ⍝ pick from the input

In messing around, trying to understand how your code works, I'm confused by what the indexing is adding. {⍒2|⍳≢⍵} already seems to give the correct result... what am I missing?

@AndrewOgden ⍒ returns the indices that would put into the required order, not the elements themselves. OP requires a reordering of the given list.

A fun solution: ≢⍴∘⍉⊢⍴⍨2,⍨≢ or ≢⍴⊢⍉⍤⍴⍨≢,2⍨ in 18.0.

@Adám Yeah, I know that now, not sure what dataset I was using at the time that had me confused. Thanks for responding though.

JavaScript, 49 bytes
n=>[...(x=f=>n.filter((a,b)=>b%2==f))(0),...x(1)]

Explanation: Creates a list composed of the results of spreading arrays filtered by the index of each element modulo 2.

Ruby, 53 36 30 bytes
->a{i=0
a.sort_by{[i%2,i+=1]}}

Attempt This Online!
Ruby, 24 bytes
This appears to work but could fail in theory because "the ordering of equal elements is indeterminate and may be unstable." Sorting by [i%2,i+=1] above solves this instability.
->a{i=1
a.sort_by{i^=1}}

Attempt This Online!

Elm, 78 bytes
g x y i z=case(z,i)of
 (a::b,_)->g(y++[a])x(1-i)b
 (_,0)->x++y
 _->y++x

g[][]1

Your final case can match _ instead of (_,_), I think.

Vyxal, 3 bytes
y"f

Try it Online!
Uninterleave, pair the results and flatten

Uh, what stops you from doing yJ?

JavaScript (Node.js), 47 bytes
x=>f=i=>1/x[i|i]?[x.splice(i,1)[0],...f(-~i)]:x

Try it online!
JavaScript (Node.js), 50 bytes
x=>(i=a=[]).concat(x.filter(v=>i++%2||!a.push(v)))

Try it online!
Not shortest now but fun

Pyth, 8 bytes
+%2Q%2tQ

Relatively simple

Vitsy, 22 Bytes
Vitsy really wasn't made to do this...
r' 'Vl2/\[N{VO]l\[NVO]
r                       Reverse the implicit numerical input stack.
 ' 'V                   Save the "space" character as a global final variable.
     l2/\[....]         Repeat the stuff in the brackets the length of the input
                        stack divided by 2.
          N{VO          Output the top item of the stack as a number, then shift
                        the stack over once to the left, push a space, output it.
               l\[...]  For the rest of the stack, repeat that many times...
                  NVO   Output the top item of the stack as a number separated
                        by a space.

Go, 92 bytes
func s(l []int) (r []int){for i:=0;i<len(l)*2;i+=2 {r=append(r,append(l,l...)[i])};return}

"Go. at least it's shorter than prolog"
degolf
func s(l []int) (r []int){
   for i:=0;i<len(l)*2;i+=2 {
      r=append(r,append(l,l...)[i])
   }
   return
}

bash and GNU coreutils, 68 bytes
We assume that the list is newline-separated and passed on standard input.
(paste - <(seq 0 5 9999)|tee x|grep 0$;grep 5$<x)|cut -f1|grep -v ^$

Unfortunately this will ignore any inputs beyond index 1999, so it doesn't quite meet the spec.
It also clobbers a hardcoded temporary file ('x'), which could be problematic if run in parallel, and it doesn't remove it afterwards. Sorry about that!

Minkolang 0.12, 15 bytes
$nI2:[i1+g]r$N.

Try it here.
Explanation
$n                 Read in all of input as numbers
  I2:              The length of the stack divided by 2 (n)
     [             Open for loop that repeats n times
      i1+          Loop counter + 1
         g         Gets the (i+1)th item from the stack and puts it on top
          ]        Close for loop
           r       Reverse the stack (for outputting)
            $N.    Output the whole stack as numbers and stop.

Clojure/ClojureScript, 52 bytes
(defn f[l](flatten(map #(take-nth 2 %)[l(rest l)])))

Written in a ClojureScript REPL, should also be valid Clojure.

, 12 chars / 22 bytes (noncompetitive)
Ѩťᶏש,Ѩą(ï,2⸩

Try it here (Firefox only).
Just switched to Lodash, which has way more functions. Thus, this answer is rendered noncompetitive.

R, 49 bytes
q<-function(x)c(x[seq(x)%%2==1],x[seq(x)%%2==0])

Call it as q(blah). Or, if x already contains the list to be rearranged, then
c(x[seq(x)%%2==1],x[seq(x)%%2==0])

is just 35 bytes.

function(x,y=!seq(!x)%%2)c(x[!y],x[y]) is 38 bytes (and will work for input that's empty/length one)

F#, 64
fun x->List.mapi(fun i l->l,i%2)x|>List.sortBy snd|>List.map fst

Inspired by Sehnsucht's answer (but not enough rep to comment).
Maps each value to a tuple where the second entry is the modulo of the list index, sorts by modulo, then maps back to the original value.

Prolog, 103 bytes
r([E,O|T],[E|A],[O|B]):-r(T,A,B).
r([],[],[]).
r([E],[E],[]).
p(L):-r(L,A,B),append(A,B,X),write(X).

Example
>p([1,2,3,4,5]).
[1,3,5,2,4]

Hassium, 191 Bytes
This one was pretty long :(
It reads the array from args, so run this with hassium file.has 0 1 2 3 4
func main(){a=args;e,o=[]for(c=0;c<a.length;c++)if(c%2==0)e.add(a[c])else o.add(a[c])print("["+(e+o).toString().replace("{", "").replace("}", "").replace("Array", "").replace("  ", "")+"]");}

Run and see expanded with test case here

PHP, 78 69 bytes
PHP can chunk and slice, but not interleave arrays; that makes this a bit bulky:
function(&$a){while($i++<count($a)>>1)$a[]=array_splice($a,$i,1)[0];}

Call by reference or try it online.

first approach (programs for 78 bytes):
for(;++$i<$argc;)echo",",$argv[$i++];for($i=1;++$i<$argc;)echo",",$argv[$i++];

prints a leading comma; insert [!$i] before the first$argv to remove it.
Two other 78 byte solutions (print a leading and a trailing comma):
for($n=$argc-2|1;++$i<$argc*2;)$i&1?print",".$argv[$i]:$argv[$n+=2]=$argv[$i];
for($n=$argc-2;++$i<$argc*2;)$i&1?print",".$argv[$i]:$argv[1|$n+=2]=$argv[$i];

Run with php -nr '' <arguments> or try them online

C# 7.3, 100 bytes
List<int> M(List<int> x)=>x.Select((y,i)=>(y,i)).GroupBy(y=>y.i%2,y=>y.y).SelectMany(y=>y).ToList();

This is pretty much idiomatic for C#, but I don't think a non-idiomatic solution would be much shorter.

pretty cool if wordy

Factor, 34 bytes
[ dup <evens> swap <odds> append ]

Try it online!
It's a quotation (anonymous function) that takes a sequence from the data stack as input and leaves a sequence on the data stack as output. It rips out the even indices into a sequence, rips out the odd indices into a sequence, and smushes them back together. [ 2 group flip concat ] works for sequences of even length, but flip can only transpose square matrices correctly.

Go, 97 96 91 bytes, idiomatic
func(L[]int)(E,O[]int){for i,e:=range L{if i%2<1{E=append(E,e)}else{O=append(O,e)}}
return}

Attempt This Online!
Because Go supports multiple return values, this returns 2 lists, the even-indexed elements and the odd-indexed elements.

-1 byte: ==0 into <1
-5 bytes: return values share a type

Go, 96 bytes, generic
func f[T any](L[]T)(E,O[]T){for i,e:=range L{if i%2<1{E=append(E,e)}else{O=append(O,e)}}
return}

Attempt This Online!
Go, 122 114 bytes (literal interpretation)
func(L[]int)[]int{var E,O[]int
for i,e:=range L{if i%2<1{E=append(E,e)}else{O=append(O,e)}}
return append(E,O...)}

Attempt This Online!
This longer solution merges the filtered lists into a single list.

-8 bytes: E and O share the same type

Rust 109 bytes
fn f(x:Vec<u8>)->Vec<u8>{x.iter().cloned().step_by(2).chain(x.iter().cloned().skip(1).step_by(2)).collect()}

"at least it's shorter than C#"

fn f(x:&[u8])->Vec<u8>{x.iter().chain(&x[1-x.len()%2..]).cloned().step_by(2).collect()}

let f=|x:&[u8]|x.iter().chain(&x[1-x.len()%2..]).cloned().step_by(2).collect();

fn f(a:&mut[u8])->&mut[u8]{for i in 1..(a.len()+1)/2{a[i..=2*i].rotate_right(1)};a}, or fn f(a:&mut[u8]){for i in 1..(a.len()+1)/2{a[i..=2*i].rotate_right(1)}} if we can modify the slice in-place without returning.

let f=|x:&mut[u8]|for i in 1..(x.len()+1)/2{x[i..=2*i].rotate_right(1)};

thanks for posting this, very interesting!!! im not sure if modifying in place is 'cheating' or if closures are cheating but .. your fn is down to 71. (closure doesnt even help that case)

Thunno, \$ 3 \log_{256}(96) \approx \$ 2.47 bytes
ZlS

Attempt This Online!
Explanation
ZlS  # Implicit input
Zl   # Uninterleave
  S  # Sum (acts as flatten
     # for nested lists)
     # Implicit output

Arturo, 27 bytes
$=>[i:0arrange&=>[i%2'i+1]]

Try it

Java 8 (OpenJDK 8), 70 bytes
Pretty much straightforward in Java
l->{for(int i=1;i<=l.size()/2;l.remove(i++))l.add(l.get(i));return l;}

Sadly not golfable using only streams because index isn't easily accessible from inside, and conversion from stream to list is still a pain until Java 16
Try it online!

Zsh, 34 bytes
for i j;a+=($i) b+=($j);echo $b $a

Try it online!. Note that arrays in Zsh are 1-indexed, that's why the output appears backwards from the example given. If the requirement for "even" indices first is relaxed, and the order of outputs is more important, just switch $a and $b

Haskell + hgl, 8 bytes
mp<$%uak

Attempt This Online!
Explanation

uak: splits a list into even and odd indices
mp: "Monoidal action", concatenates two lists
(<$%): Uncurry compose, this composes a curried two argument function like mp with a function that returns a tuple like uak.

Reflection
I'm pretty happy with this.  Really glad to have (<$%) and uak is proving to be quite useful. It is worth considering if either or both of these deserve a "promotion" to a smaller byte count.

JavaScript (Node.js), 49 bytes
After a few fails it finally works, but is now longer than expected :-/
t=>t.map((_,i)=>t[(i*2-1)%((l=t.length)+~l%2)+1])

Try it online!

Thunno 2 S, 1 byte
z

Attempt This Online!
Explanation
    # Implicit input
z   # Uninterleave the input into two pieces
    #   e.g.  [1,2,3,4,5,6]  ->  [[1,3,5], [2,4,6]]
    #   e.g.  [0,1,2,3,4]    ->  [[0,2,4], [1,3]]
    # S flag takes the sum of this list
    #  i.e. flattens the nested list
    #   e.g.  [[1,3,5], [2,4,6]]  ->  [1,3,5,2,4,6]
    #   e.g.  [[0,2,4], [1,3]]    ->  [0,2,4,1,3]
    # Implicit output

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Make America(n Maps) Great Again
New Bonus! (See below)
The cartography team of U.S. Republican presidential hopeful Ben Carson is having some trouble with their maps (image via Washington Post):

The problem is they don't have the Right Tool For The Job™. They need the most compact and reliable program possible, so they never have to worry about making maps again. That's why they hired you. You need to take this map and output it again with the desired coloring:

By Theshibboleth [GFDL (http://www.gnu.org/copyleft/fdl.html) or
  CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)], via
  Wikimedia Commons

If you don't know where all the states are (because you are not an American...or you are an American), here is a map with all the names (Washington D.C. is not required for this challenge):

"Map of USA with state names 2". Licensed under CC BY-SA 3.0 via
  Wikimedia Commons -
  https://commons.wikimedia.org/wiki/File:Map_of_USA_with_state_names_2.svg#/media/File:Map_of_USA_with_state_names_2.svg

For example if the input is Ohio, Indiana, Illinois;New York, New Jersey, Florida, you output:

The blank map image is available in SVG and PNG formats. For your convenience, here is a list of all 50 states in alphabetical order
This is a code-golf and graphical-output challenge. Output must be as a SVG or image file. Simply displaying the output on the screen is not enough. Input must be taken from STDIN or by reading a text file. I am flexible with how you format the input, although it should contain the full names of each state, with red (Republican) states listed first and blue (Democratic) states second. Any two distinct shades of red and blue are acceptable for the coloring. Of course, you can have the blank map image in the same folder as your program with whatever file name you want.
Accuracy Criteria
If your output is a raster file, it must be at least 800px by 495px, and the lines should not deviate from the result of scaling up the SVG to the same size by more than 1.5 pixels. If your output is a vector file, the lines should not deviate from the SVG by more than 1.5 pixels when both are scaled to 800px by 495px.
Bonus!
Ben is trying to cut down dependence on foreign libraries, and is now offering a -50% bonus to anyone who uses only a raster graphics version of the map as input and creates their own algorithm for region detection. Ultimately, it is my judgment that determines whether your approach counts as "writing your own" algorithm.
Good Luck!

the example shows some aliasing around the lines that hasn't been filled in. is that acceptable?

@Sparr I made the example with an image editor, so I consider it to be "perfect", so if you miss anything that it misses it's alright.

Just to be sure: are we allowed to modified the blank SVG file? Does its size count in our score? What do you mean by "simply displaying the output on the screen is not enough"?

@Blackhole No, you can't modify the blank SVG file, but it doesn't count as part of your score as long as you load it externally.

@Blackhole What I mean is, you have to output a file.

When you say "I am flexible with how you format the input", does that mean that a really strange formatting like Ohio0Indiana0Illinois1New York0New Jersey0Florida is allowed?

@Blackhole Yeah, I am ok with that.

how flexible? can my input just be a list of 50 ternary digits, in a specific order (alphabetical states, perhaps)?

@Sparr "I am flexible with how you format the input, although it should contain the full names of each state." It has to be human-readable names of each state, and it has to work even if they're not in alphabetical order.

For the record, a semi-related xkcd exists.

Python 626
In the approach below, I added .rstate and .bstate based on .state in the CSS description. In my I renamed the provided .svg file to v.svg. It takes an input as described below and writes to a file w.png. To transfer from the full state name to the abbreviated version I look them up based on the first and last two letters of the states.
r='Ama,Aka,Ana,Aas,Cia,Cdo,Cut,Dre,Fda,Gia,Hii,Iho,Iis,Ina,Iwa,Kas,Kky,Lna,Mne,Mnd,Mts,Man,Mta,Mpi,Mri,Mna,Nka,Nda,Nre,Ney,Nco,Nrk,Nna,Nta,Oio,Oma,Oon,Pia,Rnd,Sna,Sta,Tee,Tas,Uah,Vnt,Via,Won,Wia,Win,Wng'.split(',')
y='lkzraotelaidlnasyaedainsotevhjmycdhkraicdnxttaaviy'
v=open('v.svg','r')
s=v.read()
v.close()
k=s.find('.state')
j=s.find('.',k+1)
t=input().split(';')
w=open('w.svg','w')
k+=1
c='#E0E0E0'
s=s[:j]+'.r'+s[k:j].replace(c,'red')+'.b'+s[k:j].replace(c,'blue')+s[j:]
c='rb'
for j in range(2):
 for d in t[j].split(','):k=s.find('state '+d[0].lower()+y[r.index(d[0]+d[-2:])]);s=s[:k]+c[j]+s[k:]
w.write(s)
w.close()

Example input:
'California,Illinois,Iowa,Mississippi;New Mexico,Pennsylvania,South Dakota,Vermont'

Example output:

Or inspired by the flag of France:

Nice one, democracy lives on!

Congratulations, you are the winner! Thanks to everyone who participated!

Processing,  425 bytes (259 bytes + 1 +165 byte file)
Code:
size(959,593);String[]a=loadStrings("a"),b=loadStrings("b");PShape m=loadShape("M.svg");m.disableStyle();for(int i=0;i<51;i++){fill(255);int r=0;for(String j:a){if(j.isEmpty())r++;if(j.contains(b[i]))fill(r>0?#0000FF:#FF0000);}shape(m.getChild(i));}save("m");

Blank map should be named "M.svg" and stored in a folder called /data (all other files are in the same folder as the program.)
Input File ("a"):
Mississippi
California
Connecticut

Delaware
Florida
Wyoming
Hawaii

Key File ("b"): http://pastebin.com/0pNufAH9
Output ("m.tif"):

Ok, here is my try at my own challenge. Some notes:

The output map looks different from the input map in the following ways

The input map had grey filling on a transparent background. The output has white filling on a gray background. I think this should be allowed, because white, gray, and transparency are all neutral.
The output map is missing the lines around Hawaii and Alaska that the input had. Once again, I think this is ok because the lines are not a significant part of the map.

The program uses an external file to hold keys. According to this meta post, I just need to add 1 byte for one additional file.

If anyone has any discrepancies with my self-adjudication of my code, feel free to leave a comment.
Also, if anyone is curious about trying this challenge in Processing, it supports both reading SVG files into PShape's, as well as parsing SVG files as XML.

For your for-loop, have for(int i=0;i++<51;) instead of for(int i=0;i<51;i++). It saves 1 byte and it has a smiley face in it ;)

@ΚριτικσιΛίθος I had to make it ++i for it to work. Does that sound right?

@ΚριτικσιΛίθος It might save a byte, but it completely changes the behaviour inside the loop.

@ΚριτικσιΛίθος Yeah, I guess I can't use that then because I lose Hawaii. Maybe it works different in Java then other languages.

You have got an extra useless space at String[] a

@ΚριτικσιΛίθος Nice tip, thanks!

PHP, 714 bytes
The output is the blank SVG file, which should be stored in a file named a, with additional CSS to colour the states, which should be stored in a file named b in the following format:
Ohio0Indiana0Illinois1New York0New Jersey0Florida

I've added some newlines for readability.
<?
$x=str_replace;echo$x('.b','#'.$x([0,1],[',#','{fill:red}#'],$x(split(0,'Alabama0Alaska0
Arizona0Arkansas0California0Colorado0Connecticut0Delaware0Florida0Georgia0Hawaii0Idaho0Illin
ois0Indiana0Iowa0Kansas0Kentucky0Louisiana0Maine0Maryland0Massachusetts0Michigan0Minnesota0M
ississippi0Missouri0Montana0Nebraska0Nevada0New Hampshire0New Jersey0New Mexico0New York0Nor
th Carolina0North Dakota0Ohio0Oklahoma0Oregon0Pennsylvania0Rhode Island0South Carolina0South
 Dakota0Tennessee0Texas0Utah0Vermont0Virginia0Washington0West Virginia0Wisconsin0Wyoming'),s
tr_split(ALAKAZARCACOCTDEFLGAHIIDILINIAKSKYLAMEMDMAMIMNMSMOMTNENVNHNJNMNYNCNDOHOKORPARISCSDT
NTXUTVTVAWAWVWIWY,2),file(b)[0])).'{fill:blue}.b',implode('',file(a)));

Here is the ungolfed version:
<?php
$stateNames = 'Alabama0Alaska0Arizona0Arkansas0California0Colorado0Connecticut0Delaware0Florida0Georgia0Hawaii0Idaho0Illinois0Indiana0Iowa0Kansas0Kentucky0Louisiana0Maine0Maryland0Massachusetts0Michigan0Minnesota0Mississippi0Missouri0Montana0Nebraska0Nevada0New Hampshire0New Jersey0New Mexico0New York0North Carolina0North Dakota0Ohio0Oklahoma0Oregon0Pennsylvania0Rhode Island0South Carolina0South Dakota0Tennessee0Texas0Utah0Vermont0Virginia0Washington0West Virginia0Wisconsin0Wyoming';
$statesAbbreviations = 'ALAKAZARCACOCTDEFLGAHIIDILINIAKSKYLAMEMDMAMIMNMSMOMTNENVNHNJNMNYNCNDOHOKORPARISCSDTNTXUTVTVAWAWVWIWY';

$blankSVG = implode('', file('a'));

$inputWithStateNames = file('b')[0];
$inputWithStateAbbreviations = str_replace(
    explode('0', $stateNames),
    str_split($statesAbbreviations, 2),
    $inputWithStateNames
);

echo str_replace(
    '.border',
    '#'. str_replace(
        [
            '0',
            '1'
        ],
        [
            ',#',
            '{fill:red}#'
        ],
        $inputWithStateAbbreviations
    ) .'{fill:blue}.border',
    $blankSVG
);

The principle is simple: in the blank SVG, each path has an ID corresponding to the abbreviation of the state that it represents (for instance, <path d="…" id="HI" /> for Hawaii).
All we have to do is to add some CSS to colour this path in the appropriate shade. But there is already some CSS in the blank file (in particular the <style type="text/css">…</style> tag already exists), so it's really easy and short to do it. We can notice than the string .b is only found in the CSS for .border. Good news! We'll just replace .b with OUR_WONDERFUL_CSS.b.
Creating "our wonderful CSS" is not really more difficult:

Read the input from the file: Ohio0Indiana0Illinois1New York0New Jersey0Florida.
Replace the names of the states with their abbreviations: OH0IN0IL1NY0NJ0FL.
Replace the 0 characters with ,#: OH,#IN,#IL1NY,#NJ,#FL.
Replace the 1 character with {fill:red}#: OH,#IN,#IL{fill:red}#NY,#NJ,#FL.
Add # at the beginning and {fill:blue} at the end: #OH,#IN,#IL{fill:red}#NY,#NJ,#FL{fill:blue}.

Ok, great job. While technically it doesn't write a file as I would want, the user can easily save image by pushing "Save Page As" in the browser. I'll allow this type of answer.

Interesting that the abbreviations for Pennsylvania, Rhode Island, and South Carolina spell out PARIS.

@geokavel I can easily create a file, if necessary. Should I modify my answer? Yep, long live Paris! By the way, thanks for your support in this tough times, brothers beyond the Atlantic!

@DavidCarraher I've added some explanations. I hope it will help you to understand my answer.

+1 for implode and your username!

Mathematica 1025
Not elegant but it works.
I wasn't aware that SVG files had paths for each state, so I found the states using MorphologicalComponents and then associated each component with its respective state.  States like Michigan (with upper and lower peninsulas) and Hawaii (multiple islands) have more than one component.
The code assumes that the map file is contained in the variable, m.
r=Thread[{"Washington","Montana","Maine","Minnesota","North Dakota","Oregon","Michigan","New Hampshire","Vermont","Wisconsin","New York","Idaho","South Dakota","Wyoming","Massachusetts","California","Connecticut","Nevada","Pennsylvania","Iowa","New Mexico","New Jersey","Ohio","Nebraska","Illinois","Indiana","Colorado","Delaware","Maryland","West Virginia","Virginia","Missouri","Washington, D.C.","Kansas","Kentucky","North Carolina","New Mexico","Tennessee","Arizona","Oklahoma","Arkansas","South Carolina","Georgia","Alabama","Mississippi","Texas","Louisiana","Alaska","Florida","Hawaii"}->{6,7,8,9,10,11,{13,23},14,16,18,{19,39},20,24,25,26,27,31,32,36,37,38,40,41,42,43,44,45,46,{47,55},49,50,51,52,53,56,57,58,59,60,61,62,65,66,67,69,{71,80,87},72,{73,75,82,93,101,104},74,{79,81,83,84,85,89,92}}];
v=Flatten;c=MorphologicalComponents@Binarize@m;
h@s_:=v[((Reverse/@Position[c,#])/.{x_,y_}:>{x,1241-y})&/@s,1]
k@{s_,c_}:=Thread[(h@s)->c]
f@{a_,b_}:=Export["f.jpg",(ReplacePixelValue[map,v[k[{v[#/.r],#2}]&@@@{{a,Red},{b,Blue}}]])]

Below is the image that will be exported by the following input:
f[{{"Ohio", "Indiana", "Illinois", "Alaska"}, {"New York", "Michigan","Oregon", "New Jersey", "Florida"}}]

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
And all the people said…
Objective Given an input of text that does not contain characters [ or ], perform the following actions:

For every instance of Amen with at least one capital letter (so all instances of Amen excluding amen), output that same Amen (retain capitalization).
For every instance of /all the people said[?: ]/i (that's a Regular Expression), also output Amen (any case is fine.)

After every output, you may choose any constant separator, e.g. a newline, space, or nothing.
This is a code-golf, so the shortest program in bytes wins.
Example IOs
Input: I said AMEN! AMEN, PEOPLE!
Output: AMENAMEN         ; any separator is fine, I choose none.

Input: amen amen amen amen
Output:                  ; nothing

Input:                   ; empty
Output:                  ; nothing

Input: *blah blah blah* And all the people said?
Output: Amen

Input: all the people said:
Output: Amen

Input: AMEN AMeN AmeN aMEN amen AmEn
Output: AMEN AMeN AmeN aMEN AmEn

Input: All the people said Amen! And all the people said AMEN!
Output: Amen Amen Amen AMEN

Input: LAMEN! Amen.
Output: AMEN Amen

Input: AmenAmenAmenAmenAMENamen
Output: Amen Amen Amen Amen AMEN

Input: And he was like, "Amen", then we were all like, "Amen, bruh."
Output: Amen Amen

Input: And all the aMen people said.
Output: aMen

Bonus

-20 bytes if you can "grab" the punctuation that follows the Amen, i.e., Amen! => Amen!, AmEN. => AmEN., I said Amen, bruh. => Amen,, and AMEN!!!! => AMEN!!!!. ! is the only character to be preserved multiple times. .?!, are the only characters to be preserved thus.
-40 bytes if, there is an instance of amen, output, Heresy! at index [i] instead of nothing, where [i] is the index of the offending word i.e. amen.

Bonus IOs
Input and output is of the form input => output. (Separator here is a space.)
BONUS 1
Can I get an Amen! => Amen!
AMEN! and AMEN! and a final Amen... => AMEN! AMEN! Amen.
Amen? Amen, and amEn! => Amen? Amen, amEn!

BONUS 2
The man sighed and said, "amen," and left. It's AMEN! => Heresy! at index [26] AMEN!

Leaderboards
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

var QUESTION_ID=64109,OVERRIDE_USER=8478;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?([-\d.]+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Do the amens have to be in order?

@ZachGates Yes.

How do you determine the "index of the offending phrase"?

@ZachGates To be the index of the a in amen. E.g., G amen => 2, if your language is zero-indexed; 3 if it is one-indexed.

AMEN!!!! => AMEN!!!! and yet and a final Amen... => Amen.?

What if amen is part of another word ?

You match it anyhow @User112638726.

Retina, 37 bytes
S`amen
i`all the people said[?: ]
amenx
!i`amen([.,?]|!*)

The code if 57 bytes long and qualifies for the -20 bytes bonus. Try it online!
Thanks to @MartinBüttner for porting my Perl answer to Retina!
How it works
S`                          Split the input at...
  amen                      matches of "amen".
i`                          Case-insensitively search for
  all the people said[?: ]  matches of "all the people said",
                            followed by '?', ':' or ' '...
    amenx                   and replace them with "amenx"
!i`                         Print all case-insensitive matches of...
  amen([.,?]|!*)            "amen", followed either by a single '.',
                            ',' or '?', or by 0 or more '!'s.

May I use your ([.,?]|!*) punctuation match pattern for my answer? I saw it and couldn't unsee it (and I certainly couldn't find a better solution!). It's certainly not going to beat yours :), but I don't want to plagiarize, and I'm not totally sure of the etiquette for borrowing solutions to sub-problems like this.

@apsillers Legally, all content here is licensed as CC-BY-SA, meaning that you can use it freely with attribution. Morally, porting somebody's solution to another language to outgolf him is more or less frowned upon, but taking a tiny part of somebody's answer is always fine.

 VBA, 193 bytes
Function v(b)
For i=1 To Len(b)
If StrConv(Mid(b,i,19),2) Like "all the people said" Then v=v& "Amen"
q=Mid(b,i,4):k="amen"
If StrConv(q,2) Like k And Not q Like k Then v=v& q
Next
End Function

No Separation, No Regex, No Bonus. Had a version that got both Bonus but was MUCH longer.

You van lose 1 byte byte by changing for i=1 to to for i=1To

Perl, 51 bytes
s/amen/x/g;s/all the people said[?: ]/amenx/ig;say/amen[.,?]|amen!*/ig

The actual source code contains 70 bytes, it must be run with perl -nE (+1 byte), and it qualifies for the -20 bytes bonus.

Python 2, 155 bytes
from re import*
F,m=findall,"((?i)amen)"
for i in split(m,input()):
 if F("((?i)all the people said[?: ])",i):print'AMen'
 elif F(m,i)and i!="amen":print i

Example
$ python2 test.py
"All the people said Amen! And all the people said AMEN!"
AMen
Amen
AMen
AMEN

grep and sed, 85 83 84 77 - 20 = 57 bytes
sed 's/all the people said[?: ]/Amenx/ig'|grep -oi 'amen[.,!?]*'|grep \[AMEN]

This will print Amen? for the input all the people said??. The best workaround I could find was to replace the string with Amenx.

Thanks @Dennis, I've used your workaround and updated the score.

This will print amen. for the input amen.. Fixing this will shorten your answer: just change grep -v '^[amen]*$' to grep \[AMEN].

@hvd: You're right, this is much better :-)

JavaScript, 88 bytes
108 bytes - 20 bytes (catches punctuation)
alert(prompt().replace(/amen/g,' ').replace(/all the people said[?: ]/ig,'Amen').match(/amen(\??!?\.?)+/ig))

This prints Amen?!. for input Amen?!., and Amen! for input Amen!!!.

@Dennis Sorry, didn't think about multiple punctuation marks being used at once, I'll fix it.

@Dennis Just fixed it.

@apsillers Didn't notice that either. I'll try to fix it later.

@apsillers Fixed

Perl, 103 - 60 = 43 bytes
#!perl -p
s/amen/Heresy! at index [@-]/g;s/all the people said[?: ]/Amen /gi;s/(amen([.,?]|!*)|h[^h]+\])\K|.//gi

Counting the shebang as one, input is taken from stdin. Maintains punctuation for -20 bytes, and identifies heresy for -40.

Sample Usage
$ echo amen amen, and all the people said?? amen amen | perl amen.pl
Heresy! at index [0]Heresy! at index [5]AmenHeresy! at index [37]Heresy! at index [42]

$ echo AMEN AMeN AmeN aMEN amen AmEn | perl amen.pl
AMENAMeNAmeNaMENHeresy! at index [20]AmEn

$ echo The man sighed and said, "amen," and left. It's AMEN! | perl amen.pl
Heresy! at index [26]AMEN!

Perl, 70 - 20 = 50 bytes
#!perl -p
s/all the people said[?: ]/Amen /gi;s/amen|(?i:amen([.,?]|!*))\K|.//g

Counting the shebang as one, input is taken from stdin. Maintains punctuation for -20 bytes.

Sample Usage
$ echo All the people said Amen, and all the people said AMEN!! | perl primo-amen.pl
AmenAmen,AmenAMEN!!

Your first solution fails for input like ha]. (Nevermind, just saw the OP's comment that the input can't contain square brackets...this question has morphed so many times I can't keep track.)

@ThisSuitIsBlackNot I don't think the OP has answered that question.

@Dennis Ah, you're right. Yet another unknown.

, 66 - 20 = 46 chars / 80 - 20 = 60 bytes
ïċ/all the people said[?: ]⍀,`Amen”ċ(/amen⌿,`x”ĉ/amen(\??!?\.?)+⍀)

Try it here - Firefox only.
First time here at PPCGSE. Hope this golf is pretty good.
EDIT: Actually, I'm beating CJam (in char count), so that's pretty good!

Yay, someone's using my language! Not bad for your first post.

CJam, 57 bytes
 q_,,\f{\:I>_4<_el"amen":A=*_A="Heresy! at index ["I+']+@?oK<)"?: "&,*el"all the people said"=A*o}

The code is 97 bytes long and qualifies for the -40 bytes bonus.
Try it online in the CJam interpreter.

CJam is longer than Perl? o_O

CJam doesn't have regular expressions, so that's not at all surprising.

Ohhh... writes that down

JavaScript, 100 bytes
alert(prompt().replace(/all the people said[?: ]/ig,'Amen').replace(/amen/g,'x').match(/amen/ig));

You can use x=prompt(); and you can use also alert(prompt().replace(...).replace(...).match)

Done. Now it's 100 chars long.

JavaScript, 136 135 - 40 - 20 = 75 bytes
alert(prompt(A="ameN").replace(/all the people said[?: ]|(amen)([.,?]|!*)|./ig,(v,a,p,i)=>a?a>A?`Heresy! at index [${i}]`:v:v[1]?A:""))

Explanation:
This code is driven by a three-part regex that feeds results into a replace callback. The parts are:

all the people said[?: ] - simply matches the required all the people said pattern
(amen)([.,?]|!*) - matches any-case amen and punctuation (one of .,? or zero or more !, which makes the punctuation optional) into separate match groups -- credit to Dennis for the punctuation pattern
. - matches any other character, not part of the above patterns, one at the time

Therefore, any match must either be an all-the-people string, an Amen match with optional punctuation, or a single character not part of either of those phrases. We use logic in the replacer callback to save and replace the appropriate parts of the string, and change every other character to the empty string.
alert(
  // store "ameN" in `A` and then prompt
  prompt(A="ameN")
    .replace(
      // three-part regex:
      /all the people said[?: ]|(amen)([.,?]|!*)|./ig,

      // replacer callback, with arguments
      //   v - total match
      //   a - "amen" match group
      //   p - punctuation match group (unused)
      //   i - index of match
     (v,a,p,i)=>
        a?           // if there is an Amen match
          a>A?      //   if the Amen is lowercase (lexically more than "ameN")
               `Heresy! at index [${i}]`
              :v     //   otherwise, output full Amen with punctuation
         :v[1]?      // if there is no Amen, but more than one character
          A          //   this must be all-the-people; output "ameN"
         :""         // otherwise, not an Amen or all-the-people
  )
)

Python 2, 191 - 40 = 151 bytes
i=input()
a='amen'
for j in range(len(i)):
 s=i[j:j+20];w=s[:4]
 if s[:-1].lower()=="all the people said"and s[-1]in'?: ':print a
 if w.lower()==a:print'Heresy! at index[%d]'%j if w==a else w

No regex, and Bonus 2

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Compile Regexes (By Substitution)
Your task is to compile regexes... by specifying a substitution for each character in a regex.
Regexes
The regexes support these
REGEX       = (LITERAL REGEX / GROUP REGEX / STAR REGEX / ALTERNATIVE)
LITERAL     = 1 / 0
GROUP       = '(' REGEX ')'
STAR        = (LITERAL / GROUP) '*'
ALTERNATIVE = '('REGEX ('|' REGEX)*')'

Why only 1 or 0? It is for simplification. The regex thus has only the following characters:
*()|10

It is interpreted as follows:

* is Kleene star (repeat left group or literal 0 or more times).
| is alternation (match if either the regex to the left or the regex to the right matches).
() is grouping.
1 matches character 1.
0 matches character 0.

How to compile?
You specify six code snippets: one to replace each regex character. For example, if your answer is:

* : FSAGFSDVADFS
| : GSDGSAG
( : GSDG
) : GDSIH
1 : RGIHAIGH
0 : GIHEBN

Then you replace each regex with its respective code snippet, so:
(0|11)*

is turned into:
GSDGGIHEBNGSDGSAGRGIHAIGHRGIHAIGHGDSIHFSAGFSDVADFS

What is the resulting program supposed to do?
Your program will:

Take the input.
Output a truthy value if the regex matches whole input.
Else output a falsy value.

Input outside 01 is consindered undefined behavior. Input can be empty.
Additional rules

For a given regex character, the resulting snippet must always be the same.
There is no prefix or suffix character added afterwards.
The regex is guaranteed to be nonempty.

Scoring
The least combined snippet is the winner. So the score for the example case would be calculated as follows:
FSAGFSDVADFS + GSDGSAG + GSDG + GDSIH + RGIHAIGH + GIHEBN
12 + 7 + 4 + 5 + 8 + 6 = 42

Is each snippet to be at least 1 character long?

The snippet can have zero length. The edit is OK.

Is the language RegEx valid for this challenge? :P

I consider RegEx have RegEx build-in. I am forced to do this. I want to exclude Retina and regex, however, according to Mego, it is not allowed. Still, I don't know about Snails and friends.

@ChristianIrwan Interestingly, I'm still not sure this is even solvable in Retina, and even it is, it will be far from competitive.

Actually, I want to exclude Retina, RegEx, Snail, SnakeEx, etc. However, I don't know about Snail, SnakeEx, ..., so someone post the loophole. Since I can't prevent it, now you can post in it.

I want to see answer without regex nor other pattern-matching language. I will give him a bounty.

Does The regex is guaranteed to be nonempty. apply only to the entire input, or two REGEX as well? In particular, do we have to support (0|)?

Only to entire input.

Snails, 48 bytes
0 -> )0(\0!(l.)(~
1 -> )0(\1!(l.)(~
( -> )0({{(
) -> )0}}(~
| -> )0}|{(
* -> )0),(~
If we had to search for partial matches rather than matching only the full input, then it would be very easy. 0 would become \0, 1 would become \1, * would become ,, and the others would map to themselves. Instead there are a lot of shenanigans to prevent matches from starting somewhere other than the beginning or ending somewhere other than the end. !(l.) is an assertion that will fail if the beginning of the match is not at the beginning of the input. ~ matches a cell outside of the input, so it is added to all the characters that are allowed to be at the end of the regex. If there is another regex character following, it is canceled out by a numerical quantifier 0 which requires it to be matched 0 times, essentially commenting it out. To allow * (,) to work correctly despite the dummy out-of-bounds test being in the way, the language's bracket matching rules are heavily used. From the documentation:

Matching pairs of parentheses () or curly braces {} will behave as expected (like parentheses in regex), but it is also possible to leave out one half of a pair and have it inferred, according to the following rules. ) or } groups everything to the left until the nearest unclosed group opening instruction of the same type(( or { respectively), or the beginning of the pattern if none exists. It closes any unclosed opening instructions of the opposite type in the middle of this range. An otherwise unmatched ( or { is closed by the end of the pattern.

Clear as mud, right?

Sigh, I forget that there is even matching language outside regex. Nice job, but sorry, no upvote (no downvote, either)

@ChristianIrwan there's actually a whole challenge on this site for developing 2d matching languages, most of which has 1d degenerate uses. http://codegolf.stackexchange.com/questions/47311/language-design-2-d-pattern-matching

CJam, 151 bytes
{]Na/Saf+{:m*:sSf-~}%}:J{+:MU{]W=~Jea&,}|}:TM0sa`T
{]Na/Saf+{:m*:sSf-~}%}:J{+:MU{]W=~Jea&,}|}:TM1sa`T
M{{+:M];eas!}:T}|U):UM'[T
MN`T
U(:UM'JT
M\"S+ea`,m*\"T

The lines correspond to the characters 01(|)* (in that order). Try it online!
This uses no built-in regular expression or other types of pattern matching. In fact, CJam has neither of these features. Instead, it starts from the regular expression it represents and builds all possible strings it could match, to finally check if the user input is one of them.
Test runs
The following uses a program that reads a regular expression from STDIN, replaces each of its characters by the proper snippet, and finally evaluates the generated code to see if it matches the input specified in the command line argument.
$ cat regex.cjam
l"01(|)*""

{]Na/Saf+{:m*:sSf-~}%}:J{+:MU{]W=~Jea&,}|}:TM0sa`T
{]Na/Saf+{:m*:sSf-~}%}:J{+:MU{]W=~Jea&,}|}:TM1sa`T
M{{+:M];eas!}:T}|U):UM'[T
MN`T
U(:UM'JT
M\"S+ea`,m*\"T

"N%ers~
$ cjam regex.cjam '' <<< '(|)'
1
$ cjam regex.cjam '0' <<< '(|)'
0
$ cjam regex.cjam '' <<< '0(|)'
0
$ cjam regex.cjam '0' <<< '0(|)'
1
$ cjam regex.cjam '' <<< '(0|11)*'
1
$ cjam regex.cjam '0' <<< '(0|11)*'
1
$ cjam regex.cjam '11' <<< '(0|11)*'
1
$ cjam regex.cjam '011011000' <<< '(0|11)*'
1
$ cjam regex.cjam '1010' <<< '(0|11)*'
0

Unfortunately, this isn't particularly fast. It will choke rather quickly if there are more than 9 characters in the input or more than a single Kleene star in the regex.
At the cost of 5 extra bytes – for a total of 156 bytes – we can generate shorter strings to match the potential input against and deduplicate them. This doesn't change how the code works; it just makes it more efficient.
$ cat regex-fast.cjam
l"01(|)*""

{]Na/Saf+{:m*:sSf-~}%}:J{+:MU{]W=~Jea&,}|}:TM0sa`T
{]Na/Saf+{:m*:sSf-~}%}:J{+:MU{]W=~Jea&,}|}:TM1sa`T
M{{+:M];eas!}:T}|U):UM'[T
MN`T
U(:UM'JT
M\"S+eas,)m*:sSf-L|\"T

"N%ers~
$ cjam regex-fast.cjam '0101001010' <<< '(01|10)*'
0
$ cjam regex-fast.cjam '011001101001' <<< '(01|10)*'
1
$ cjam regex-fast.cjam '0' <<< '(0*1)*'
0
$ time cjam regex-fast.cjam '101001' <<< '(0*1)*'
1

I still have some idea how I could make this shorter and/or faster. I'll add an explanation when I'm satisfied with the results.

There seems to be a superfluous \-escaping of the " in the pattern for *. Regardless of that, I couldn't get this program to accept any input, even for the simplest case where the regex consists only of a 0 (see test in online interpreter). Am I doing it wrong?

@matz My code uses command-line arguments, which are not implemented in that interpreter. Try this one instead.


text:
Help me manage my time
I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.
Input

Two dates, in any format. The second date will always be later than the first.
A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo,Tu,Fr.

Output
Output will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.
Example:
Input: 9/17/2015 9/27/2015 1-15 Tu
Output:
9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15

The input in the example should be `9/17/2015 9/27/2015 1-15 Tu' because 9/22 is a Tuesday.

@DavidCarraher you are right, when I made that sample input I was thinking of November for some reason.

If it was me the last date would have all the chapters :)

@MickyT precisely my inspiration for this challenge.

You'll soon discover how much amazing physics is. You're lucky actually.

PowerShell v4, 367 357 323 313 308 307 305 277 Bytes
param($a,$b,$c,$d)$e=@();$c=-split('('+($c-replace'-','..'-replace',','),(')+')'|iex|%{$_-join' '});while($a-le$b){if(-join"$($a.DayOfWeek)"[0,1]-notin$d){$e+=$a;$z++}$a=$a.AddDays(1)}$g=,0*$z;$c|%{$g[$c.IndexOf($_)%$z]++};1..$z|%{"$($e[$_-1]): "+$c[$i..($i+=$g[$_-1]-1)];$i++}

Edit - golfed 28 bytes by using explicit input formatting.
Explained:
param($a,$b,$c,$d)    # Parameters, takes our four inputs
$e=@()                # This is our array of valid output dates

$c=-split('('+($c-replace'-','..'-replace',','),(')+')'|iex|%{$_-join' '})
# Ridiculously complex way to turn the input chapters into an int array
# The first part changes "1,5-9,12" into a "(1),(5..9),(12)" format that
# PowerShell understands, then executes that with iex, which creates an
# array of arrays. Then iterate through each inner array and joins them all
# together with spaces, then finally splits on spaces to create a 1D array

while($a-le$b){       # Until we reach the end day
  if(-join"$($a.DayOfWeek)"[0,1]-notin$d){
    # Not an excluded day of the week
    $e+=$a            # Add it to our list of days
    $z++              # Increment our count of total days
  }
  $a=$a.AddDays(1)    # Move to the next day in the range
}

$g=,0*$z              # Populate a new array with zeroes, same length as $e

$c|%{$g[$c.IndexOf($_)%$z]++}
# This populates $g for how many chapters we need each day

1..$z|%{"$($e[$_-1]): "+$c[$i..($i+=$g[$_-1]-1)];$i++}
# Goes through the days in $e, prints them, and slices $c based on $g

Usage
Expects the dates to be in .NET DateTime format. Expects the "skipped" days to be in an array (PowerShell equivalent of a list).
PS C:\Tools\Scripts\golfing> .\help-me-manage-my-time.ps1 (Get-Date '9/17/2015') (Get-Date '9/27/2015') '5,1-3,6,10-13,20-27' @('Su','Tu')
09/17/2015 00:00:00: 5 1 2
09/18/2015 00:00:00: 3 6
09/19/2015 00:00:00: 10 11
09/21/2015 00:00:00: 12 13
09/23/2015 00:00:00: 20 21
09/24/2015 00:00:00: 22 23
09/25/2015 00:00:00: 24 25
09/26/2015 00:00:00: 26 27

There are so many dollar signs here...This must be expensive! :D

@kirbyfan64sos Only 12% of the characters here are $ ... That's actually pretty average for PowerShell golfs, which seems to be around 10% to 15% (based on my own informal calculations of answers I've posted).

Over to you again :-)

Hmm 308 for mine as well ...

Good job on 305! 300 now :-)

@willem Using explicit input formatting to expect the input variables to be in .NET DateTime format golfs another 28 bytes. Down to 277 now.

Haha, do you think we can move the whole code to the input ?

@willem $args[0] 8 Bytes. Expects input to match desired output. :D

Can inline the creation of $e to save 6 bytes

Well I'll be damned, join is redundant here as well

JavaScript (ES6), 317 310 291 bytes
(a,b,c,d)=>{u=0;c.split`,`.map(m=>{p=m[s]`-`;for(q=n=p[0];n<=(p[1]||q);r=++u)c+=","+n++},c="");c=c.split`,`;x=d.map(p=>"SuMoTuWeThFrSa".search(p)/2);for(g=[];a<b;a.setTime(+a+864e5))x.indexOf(a.getDay())<0&&(t=y=g.push(a+" "));return g.map(w=>w+c.slice(u-r+1,u-(r-=r/y--+.99|0)+1)).join`
`}

Usage
f(new Date("2015-09-17"),new Date("2015-09-27"),"5,1-4,6,10-13,20-27",["Su","Tu"])
=> "Thu Sep 17 2015 10:00:00 GMT+1000 (AUS Eastern Standard Time) 5,1,2
Fri Sep 18 2015 10:00:00 GMT+1000 (AUS Eastern Standard Time) 3,4,6
Sat Sep 19 2015 10:00:00 GMT+1000 (AUS Eastern Standard Time) 10,11
Mon Sep 21 2015 10:00:00 GMT+1000 (AUS Eastern Standard Time) 12,13
Wed Sep 23 2015 10:00:00 GMT+1000 (AUS Eastern Standard Time) 20,21
Thu Sep 24 2015 10:00:00 GMT+1000 (AUS Eastern Standard Time) 22,23
Fri Sep 25 2015 10:00:00 GMT+1000 (AUS Eastern Standard Time) 24,25
Sat Sep 26 2015 10:00:00 GMT+1000 (AUS Eastern Standard Time) 26,27"

Explanation
(a,b,c,d)=>{

  u=0;                                                 // u = total chapters
  c.split`,`.map(m=>{                                  // c = array of each chapter
    p=m[s]`-`;
    for(q=n=p[0];n<=(p[1]||q);r=++u)                   // get each chapter from ranges
      c+=","+n++
  },c="");
  c=c.split`,`;

  x=d.map(p=>"SuMoTuWeThFrSa".search(p)/2);            // x = days to skip
  for(g=[];a<b;a.setTime(+a+864e5))                    // for each day between a and b
    x.indexOf(a.getDay())<0&&                          // if this day is not skipped
      (t=y=g.push(a+" "));                             // add it to the list of days
                                                       // t = total days
                                                       // y = days remaining

  return g.map(w=>w+
    c.slice(u-r+1,u-(r-=r/y--+.99|0)+1)                // add the chapters of the day
  ).join`
`
}

Python 2 - 338 317 308 304 300
Here we go to get the ball rolling ...
def f(a,b,c,d):
 from pandas import*;import numpy as n
 s=str.split;e=n.array([])
 for g in s(c,','):h=s(g,'-');e=n.append(e,range(int(h[0]),int(h[-1])+1))
 k=[t for t in date_range(a,b) if s('Mo Tu We Th Fr Sa Su')[t.weekday()]not in d];j=len(k);e=array_split(e,j)
 for u in range(j):print k[u],e[u]

Example input:
f('9/17/2015','9/27/2015','5,1-3,6,10-13,20-27',['Su','Tu'])

Example Output:
2015-09-17 00:00:00 [ 5.  1.  2.]
2015-09-18 00:00:00 [ 3.  6.]
2015-09-19 00:00:00 [ 10.  11.]
2015-09-21 00:00:00 [ 12.  13.]
2015-09-23 00:00:00 [ 20.  21.]
2015-09-24 00:00:00 [ 22.  23.]
2015-09-25 00:00:00 [ 24.  25.]
2015-09-26 00:00:00 [ 26.  27.]


text:
Drawing Lewis Structures of Alkanes
I just had a lesson in school about alkanes and figured it would probably make for a great code golf challenge! Don't worry, it isn't as complicated as it may look!
A Quick Rehash
(Please Note: To keep this brief, not all information is 100% accurate.)
Alkanes are strings of carbon and hydrogen. Every carbon atom has 4 bonds, and every hydrogen atom 1 bond. All the carbon atoms of the alkane form a string where each C-atom is connected to 2 other C-atoms (left and right in the Lewis structure) and 2 H-atoms (up and down), except for the ends of the string, where the C-atom is connected to only 1 other C but 3 Hs. Here's a basic example for pentane (an alkane with 5 C-atoms and 12 H-atoms):
  H H H H H
  | | | | |
H-C-C-C-C-C-H
  | | | | |
  H H H H H

Alkanes also can have branches. But don't worry, all alkanes in this challenge can be expressed with only 1 level of branching. Example:
        H
        |
      H-C-H
  H H H | H
  | | | | |
H-C-C-C-C-C-H
  | | | | |
  H H H H H

For completing this challenge you also must understand the IUPAC naming convention for branched alkanes. First of there's the root alkane. In our previous example, this would be the "C-C-C-C-C" part. Depending on how long this chain is, it has a different name. 1 C is called methane, 2 C ethane, 3 C propane, then butane, pentane, hexane, heptane, octane, nonane and decane (10 C). Then, for each branch, there's a certain prefix to that: First of, there's the index (offset) of the C-atom the branch is appended to (count from the left). In the example, this would be 4 (aka it's the 4th C-atom from the left). Then there's a hyphen (this symbol: "-") and after that another name indicating the size of the branch. The naming of the size of the branch is almost same like the naming of the  size of the root, just that instead of "ane" you append "yl". With that the full name of the example would be
4-methylpentane

If you have multiple branches, then they are prepended as well, separated by another hyphen. Example:
2-butyl-5-methylhexane

One last thing: if you have multiple branches of the same size, they get grouped; their offsets are separated by comma and they share the same size-name, which gets prepended by an extra syllable depending on how many branches are grouped: "di" for 2 branches, "tri" for 3, "tetra" for 4 (you don't need more for this challenge). Example:
2-ethyl-2,4,6-trimethyldecane

FYI, this could look somewhat like this: (Omitted H-atoms)
   |
  -C-
   |       |
  -C-     -C-
 | | | | | | | | | |
-C-C-C-C-C-C-C-C-C-C-
 | | | | | | | | | |
  -C- -C-
   |   |

Nomenclature Cheatsheet
Prefixes indicating numbers:
| Num  | Prefix |
|------|--------|
| 1    | meth   |
| 2    | eth    |
| 3    | prop   |
| 4    | but    |
| 5    | pent   |
| 6    | hex    |
| 7    | hept   |
| 8    | oct    |
| 9    | non    |
| 10   | dec    |
Suffix root:   ane
Suffix branch: yl
Prefixes grouping: di, tri, tetra

The Rules
Write a program that reads in such an IUPAC name from STDIN, program arguments or equivalent and draws it as an ASCII-art lewis structure to STDOUT (or equivalent).

For simplicity, you DO NOT have to draw the H-atoms (Else you will run into spacing issues)
You are NOT allowed to print any empty leading or trailing horizontal lines
The chains you have to parse won't be any longer than 10, and the maximum of branches in a "group" is limited to 4.
The maximum "offset" of a branch is 9 (meaning that you don't have to parse more than 1 digit)
Your branches have to alternate between going up and down after every new branch. In case this space is already taken by another branch at the same offset, you have to draw it on the other side of the root. (up->down, down->up)
On corrupt, not-correctly-formatted or otherwise not-drawable input, your program may behave unspecified.

This is code golf, shortest code in bytes wins!
Happy golfing! :)

Should 4-methylpropane say 4-methylpentane? 4-<anything>propane seems unlikely, unless I've completely misunderstood something.

Yes, you're right. Edited it!

The last molecule you have is 3-3-5-7-methyldodecane because the longest continuous carbon chain is 12 long. Also, you said not all the info in the question was accurate, but I think it's worth pointing out that the second molecule is 2-methylpentane, not 4-methylpentane because you start at the carbon with the closest branching.

I know, but that was exactly the inaccuracy I was disclaiming. That's just the trade off for keeping it short enough for a code golf challenge! :)

Your branches have to alternate between going up and down after every new branch. your example violates this rule 2. What is the maximum chain length we have to support (parsing the prefixes will be a part of the challenge.) You should link (or preferably copy) a list of nomenclature.

@steveverrill 1. Sorry, by that rule I meant something else. Edited it now as "You are NOT allowed to print any empty leading or trailing horizontal lines ". 2. Max chain size 10, max group size 4. hope this makes things more clear! :)

I wasn't referring to the rule you edited. I was referring to the one about alternating branches. Your example shows 2 consecutive methyl groups above the line, which is in violation of your rule. Please clarify.

Oh that; That's not really an example for what the program should output, but what "2-ethyl-2,4,6-trimethyldecane" should generally look like. But you're right, I think it would cause less confusion if it would conform to the rules.

Python 2, 620 bytes
import re
i=input()
s='m|e|pr|b|p|hex|h|o|n|de';d=dict(zip(s.split('|'),range(1,11)))
z=[[eval('['+a+']'),d[b]]for a,b in re.findall('(?:(\d[,\d]*).*?[\-ia]|l)('+s+')',i[:-3])]
v=z[-1][1]
l=[[0,0]for _ in range(v)]
c=0
for a,b in sorted([(i,b)for a,b in z[:-1]for i in a]):l[a-1][c]=b;c=~c
m=[max(x) for x in zip(*l)]
L,R=[[[' 'for _ in '_'*2*i]for _ in '_'*(2*v+1)]for i in m]
c=[' |'*v+' ']
C=c+['-C'*v+'-']+c
for i in range(len(l)):
 X=L;q=2*i+1
 for a in l[i]:
  if a>0:
   for j in range(0,2*a,2):
    X[q][j]='C'
    X[q-1][j]=X[q+1][j]='-'
    X[q][j+1]='|'
  X=R
for l in zip(*L)[::-1]+C+zip(*R):print ''.join(l)

Explanation
Input:
'2-ethyl-2,4,6-trimethyldecane'
First parses to string with regex (last group is root):
[[[2], 2], [[2, 4, 6], 1], [[], 10]]
Each branch is written in an array of length len(root) (Alternating up/down is handled here):
[[0, 0], [1, 2], [0, 0], [1, 0], [0, 0], [0, 1], [0, 0], [0, 0], [0, 0], [0, 0]]
'Left' and 'Right'(L,R) and 'root' (C) string branches are initialized.
Each branch is then added to the corresponding 'string' branch (big loop).
The two sides and center are printed at the end:
   |   |
  -C- -C-
 | | | | | | | | | |
-C-C-C-C-C-C-C-C-C-C-
 | | | | | | | | | |
  -C-     -C-
   |       |
  -C-
   |


text:
The Death Of Low-Resolution Pixel Art (Or, Draw That Death)

This is an Irregular Webcomic! themed task.*

Death is a rather extensive orginization, and, although Head Death has had no trouble telling his employees apart, certain other entities connected to the orginization have had trouble keeping track of them all.
Thus, your task here is to, given the title of one of the various Deaths, generate the corresponding 32x32 pixel image of that Death.
Furthermore, as Head Death is rather bureaucratic (and a little bit stingy), the shortest program (after a few bonuses have been taken into account) will be the one chosen for official use.
Input must be case-insensitive. Additionally, the prefixes Death Of, Death By, and The Death Of should be treated as equivalent.
The output image may be saved to a file (in any lossless bitmap image format) or displayed on the screen.
The following are the EXACT RGB values to be used:
White 255 255 255
Black 0 0 0
Dark Gray 125 125 125
Bone Gray 170 170 170
Purple 60 0 140
Brown 120 40 0
Blue 0 80 200
Green 0 100 0
Neon Green 100 255 0
Red 0 255 0

(Note that no one Death uses all of those colors, and the only color which is common to all of them is bone gray)
Each output image shown here is shown first at actual size and then at 3x close-up.
You are required to support the following Deaths:
The Death of Insanely Overpowered Fireballs

The Death of Choking On A Giant Frog

Head Death

The Death of Being Wrestled To Death By Steve

The Death of Inhaling Hatmaking Chemicals

Charon

(Note that Charon's exact role in the organization is unknown)
You are not required to support the following Deaths, but may do so for various bonuses
Death by Having Your Pelvis Crushed (-8% bonus)

The Death of Being Ground By A Mars Rover Rock Abrasion Tool (-10% bonus)

The Death of Drowning in a Reactor Pool (-10% bonus)

The Death of Being Impaled By A Javelin (-8% bonus)

The Death of Being Stabbed By A Cutlass (-9% bonus)

The Death of Bad Pizza Deliveries (-7% bonus)

(Probably the only Death not to wear a cape. Don't ask me why.)
If you add include all of them, the final multiplier is 0.92*0.9*0.9*0.92*0.91*0.93≈0.58.
Additional Bonus
If you use an RGBA format and replace the white background with transparency, save an extra 12%.

* Irregular Webcomic! is ©2002-Present David Morgan-Mar. CC BY-NC-SA.

As there was a lot of scrolling to do with the images, I've placed them side by side instead of vertically. Hopefully this is an improvement but feel free to roll back the edit if it isn't what you want.

JavaScript (ES6), 714 677.97 651.76 634.36 545.76 1063 - (8% * 10% * 10% * 8% * 9% * 7% * 12%) = 542.75
e=>(e=e.slice(-4,-2),c=document.createElement("canvas"),c.width=c.height=32,t=(r="000")=>(o=c.getContext("2d")).fillStyle="#"+r,r=(r,t,l=1,e=1)=>o.fillRect(r,t,l,e),u=12,i="7d7d7d",t(),r(l=13,8,3),(n=!/ea|te|ca|ri|Po/.test(e))&&(r(l,6,3,5),r(u,7,5,3)),"ca"==e&&(r(l,3,3,3),r(u,6,5)),"ri"!=e&&(t("ea"==e?"3C008C":/te|Po/.test(e)?"006400":""),r(10,l,9,15+("ea"==e)),r(11,u,7),r(u,11,5)),"te"==e&&(t("782800"),r(u,6,5),r(l,5),r(15,5)),"ri"==e&&(t("f00"),r(l,5,3,2),r(16,6)),t("aaa"),r(l,7,3),r(l,9,3),r(m=14,8),r(m,u,1,u),r(u,u,5),r(l,m,3),r(l,16,3),r(l,18,3),r(l,20,3),r(l,24,3),r(u,25),r(16,25),r(11,26,1,6),r(17,26,1,6),r(17,l,1,8),n||r(m,10,1,2),/al|ar|sh|el|To/.test(e)?(r(8,u,4),t(),r(7,9,1,23),"al"==e&&(r(3,9,4,2),r(2,10,1,2)),"sh"==e&&r(2,8,6,4),"el"==e&&(r(6,6,3,4),r(7,4,1,2),r(5,8,5)),"To"==e&&(r(6,8,3,23),r(4,m,2,3),r(3,m),r(l,9,3),t("fff"),r(6,9),r(5,15),t("0050c8"),r(l,7,3,2),r(m,9))):"la"==e?(r(11,u),r(10,l),r(9,15,1,2),t(i),r(9,17,1,12),r(8,17),r(7,18),r(8,19)):r(11,l,1,8),"Po"==e&&(t(i),r(l,10,3),t("64ff00"),r(u,7,5,3),r(l,6,3)),c.toDataURL())

Generates a data-url to a png of the image, and covers all of the bonuses.
EDIT: Just realized the bonus that a transparent background knocks off another 12%, which also reduces my byte count!


text:
Flaming Doorknob Keyboards!
Well, turns out Doorknob's
username on GitHub, Reddit, and other sites is
KeyboardFire. That gives me an idea...
The task
You work at KeyboardFire Inc., a company that makes special keyboards. And, by
"special", I mean that, whenever you press a key, something in your house lights
on fire! With the new KeyboardFire Doorknob series, the objects that light on fire
are doorknobs.
However, because of stupid government regulations, your users need to know which
doorknobs in their house wil light on fire.
Consider this ASCII art of a portion of a QWERTY keyboard:
1|2|3|4|5|6|7|8|9|0
 q|w|e|r|t|y|u|i|o|p
  a|s|d|f|g|h|j|k|l
   z|x|c|v|b|n|m

(The |'s represent the boundaries between keys.)
We can treat this exact ASCII drawing as a "graph" of sorts, where each character in the range [a-z0-9]
has an x (horizontal) and y (vertical) index, where (0,0) is 1. For instance,
the letter d has the coordinates (2,6) (pipes and spaces are included in the coordinate calculation).
Now let's think about each user's house. Every house can be drawn top-down view as
a 20x4 ASCII art (in this world where it's legal to sell destructive keyboards,
every house is the same size). We can use D's to mark the positions of each
doorknob in the house. Here's an example:
D         D  D     D
    D

              D  D

We'll call this the "house map". (Yes, that's a lot of doorknobs!)
Pressing any key will light the nearest doorknob on fire. For instance, if we take the previous coordinates of the letter d, the nearest doorknob (by Manhattan distance) is at
the coordinates (1,4). This is the doorknob that will light on fire when the
letter d is hit. If we were to mark the flaming doorknob with an F, the result
would be:
D         D  D     D
    F

              D  D

The specs
Your program will take two inputs:

A string that matches the pattern [a-z0-9]+.
A house map. This can be a string, a list of strings, or something equivalent.

You need to go through each letter of the string and light the respective
doorknob on fire (change its letter to an F). If the nearest doorknob is already
on fire, leave it as-is. If there is more than 1 doorknob that could be lit on fire
using the this method, you can light whichever one you want.
After the whole string is processed in this manner, you need to print the
resulting house map.
Code-golf, so shortest program wins. Standard loopholes banned as usual.
Example
String:
helloworld123

House map:
D    D       D     D
    D

              D  D

Possible results:
F    F       F     D
    F

              D  F

Or:
F    D       F     D
    F

              D  F

Or:
F    F       D     D
    F

              F  F

Or:
F    D       D     D
    F

              F  F

EDIT: Uh...is there a reason I have one answer, even with a +50 bounty? If you find the directions complicated/vague, I'd be glad if you posted in the comments or something...or of I'm doing anything wrong...
EDIT 2: Bounty expires in under a day! Post something else! Please! PLEASE!!!! :(

There are a few things I find confusing: 1) Why is d's coords (2, 6) and not (2, 2)? 2) Why does the example have so many possible answers? 3) When you explain how things will light on fire, why are you even talking about d? Why not just straight up say that pressing a will light some house on fire? Does d do it, too?

@Quelklef Is this a bit better? Thanks for the feedback!

If 'h' ends up exactly between two doorknobs and 'h' is called twice, should both doorknobs be on fire? or can the program choose to fire the same doorknob?

@GrantDavis The program can choose to fire the same doorknob.

JavaScript (ES6), 204 bytes
(s,h)=>[...s].map(c=>(o="1234567890qwertyuiopasdfghjkl_zxcvbnm".search(c),y=o/10|0,x=o%10*2+y,n=a=Math.abs,h.map((k,i)=>k.match(/\s/)||(d=a(x-i%21)+a(y-i/21|0))>n||(n=d,p=i)),h[p]="F"),h=[...h])&&h.join``

Fine, I'll answer it. ;)
Explanation
(s,h)=>
  [...s].map(c=>(                     // iterate through each character of the input

    // Get X and Y coordinates of the character input
    o="1234567890qwertyuiopasdfghjkl_zxcvbnm".search(c),
    y=o/10|0,
    x=o%10*2+y,

    // Find the nearest doorknob
    n=                                // n = Manhattan distance to nearest doorknob
      a=Math.abs,
    h.map((k,i)=>                     // iterate through each character of the house
      k.match(/\s/)||                 // do not check distance to whitespace characters
        (d=a(x-i%21)+a(y-i/21|0))>n|| // d = distance to the current doorknob
          (n=d,                       // set the nearest doorknob to this one
          p=i)                        // p = position of the doorknob
    ),
    h[p]="F"                          // update the doorknob to "F" in the house string
  ),h=[...h])&&h.join``               // return the house map as a string

Test

<input type="text" id="input" value="helloworld123" />

<textarea id="house" rows="4" cols="20">D    D       D     D
    D

              D  D  </textarea>

<button onclick='result.innerHTML=(

(s,h)=>[...s].map(c=>(o="1234567890qwertyuiopasdfghjkl_zxcvbnm".search(c),y=o/10|0,x=o%10*2+y,n=a=Math.abs,h.map((k,i)=>k.match(/\s/)||(d=a(x-i%21)+a(y-i/21|0))>n||(n=d,p=i)),h[p]="F"),h=[...h])&&h.join``

)(input.value,house.value)'>Go</button>

I finally got another answer!!! :D

Ruby, 229 bytes
->s,m{c=m.flat_map.with_index{|x,i|x.size.times.select{|j|x[j]==?D}.map{|y|[i,y]}}
s.chars{|h|x='1234567890qwertyuiop*asdfghjkl*zxcvbnm'.index h
x,y=(x%10)*2,x/10
a,b=c.min_by{|a,b|(y-a).abs+((y%2>0?x+1:x)-b).abs}
m[a][b]='F'}
m}

Not very good, but I just had to get the first answer in.
Slightly ungolfed / commented version:
#!/usr/bin/ruby

f = -> s, m {
    # get knob coords
    c = m.flat_map.with_index {|x, i| x.size.times.select{|j| x[j] == ?D }.map{|y| [i, y] } }
    # for each char in the string
    s.chars {|h|
        # note the asterisks to correct for offsets
        x = '1234567890qwertyuiop*asdfghjkl*zxcvbnm'.index h
        # get un-"staggered" x and y coords
        x, y = (x % 10) * 2, x / 10
        # add one to x for every other row to fit keyboard
        x += 1 if y % 2 > 0
        # find closest knob by Manhattan distance
        a, b = c.min_by{|a, b| (y - a).abs + (x - b).abs }
        # LIGHT IT ON FIRE!
        m[a][b] = 'F'
    }
    # return new map
    m
}

puts f['helloworld123', ['D    D       D     D', '    D', '', '              D  D']]