text:
Bleeeet Bleeeet Bl Bleet!
(Meaning: Convert English to Bleet)
We have praised goats as god for years now.
But if we can't translate English to 'Bleet', the Goat God's language, we cannot communicate with them.
So, to communicate with them, we have researched the activities of goats, and retrieved this pattern, which is the core of the language.

Say 'Bleet' for the length of each words. That means the amount of 'e's should be (length-3) for words longer than 3 letters.You shall cut down 'Bleet' for words shorter than 'Blt'. For example, 'be' becomes 'bl', but 'cat' and 'boat' becomes 'blt' and 'blet'.

As it seems, they don't actually change non-alphabet characters to 'Bleet'. Our research showed that 'Hello, World!' to Bleet is 'Bleet, Bleet!' not 'Bleeet Bleeet'. Also, The goats are not so intelligent(no offense), so they don't  seem to understand non-ascii characters or diacritics at all.
Now, It's time to make a translator to communicate with the goat gods.
Bleeeeet (Meaning: Examples)
Hello, World! => Bleet, Bleet!
lorem ipsum dolor sit amet. => Bleet Bleet Bleet Blt Blet.
We praise the Goat God! => Bl Bleeet Blt Blet Blt!
I have a pen => B Blet B Blt
0123456789_ => 0123456789_
0te_st1 => 0Bl_Bl1

What formats of input are acceptable

@fəˈnɛtɪk any form of string input.

What should we do for single letter words

Can the input contain diacritics (i.e. é, ê, ë, ñ, etc.)?

Related!

And what about words containing apostrophes? Will it's become Blt or Bl't or Bl'B?

@KevinCruijssen Good point. I'll change the post a bit to apply that.

Looks like you just invalidated every answer.

@JonathanAllan Should I rollback the rules? or let them change it?

It's up to you, but if you keep it I'd notify every answerer. If it were me I think I'd probably allow any behaviour: pass them (Jimmy's:Bleee't), treat them as word separations (Jimmy's:Bleet'B), or treat them as part of words (Jimmy's:Bleeeet). If I had to choose one I'd go with the word separator option, since it's what the 6 answers do.

@MatthewRoh The apostrophe and dash exception invalidates most of the current answers. I'd suggest making it an optional requirement.

Shouldn’t 0te_st1 be 0Bl_et1 -- does an underscore separate words?

Rolled back. Now it should be significantly easier.

This is really good challenge, we should have more like this.

@Downgoat quality-wise, or goat-wise?

Retina, 31 bytes
T`lL`e
(?<!e)e
B
Be
Bl
e(?!e)
t

Try it online!
Explanation
T`lL`e

Turn all letters into es.
(?<!e)e
B

Turn the first e in each run into B.
Be
Bl

Turn Be into Bl.
e(?!e)
t

Turn the last e in each run into t.

T1L the T stage "wraps" the translation pairs so that you can turn all letters like that to e

@ConorO'Brien It's actually a lower-case l, not a 1, but I'm not sure what you mean by "wrap". Transliteration simply repeats the last character in the target pattern, so if it was T\lL`ef, you'd map atoeand all other letters tof, not alternatingly to eandf`.

it was a bad joke. Sorry

JavaScript (ES6), 79 77 74 bytes
s=>s.replace(/[A-Z]+/gi,x=>x.replace(/./g,(_,i)=>'Bl'[i]||'et'[+!x[i+1]]))

Alternate approach, currently 83 78 bytes:
s=>s.replace(/[A-Z]+/gi,x=>`Bl${'e'.repeat((l=x.length)>3&&l-3)}t`.slice(0,l))

The best I could do recursively was 88 bytes:
f=([c,...s],i=0,q=/^[A-Z]/i)=>c?q.test(c)?('Bl'[i]||'te'[+q.test(s)])+f(s,i+1):c+f(s):''

I came up with 'Blet'[i>1?2+!x[i+1]:i] but sadly it's the same length.

@Neil Yeah, I figured it would be possible to do it that way, but I'm surprised it was nearly shorter than the way I'm doing it.

PHP, 115 88 86 77 75 bytes
preg_replace with arrays (requires PHP 5.4 or later)
echo preg_replace(["#[a-z]#i","#(?<!e)e#",_Be_,"#e(?!e)#"],[e,B,Bl,t],$argn);

Run with echo '<string>' | php -nR '<code>' or test it online.
breakdown
SEARCH      EXPLANATION             REPLACE     EXAMPLE
            original string                     Hello
[a-z]       every letter            e           eeeee
(?<!e)e     first letter            B           Beeee
Be          first two letters       Bl          Bleee
e(?!e)      last letter if still e  t           Bleet

Revision 5: saved 9 bytes with Martin Ender´s regex chain.
(That also fixed cases with non-alphabetic word characters = digits/underscores.)

Haskell, 135 128 bytes
b"e"="B"
b"ee"="Bl"
b('e':_:_:e)="Bl"++e++"t"
b e=e
e!(l:t)|elem l$['a'..'z']++['A'..'Z']=('e':e)!t|1<3=b e++l:""!t
e!_=[]
(""!)

Try it online! Usage (""!) $ "some string". Without regexes, this turned out to be quite long, maybe some other approach is shorter. Edit: Saved 7 bytes thanks to @nimi!

Renaming function b to a you can apply it immediately when constructing the resulting string and omit the final =<<: b!(l:t)|...|1<3=a b++l:""!t;b!_=a b;(""!).

Doesn't work online for It's Jimmy's test  I get Bl'B Bleet'B

@cleblanc This requirement was added after my answer and invalidates most of the current answers ... let me ask the OP.

@Laikoni Right.  I came late to this game and the apostrophe is a particularly difficult exception to handle.

PHP, 84 Bytes
<?=preg_replace(["#[a-z]#i","#(?<!l)l#","#(?<=l)l#","#e(?!e)#"],[l,B,e,t],$argv[1]);

PHP, 117 Bytes
<?=preg_replace_callback("#[a-z]+#i",function($m){return substr(str_pad(Bl,-1+$l=strlen($m[0]),e).t,0,$l);},$argv[1]);

Save one byte with -1+$l=...

@Titus nice and I Have found a better solution

Zwei Dumme - ein Gedanke. :) But \bl fails for non-alphabetic word characters: _we_. You need an explicit assertion: (?<!l)l. Same for e\b -> e(?!e) (+7 bytes)

@Titus In the meantime it is myself noticed that my thought was wrong. And I love your german comment.

Perl 5, 47 bytes
Saved 15 bytes by using the same technique as Martin Ender's Retina answer. (This answer is basically a port of his answer now)
46 bytes of code + -p flag.
s/\pl/e/g;s/(?<!e)e/B/g;s/Be/Bl/g;s/e(?!e)/t/g

Try it online!

Older versions: 62 bytes:
s/\pl+/$l=length$&;$_=Bl.e x($l-3).t;chop while$l<y%%%c;$_/ge

And 68 bytes:
s%\pl+%$_=$&;s/./B/;s/.\K./l/;s/(?<=..).(?=.)/e/g;s/..\K.$/t/;$_%ge

C, 120 151 140 111 108 105 104 92 90 Bytes
Working for "It's Jimmy's test" --> Bl'B Bleet'B Blet
j;f(char*m){for(;*m=!isalpha(*m++)?j=0,*(m-1):"*Blet"[isalpha(*m)?j^3?++j:j:j>1?4:++j];);}

The output is now a side effect by destroying the original string.
main(c,v)char**v;{
    char test[] = "The End is near Fellows!";
    f(test);puts(test);
    char test2[] = "We praise the Goat God!";
    f(test2);puts(test2);
    char test3[] = "It's Jimmy's test";
    f(test3);puts(test3);
    char test4[] = "0te_st1";
    f(test4);puts(test4);
    char test5[] = "I have a pen";
    f(test5);puts(test5);
    char test6[] = "_0123456789_";
    f(test6);puts(test6);
}

I think it's correct at least now
Blt Blt Bl Blet Bleeeet!
Bl Bleeet Blt Blet Blt!
Bl'B Bleet'B Blet
0Bl_Bl1
B Blet B Blt
_012345678_

Jimmy?

@DLosc I haven't gone mad and died yet.

Python 2.7, 129 118 114 109 95 91 88 bytes
import re
s=re.sub
def f(i):print s(r"e\b","t",s("Be","Bl",s(r"\be","B",s("\w","e",i))))

Just an re.sub chain
Step by step
Example input: "We praise the Goat God!"

Alias sub so we can save bytes on repeated calls
import re
s=re.sub

Replace all word characters with "e"
s("\w","e",i)
Output: ee eeeeee eee eeee eee!
Replace all "e"s which are preceded by a word boundary (Beginning of word) with "B"
s(r"\be","B",s("\w","e",i))
Output: Be Beeeee Bee Beee Bee!
Replace all "Be" with "Bl"
s("Be","Bl",s(r"\be","B",s("\w","e",i)))
Output: Bl Bleeee Ble Blee Ble!
Replace all "e"s which are followed by a word boundary with "t"
s(r"e\b","t",s("Be","Bl",s(r"\be","B",s("\w","e",i))))
Output: Bl Bleeet Blt Blet Blt!

Welcome to PPCG! We allow functions to print their results, so replacing return with print should save a byte.

You can also remove the leading r from raw strings if they have no backlashes in them saving another 3 bytes

Thanks @ConorO'Brien ! I was able to simplify a piece of the regex (which ended up needing an r) and I got it down to 95 bytes. Thanks for the suggestion!

Alright I got it down to 88 bytes and I think that's the best I can do here

Python 3, 271 bytes
I am aware that this is rather long and I welcome suggestions on how to reduce the length.
def f(s):
 b=[];t='';f=[];a=list.append
 for c in s:
  if c.isalpha():t+='e'
  else:
   if t:a(b,t);t=''
    a(b,c)
 if t:a(b,t)
 for i in b:
  i=[*i]
  if i[0]=='e':
   i[0]='B';i[-1]=[i[-1],'t'][len(i)>2]
   if len(i)>2:i[1]='l'
  a(f,''.join(i))
 return ''.join(f)

Welcome to the site! I see a couple golfs you could make.  You can visit our tips page for a list of useful tips for golfing in Python.

instead of x.append(y) or in your case, a(x,y), you can do x+=y, (comma required)

Pip, 28 bytes
aR+XA{Y'eX#a-3\"Bl\yt\"@<#a}

Takes input as a command-line argument. Try it online!
Explanation
This was fun--I got to use regex modifiers and string interpolation.
                              a is 1st cmdline arg; XA is the regex `[A-Za-z]` (implicit)
aR                            In a, replace
   XA                          the regex XA
  +                            wrapped in (?:  )+
     {                     }  with this callback function:
          #a-3                 Length of argument - 3
       'eX                     Repeat e that many times (empty string if #a-3 is negative)
      Y                        Yank that string into the y variable
              \"Bl\yt\"        An escaped string, which interpolates the value of y
                       @<#a    Take first len(a) characters
                              After the replacement, the string is autoprinted

stacked, 57 bytes
'\l+'{!n size 2-:4\^5*1+3/\1<-4 tb 0\,'Blet'\#''join}repl

Try it online! Takes input from the top of the stack.
Let a(n) = A136412(n - 2) = (5 × 4n − 2 + 1) ÷ 3. Converting a(n) to base 4 yields:

a(3) = 134
a(4) = 1234
a(5) = 12234
a(6) = 122234
...

Mapping indices 0..3 to the string Blet, we get:

a(3) = lt
a(4) = let
a(5) = leet
a(6) = leeet
...

Now, prepending B gives us the desired string, given the length. Mostly. One just needs to handle the special cases for n ≤ 2. In my case, this is solved by subtracting (n − 2 < 1) as a numeric boolean (1 for "true" and 0 for "false").
As for the specifics of the answer:
'\l+'{! ... }repl
             repl    replace all
'\l+'                alphanumeric strings ("letters")
     {!     }        applying this function to the result.

Python 2, 137 114 bytes
def f(s,r='',l=-3):
 for c in s+'\0':
	if c.isalpha():l+=1
	else:r+=('Bl%st'%('e'*l))[:l+3*(l>=0)]+c;l=-3
 print r

Try it online!

Java 7, 201 bytes
String c(String s){String r="",z="e([^e]|$)";char p=0;int x;for(char c:s.toCharArray()){x=c&~32;p=x>64&x<91?p==66?'l':p>100&p<109?'e':66:c;r+=p;}return r.replaceAll("l"+z,"lt$1").replaceAll(z,"et$1");}

Not really happy with it, and can certainly be golfed some more..
Explanation:
String c(String s){               // Method with String parameter and String return-type
  String r="",                    //  The return-String
         z="e([^e]|$)";           //  Partial regex String that's used twice ('e' followed by non-'e' or nothing)
  char p=0;                       //  The previous character
  int x;                          //  Another temp value
  for(char c : s.toCharArray()){  //  Loop over the characters of the input String
    x = c&~32;                    //   Make every lowercase character uppercase (this returns an integer, hence the integer temp value, which is shorter than a cast to char)
    p = x>64 & x<91 ?             //   If the current character is a letter:
         p == 66 ?                //    And if the previous character is 'B':
          'l'                     //     Set the character value to 'l'
         : p>100&p<109 ?          //    Else if the previous character is either an 'e' or 'l':
            'e'                   //     Set the character value to 'e'
           :                      //    Else:
            66                    //     Set the character value to 'B'
         :                        //   Else (not a letter):
          c;                      //    Set the character to the current character
    r += p;                       //   Append the result-String with this character
  }                               //  End loop
  return r                        //  Return the result-String
    .replaceAll("l"+z,"lt$1")     //   After we've replaced all occurrences of "le." with "lt." (where "." can be anything else, including nothing at the end of a line)
    .replaceAll(z,"et$1")         //   And also replaced all occurrences of "ee." with "et." (where "." can again be anything else)
}                                 // End of method

Test code:
Try it here.
class M{
  static String c(String s){String r="",z="e([^e]|$)";char p=0;int x;for(char c:s.toCharArray()){x=c&~32;p=x>64&x<91?p==66?'l':p>100&p<109?'e':66:c;r+=p;}return r.replaceAll("l"+z,"lt$1").replaceAll(z,"et$1");}

  public static void main(String[] a){
    System.out.println(c("Hello, World!"));
    System.out.println(c("lorem ipsum dolor sit amet."));
    System.out.println(c("We praise the Goat God!"));
    System.out.println(c("I have a pen"));
    System.out.println(c("0123456789_"));
    System.out.println(c("0te_st1"));
  }
}

Output:
Bleeet, Bleeet!
Bleeet Bleeet Bleeet Blt Bleet.
Bl Bleeeet Blt Bleet Blt!
B Bleet B Blt
0123456789_
0Bl_Bl1

s.split("") instead of s.toCharArray() saves some I believe

@KritixiLithos I tried it, but then I have the issue of checking if the String is a letter (x=c&~32 won't work on a String, and x>64&x<91 both won't work anymore). If you can make it shorter with the split let me know, though.

05AB1E, 36 bytes
lDAsSå.¡€g£vyAySåPigÍ<'e×"Blÿt"yg£}J

Try it online!
or as a Test suite
Explanation
Prepare input:
lD                                    # convert input to lower-case and duplicate
  As                                  # push lower-case alphabet and swap input to the top
    Så                                # check each char in input for
                                      # membership in the alphabet
      .¡                              # split into chunks of equal elements
        €g                            # get length of each chunk
          £                           # split input into chunks of those lengths

This creates a list such as ['hello', ', ', 'world', '!']
 for the input Hello, World!
Iterate over list:
v                          # for each element in the list
 y                         # push current element
  AySåPi               }   # if all members of current element are letters
        gÍ<'e×             # repeat string "e" len(element)-3 times
              "Blÿt"       # replace "ÿ" with the e's in the string "Blÿt"
                    yg£    # take the first len(element) chars of the string
                        J  # join to string

sed -E, 58 bytes
Port of Martin Ender's Retina answer.
s/[a-z]/e/gi
s/(^|[^e])e/\1B/g
s/Be/Bl/g
s/e([^e]|$)/t\1/g

Attempt This Online!


text:
Calculate my reading speed
Create a program that calculates my reading speed!
The challenge
Write a program which takes some text as input and waits for a start signal from the user to display the input. When to user gives a second end signal, the program should output the reading speed of the user, which is defined as the number of words in the input divided by the time between both signals in minutes.
The word count of the input text is determined by splitting the text at white space.
Input

A block of text via any standard input means.
A start and end signal by the user, either a click or pressing a certain key of your choice.

Output

The block of input text.
The reading speed of the user as defined above.

Rules

The start and end signal may not be running and ending the program.
The text may wrap or the user may scroll.
The reading speed value may be returned in any of the standard methods in the meta post found here, though the text must be displayed beforehand to the user, e.g. by printing to stdout.
This is code-golf, so the shortest code in bytes wins.

the time in minutes my guess is that most people can read this in less than a minute, so maybe seconds would work the best.

@zeppelin yeah but then the point of Words per minute is ruined

It would change the calculate to words per second

All of these comments and questions are why we strongly encourage people to use the Sandbox.

@AdmBorkBork I normally do but I thought that for once I could not Sandbox something for a simple challange

@Christopher2EZ4RTZ Goes to show this is (virtually) impossible. Better now than later, though!

MATL, 24 bytes
O$Y.Y`OYDtDYbn60*O$Y.Z`/

Explanation
O$Y.    % Wait for the user's keypress
Y`      % Start the timer
        % Implicitly grab the input
OYD     % Converts control characters and creates a string
tD      % Duplicate the string and display
Ybn     % Split the string into words and count them
60*     % Multiply by 60 to convert words per second to words per minute
O$Y.    % Wait for user to press a key
Z`      % Get the elapsed time in seconds
/       % Divide the number of words (times 60) by the time in seconds
        % Implicitly display the result

Octave, 59 bytes
pause;tic;disp(x=input(''));pause;numel(strsplit(x))*60/toc

Explanation
pause               % Wait for a user's keypress
tic                 % Start the timer
disp(..)            % Display paragraph
pause;              % Wait for user's keypress
numel(strsplit(x))  % Determine number of words
*60                 % Multiply by 60 to convertwords per second to words per minute
/toc                % Divide by the total time that it took (in seconds)

Processing Js 77 bytes
var i="",b=second();println(i);i.split(" ");keyTyped=function(){println(i.length/(second()-b));};

Try it out

source: Stack Exchange

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

sort: votes


text:
Pali-n-drome this List
The challenge here is to extend an implementation of palindrome given the following as inputs:

n > 1 and a list l.

Your program must palindrome the list both vertically and horizontally, that is to say it must first palindrome the list itself, then each element in the list after; or the other way around. Before palindromization, all elements are ensured to be equal length. The palindrome action is then to be performed n times in sequence until the desired output is met. The easiest way to show the expected outputs is just to run through a few examples:

One iteration performed on [123,456,789]:
First you palindromize the list to [123,456,789,456,123].

While this is not a palindrome if joined together, it is a palindrome in terms of the list.
[a,b,c] became [a,b,c,b,a], so the LIST was palindromized.

Then, you palindromize each list element [12321,45654,78987,45654,12321].
This is how each iteration is performed, it's essentially an omnidirectional palindrome.

Given n=1 and l=[123,456,789]:
12321
45654
78987
45654
12321

Given n=2 and l=[123,456,789]
123212321
456545654
789878987
456545654
123212321
456545654
789878987
456545654
123212321

Given n=1 and l=[3,2,1]:
3
2
1
2
3

Given n=2 and l=["hat","mad"," a "]:
hatahatah
madamadam
 a a a a
madamadam
hatahatah
madamadam
 a a a a
madamadam
hatahatah

Given n=2 and l=[" 3  ","2000"," 100"]:
 3   3 3   3
2000002000002
100 00100 001
2000002000002
 3   3 3   3
2000002000002
100 00100 001
2000002000002
 3   3 3   3

Given n=4 and l=["3 ","20","1 "]:
3 3 3 3 3 3 3 3 3
20202020202020202
1 1 1 1 1 1 1 1 1
20202020202020202
3 3 3 3 3 3 3 3 3
20202020202020202
1 1 1 1 1 1 1 1 1
20202020202020202
3 3 3 3 3 3 3 3 3
20202020202020202
1 1 1 1 1 1 1 1 1
20202020202020202
3 3 3 3 3 3 3 3 3
20202020202020202
1 1 1 1 1 1 1 1 1
20202020202020202
3 3 3 3 3 3 3 3 3
20202020202020202
1 1 1 1 1 1 1 1 1
20202020202020202
3 3 3 3 3 3 3 3 3
20202020202020202
1 1 1 1 1 1 1 1 1
20202020202020202
3 3 3 3 3 3 3 3 3
20202020202020202
1 1 1 1 1 1 1 1 1
20202020202020202
3 3 3 3 3 3 3 3 3
20202020202020202
1 1 1 1 1 1 1 1 1
20202020202020202
3 3 3 3 3 3 3 3 3

Given n=3 and l=["_|__","__|_","___|"]:
_|___|_|___|_|___|_|___|_
__|_|___|_|___|_|___|_|__
___|_____|_____|_____|___
__|_|___|_|___|_|___|_|__
_|___|_|___|_|___|_|___|_
__|_|___|_|___|_|___|_|__
___|_____|_____|_____|___
__|_|___|_|___|_|___|_|__
_|___|_|___|_|___|_|___|_
__|_|___|_|___|_|___|_|__
___|_____|_____|_____|___
__|_|___|_|___|_|___|_|__
_|___|_|___|_|___|_|___|_
__|_|___|_|___|_|___|_|__
___|_____|_____|_____|___
__|_|___|_|___|_|___|_|__
_|___|_|___|_|___|_|___|_

Given n=2 and l=["---|---","__|","___|","____|"]:
---|-----|-----|-----|---
  __|   |__   __|   |__
 ___|   |___ ___|   |___
 ____| |____ ____| |____
 ___|   |___ ___|   |___
  __|   |__   __|   |__
---|-----|-----|-----|---
  __|   |__   __|   |__
 ___|   |___ ___|   |___
 ____| |____ ____| |____
 ___|   |___ ___|   |___
  __|   |__   __|   |__
---|-----|-----|-----|---

Rules

n will always be greater than 1.
l will always have more than 1 element.
All elements of l are the same length.
This is code-golf shortest solution will be marked as winner.

This would be a better challenge if we didn't have to pad elements.

@JonathanAllan it's an omnidirectional palindrome, or 2D palindrome you could say. I've updated the description; also, the padding prevents a few odd fringe cases where a smaller string is already a palindrome.

@JonathanAllan it is in terms of the list, if you are looking at the LIST as the item to be palindromized. Just like [@1,@2,@1] is also a palindrome when looking at it as a list, not by the elements...

@JonathanAllan yeah, essentially, you can look at it like that if you want.

@mbomb007 changes made, fair enough.

Last example requires padding.

Related

Is it n>1 or n>0?

05AB1E, 4 bytes
Note that if only a single iteration was required (n=1), then the program would be the palindrome û€û.
Fû€û

Try it online
F       Do n times
 û      Palindromize the list
  €û    Palindromize each element in the list

If padding the input was still a required part of the program (11 bytes):
€R.B€RIFû€û

I couldn't find a shorter way to right-justify. Left-justification and centering were all easy, but this was longer for some reason. Using E or ² instead of I also works.

Python 2, 71 63 bytes
lambda x,n,f=lambda x:x+x[-2::-1]:eval('f(map(f,'*n+`x`+'))'*n)

Try it online!
Assign a palindrome function to f, generate and evaluate the following pattern (for n=4)
f(map(f,f(map(f,f(map(f,f(map(f,<input>))))))))

I think you mean assign. I don't think assing is a verb, lol.

@mbomb007 welp, time to get more coffee~

Jelly, 6 bytes
ŒḄŒB$¡

Dyadic link, or full program taking the list and n.
Try it online!
Using both versions of Lynn's fantastic built-in "bounce".
ŒḄŒB$¡ - Main link: l, n
     ¡ - repeat n times
    $  -     last two links as a monad (firstly with l then the result...)
ŒḄ     -         bounce ("palindromise") the list
  ŒB   -         bounce the elements

Python 2, 64 bytes
h=lambda a:a+a[-2::-1]
f=lambda a,n:n and f(h(map(h,a)),n-1)or a

Try it online! - footer prints each of the elements of the resulting list, one per line, a "pretty print".
h is the palindomisation function, it appends to the input, all the elements of a list from the last but one, index -2, to the start in steps of size -1.
f calls h with the result of calling h on each element in turn, reduces n by one and calls itself until n reaches 0, at which point a is the finished product.

...and I am still forgetting the f= for recursive functions, one day I'll remember.

APL, 15 bytes
(Z¨Z←⊢,1↓⌽)⍣⎕⊢⎕

Explanation:

(...)⍣⎕⊢⎕: read the list and N as input, and run N times:

⊢,1↓⌽: the list, followed by the tail of the reversed list
Z←: store this function in Z
Z¨: and apply it to each element of the list as well

Test:

          (Z¨Z←⊢,1↓⌽)⍣⎕⊢⎕
    ⎕:
          'hat' 'mad' ' a '
    ⎕:
          2
    ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
    │hatahatah│madamadam│ a a a a │madamadam│hatahatah│madamadam│ a a a a │madamadam│hatahatah│
    └─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘

Groovy, 66 bytes
{x,n->f={z->z+z[z.size()-2..0]};n.times{x=f(x).collect{f(it)}};x}

Haskell, 51 bytes
x%n=iterate((++)<*>reverse.init)x!!n
x?n=(%n)<$>x%n

Usage example: ["123","456","789"] ? 1 ->
["12321","45654","78987","45654","12321"]. Try it online!.
(++)<*>reverse.init makes a palindrome out of a list, iterate(...)x repeats this again and again and collects the intermediate results in a list, !!n picks the nth element of this list. (%n)<$>x%n makes a n-palindrom of each element of the n-palindrome of x.

JavaScript (ES6), 87 bytes
f=(n,l,r=l=>[...a].reverse().slice(1))=>n--?f(l.concat(r(l)).map(s=>s+r(s).join``),n):l

Pip, 25 bytes
24 bytes of code, +1 for -l flag.
Lq{gM:_.@>RV_gAL:@>RVg}g

Takes the list as command-line arguments and the number n from stdin. Try it online!
Explanation
                          g is list of cmdline args (implicit)
Lq{                   }   Read a line of input and loop that many times:
      _.@>RV_             Lambda function: take all but the first character (@>) of the
                           reverse (RV) of the argument (_), and concatenate that (.) to
                           the argument (_)
   gM:                    Map this function to g and assign the result back to g
                 @>RVg    Take all but the first element of the reverse of g
             gAL:         Append that list to g and assign the result back to g
                       g  After the loop, print g (each item on its own line due to -l)

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


text:
[Br]eaking Code Golf [Ba]d
Consider the following string:
Tin Snips

This string contains several atomic symbols on the periodic table. We could rewrite this string to identify several of them:
[Ti][N] [Sn][I][P][S]

Of course, we could also write it this way:
T[In] [S][Ni][P][S]

The rules for rewriting the input are as follows:

The case of the input does not matter in terms of matching atomic symbols.
If an element is used in an atomic symbol, its case must change so the symbol is correct. Ex: h would become [H].
All element symbols are encased in ASCII square brackets, [ and ].
Whitespace is preserved: Big ego cannot combine the "g" and "e" into [Ge].
Not all input characters need be combined into an atomic symbol: if an input character is not put into a symbol, it is passed through as-is (case does not matter).
If a symbol can be made, it must be made. In other words, it is not allowed to output Tin in the above example because it is possible to create at least one symbol in that word. The only time a character may be passed through unused is when it cannot be used to construct an atomic symbol.
For the purposes of this challenge, all elements from Hydrogen (1) to Oganesson (118) are valid. No higher elements are valid.
Some of the higher elements have ambiguous names and symbols: for the purposes of this challenge, the version at Wikipedia shall be used. For convenience, the allowable atomic symbols are here: H, He, Li, Be, B, C, N, O, F, Ne, Na, Mg, Al, Si, P, S, Cl, Ar, K, Ca, Sc, Ti, V, Cr, Mn, Fe, Co, Ni, Cu, Zn, Ga, Ge, As, Se, Br, Kr, Rb, Sr, Y, Zr, Nb, Mo, Tc, Ru, Rh, Pd, Ag, Cd, In, Sn, Sb, Te, I, Xe, Cs, Ba, La, Ce, Pr, Nd, Pm, Sm, Eu, Gd, Tb, Dy, Ho, Er, Tm, Yb, Lu, Hf, Ta, W, Re, Os, Ir, Pt, Au, Hg, Tl, Pb, Bi, Po, At, Rn, Fr, Ra, Ac, Th, Pa, U, Np, Pu, Am, Cm, Bk, Cf, Es, Fm, Md, No, Lr, Rf, Db, Sg, Bh, Hs, Mt, Ds, Rg, Cn, Nh, Fl, Mc, Lv, Ts, Og.

Write a program or function that generates all possible outputs from a single provided input. Both input and output may be in any form of your choosing. This could be a string, array of characters, or some other data structure: whatever is both convenient and clearly represents the input and output. Both input and output may be passed in/out of your code however you choose: standard in/out, function argument/return, or something else.

Input shall be a string (see previous paragraph) of positive length containing only ASCII characters of arbitrary case and the space (0x20) character.
Your code must generate all output strings that can be created using the input rules above.
The order of the output is implementation-defined. The only requirement is that all output strings are present.
If presented with a valid input string that does not contain any atomic symbols, simply output the input string.
If presented with an input string that is not valid per the rules above (null, zero characters, contains illegal characters, etc.) your program may do anything (crash, blank output, etc.)
Output is case-insensitive other than atomic symbols needing to match the periodic table.
Standard loopholes not allowed.

Test cases:
Tin Snips
[Ti][N] [Sn][I][P][S]
[Ti][N] [S][Ni][P][S]
[Ti][N] [S][N][I][P][S]
T[In] [Sn][I][P][S]
T[In] [S][Ni][P][S]
T[In] [S][N][I][P][S]
T[I][N] ...

Quack
Q[U][Ac][K]
Q[U]a[C][K]

hehe
[H]e[H]e
[H]e[He]
[He][H]e
[He][He]

Stack Exchange
[S][Ta][C][K] Ex[C][H]a[N][Ge]
[S]t[Ac][K] Ex[C][H]a[N][Ge]

This is code golf, so let me see your shortest code!

Per @Rassars comment Tin would be T[I][N] not [T][I][N] because T is not an element. My question (and possibly Rassar's) is:  do we only have to give 1. Only outputs where the maximium number of element subsitutions are made? 2. Only the minimum amount of wastage? (The HeHe with hydrogens indicates the answer to this one is no) 3. All outputs where matches are completely exhausted? (in this case T[I][N] as well as T[In] would be valid.) I think the correct interpretation is 3.

@LevelRiverSt you are correct, give each unique output where no letters are passed through that can be combined into an atomic symbol. So both T[I][N] and T[In] work, but T[I]n does not because the n can be worked into an atomic symbol.

I think this is a dup

So there are 2 possibilities for Quack: Q[U][Ac][K] and Q[U]a[C][K].  RIght?

@DigitalTrauma It's definitely related, but I don't think it's a dupe. The use of a wordlist as opposed to input in the other one differentiates it, plus the lack of strict specification on what versions of the ambiguous atomic symbols are to be used make the other one unclear and thus not a good dupe target.

Fixed Quack and Stack exchange cases.

Checking other test cases for possibilities...

All cases verified.

@CalculatorFeline thank you! I was going to do that when I had time but you beat me to it.

You're welcome :D Here's the verifier link. It outputs all elements that can fit into the input. Might miss a few errors (ones with no new elements), but the only way to solve that is to answer this question :P

What if you greedily find a short one and then fail to find a longer one? For example, for Heads, you might do [H]ea[Ds] rather than [He]a[Ds]?

@Challenger5 "Your code must generate all output strings that can be created using the input rules above"

Python 3, 289 263 bytes
Found a more complete library on Pypi: mendeleev
from mendeleev import*
Z={element(i).symbol for i in range(1,119)}
L,R='[]'
def f(h,r=''):t=h.title();return((Z&{t[0]}and f(h[1:],r+L+t[0]+R)or[])+(Z>{(t+L)[:2]}and f(h[2:],r+L+t[:2]+R)or[])+(not{(r[-1:]+t[0]).title(),t[0]}&Z and f(h[1:],r+h[0])or[]))if h else[r]

Old answer:
from elements import*
Z={e.symbol for e in ELEMENTS}|{*'Cn Ds Fl Lv Mc Nh Og Rg Ts'.split()}
L,R='[]'
def f(h,r=''):t=h.title();return((Z&{t[0]}and f(h[1:],r+L+t[0]+R)or[])+(Z>{(t+L)[:2]}and f(h[2:],r+L+t[:2]+R)or[])+(not{(r[-1:]+t[0]).title(),t[0]}&Z and f(h[1:],r+h[0])or[]))if h else[r]

Uses a library elements.py from http://www.lfd.uci.edu/~gohlke/code/elements.py.html.  It is missing elements 110 to 118, but it was the most up to date library I could find. Cost 40 bytes to add the missing elements.
The trickiest part was the logic for when a character can be passed through without being part of an element symbol.

Uhh wait, wasn't mendeleev a user, not a library?

Jelly,  192  191 bytes
-1 by use of Ɗ (a since-developed quick)
“¦UV2ḤF2ı½ṅḶḊ⁼5JI5MẇvẋẊẊ¬Ḥḳ'ƈ<ḷėƤ7*⁾ṾxMæS⁺`?^Ƭb¦ɗDß⁼pþɲOṃ⁽2Ė>,Ḣ(ḞŒƊOGƤ×⁺ṇṂ®ȤT0y°^Ẇ⁺:Þ]ṢṬ¶ịṪḂƇ ñAƬCṫ$wÆĿĖỴỴƇẓƊqḌ@;ẏ`ṃFƥḣ⁽²»ḟ⁶s2;“¤²R.ȯ7ŒL£ɦ»Œt
Œte¢
ŒṖµL€=1oÇ€ṂµÐfµṡ2;€ÇÐfÇ€€S€¬SµÐḟ⁾[]jŒtƊ¹Ç?€€

Try it online! - Too inefficient for the "Stack Exchange" test case to complete within the 60s limit (running it offline gives the correct result within 2 minutes).
How?
The first line of code is a niladic link to create a list containing all 118 element symbols. To do so it concatenates two lists, the first containing all length 2 lists of characters (i.e. strings) the second a list of characters and title cases the resulting list. The two lists themselves are created mostly by looking up words in Jelly's dictionary to make single strings.
The first of these compressions is:
“¦UV2ḤF2ı½ṅḶḊ⁼5JI5MẇvẋẊẊ¬Ḥḳ'ƈ<ḷėƤ7*⁾ṾxMæS⁺`?^Ƭb¦ɗDß⁼pþɲOṃ⁽2Ė>,Ḣ(ḞŒƊOGƤ×⁺ṇṂ®ȤT0y°^Ẇ⁺:Þ]ṢṬ¶ịṪḂƇ ñAƬCṫ$wÆĿĖỴỴƇẓƊqḌ@;ẏ`ṃFƥḣ⁽²»

which yields
" biznagas sepmag ratbag catchflies paracmes mdse bharal ramcat monopteros irrepressibilities lunarnauts geniculate hopbinds rutabaga potlache broghs bergamas crossbirth purblind xebecs nonhardy classism fleurets moneybag scarce corf Mg Sr Zr CD HG CF FM Lr SG TM Gd Bk Fr Rh Fe Sn lv cndbmnnbkrmtpdnp"

Where all but the final entry (split by spaces) are entries in Jelly's dictionary. The spaces are filtered out with ḟ⁶, and then the result is split into twos:
["bi","zn","ag","as","se","pm","ag","ra","tb","ag","ca","tc","hf","li","es","pa","ra","cm","es","md","se","bh","ar","al","ra","mc","at","mo","no","pt","er","os","ir","re","pr","es","si","bi","li","ti","es","lu","na","rn","au","ts","ge","ni","cu","la","te","ho","pb","in","ds","ru","ta","ba","ga","po","tl","ac","he","br","og","hs","be","rg","am","as","cr","os","sb","ir","th","pu","rb","li","nd","xe","be","cs","no","nh","ar","dy","cl","as","si","sm","fl","eu","re","ts","mo","ne","yb","ag","sc","ar","ce","co","rf","Mg","Sr","Zr","CD","HG","CF","FM","Lr","SG","TM","Gd","Bk","Fr","Rh","Fe","Sn","lv","cn","db","mn","nb","kr","mt","pd","np"]

The second,
“¤²R.ȯ7ŒL£ɦ»

is formed from the concatenation of the words "finch", "pub", "sky", and "vow" (without spaces), and as such is a list of characters:
['f','i','n','c','h','p','u','b','s','k','y','v','o','w']

The two lists are concatenated with ; and every entry is title-cased using Œt, yielding:
["Bi","Zn","Ag","As","Se","Pm","Ag","Ra","Tb","Ag","Ca","Tc","Hf","Li","Es","Pa","Ra","Cm","Es","Md","Se","Bh","Ar","Al","Ra","Mc","At","Mo","No","Pt","Er","Os","Ir","Re","Pr","Es","Si","Bi","Li","Ti","Es","Lu","Na","Rn","Au","Ts","Ge","Ni","Cu","La","Te","Ho","Pb","In","Ds","Ru","Ta","Ba","Ga","Po","Tl","Ac","He","Br","Og","Hs","Be","Rg","Am","As","Cr","Os","Sb","Ir","Th","Pu","Rb","Li","Nd","Xe","Be","Cs","No","Nh","Ar","Dy","Cl","As","Si","Sm","Fl","Eu","Re","Ts","Mo","Ne","Yb","Ag","Sc","Ar","Ce","Co","Rf","Mg","Sr","Zr","Cd","Hg","Cf","Fm","Lr","Sg","Tm","Gd","Bk","Fr","Rh","Fe","Sn","Lv","Cn","Db","Mn","Nb","Kr","Mt","Pd","Np","F","I","N","C","H","P","U","B","S","K","Y","V","O","W"]

A list containing all 118 element symbols as required (there are duplicates, but that's fine).
The second line of code is a monadic link (a helper function designed to take one input) that returns a 1 if the input, titled-cased exists in the list created above and a 0 otherwise.
The third line of code is the main link, a monadic function that takes a string and returns a list of lists of characters (i.e. strings) as required:
ŒṖµL€=1oÇ€ṂµÐfµṡ2;€ÇÐfÇ€€S€¬SµÐḟ⁾[]jŒtƊ¹Ç?€€ - Main link: s
ŒṖ                                           - all partitions of s
  µ        µÐf                               - filter keep:
   L€=1                                      -     length €ach equals (vectorises) 1
       o                                     -     or
        Ç€                                   -     last link as a monad (is an element when title-cased)
          Ṃ                                  -     minimum
                                             - (i.e. all partitions that are all single characters OR are strings that when title-cased are elements)
              µ              µÐḟ             - filter discard:
               ṡ2                            -     slices of length 2
                 ;€                          -     concatenate €ach
                    Ðf                       -     filter keep:
                   Ç                         -         last link as a monad (is an element when title-cased)
                      Ç€€                    -     last link as a monad for €ach for €ach
                         S€                  -     sum €ach
                           ¬                 -     logical not
                            S                -     sum
                                             - (i.e. discard any partitions that contain a run of two that joined together and title-cased ARE an element but separately NEITHER are)
                                         ?€€ - if then else for €ach (partition) for €ach (part):
                                        Ç    -     IF: last link as a monad (is an element when title-cased)
                                             -   THEN:
                                      Ɗ      -         last three links as a monad:
                                ⁾[]                      "[]"
                                   j         -           joined by:
                                    Œt       -           title case the part
                                             -   ELSE:
                                       ¹     -         the part itsef (¹ is the identity atom)

C++11, 944 928 bytes
Here's a piece of truly terrible code, but it should work. Could still be made a lot shorter probably.
#import<iostream>
#import<set>
using namespace std;int r,i;set<string>O;S(string&s){s[0]-=s[0]>90?32:0;if(s[1])s[1]+=s[1]<91?32:0;char*l="HHeLiBeBCNOFNeNaMgAlSiPSClArKCaScTiVCrMnFeCoNiCuZnGaGeAsSeBrKrRbSrYZrNbMoTcRuRhPdAgCdInSnSbTeIXeCsBaLaCePrNdPmSmEuGdTbDyHoErTmYbLuHfTaWReOsIrPtAuHgTlPbBiPoAtRnFrRaAcThPaUNpPuAmCmBkCfEsFmMdNoLrRfDbSgBhHsMtDsRgCnNhFlMcLvTsOg";for(r=0;*l++;)if(*l>90){if(*(l++-1)==s[0]&&*(l-1)==s[1])r=1;}else if(*(l-1)==s[0]&&!s[1])r=1;}P(set<string>*V,string s,string o,int b,int l=0,int m=0){if(!s[b])O.insert(o);else if(l)P(V,s,o,b+1);else if(V[b].size()==0)P(V,s,o+s[b],b+1);else for(auto t:V[b]){P(V,s,o+"["+t+"]",b+1,t.length()-1);if(t.length()>1&&V[b].size()==1&&V[b+1].size()>0&&!m)P(V,s,o+s[b],b+1,0,1);}}F(string s){set<string>V[s.length()];for(i=0;s[i++];){string t="";t+=s[i-1];S(t);if(r)V[i-1].insert(t);t+=s[i];S(t);if(r&&s[i])V[i-1].insert(t);}P(V,s,"",0);for(auto o:O)cout<<o<<"\n";O.clear();}

Call with:
int main()
{
    F("Tin Snips");cout << "\n";
    F("Quack");cout << "\n";
    F("hehe");cout << "\n";
    F("Stack Exchange");
}


text:
Create every combination of variable groups up to order n
SPECIFICATION
Given m variables, create every combination up to order n. For example,
The output of mapping two variables (a and b) to order 1 would be:

a
b
a b

The output of mapping two variables (a and b) to order 2 would be:

a
a2
b
b2
a b
a2 b
a b2
a2 b2

The output of mapping two variables (a and b) to order 3 would be:

a
a2
a3
b
b2
b3
a b
a2 b
a3 b
a3 b2
a b2
a b3
a2 b3
a2 b2
a3 b3

The output of mapping three variables (a, b, and c) to order 1 would be:

a
b
c
a b
b c
a c
a b c

The output of mapping m variables to order n would be:

etc.

WINNING CRITERIA
Output every possible combination as outlined above. Order does not matter. Where in your code you print to the screen does not matter. All that matters is that what shows up in your output is correct.

How are we intended to output?  Should we use ^?

Can we raise things to the zero or one (e.g. a^1)

What if m is greater than 26? do we have to support values that high?

You can use anything to indicate the order but ^ would probably be easier for a console application. The app shouldn't actually do the calculation, it should just print x^2. So, while raising to 0 is okay, it should print x^0, not 1. If the application is limited to only printing the order up to some number that is fine, as long as the algorithm itself is capable of printing to an arbitrary order.

@user1873073 the problem isn't the maximum order but the maximum number of variable names.

It should be able to handle an arbitrary number of variables as well. So in that case aa,bb,cc or 27,28,29, or whatever convention you might choose is fine.

What are we expected to do when the number of variables is greater than the number of letters?

How will the variables be given? many of the comments assume the input will be a number of variables, but the text given m variables implies a list of variables will be given. If only the number of variables is given and 0,1,2,3..27,28,29 raised to powers ^0,^1,^2 etc is acceptable output (as I am inferring from your last comment) it makes things easier.

Is it ok to output aa instead of a^2?

@LevelRiverSt sorry if this response doesn't answer your question. The input is an array of characters. So the ^n is just for decoration for the purpose of this assignment.

@DigitalTrauma yep, thats fine. Any convention you choose is fine as long as it does the job.

unmarked it. didn't know how these things are supposed to work.

@user1873073 The input is an array of characters.  So is the input 2 a,b,c acceptable for the n=2, m=3 case?  If so, I can simplify my answer.

@DigitalTrauma yeah, of course. im amazed btw.

Brachylog, 6 bytes
j₎o⊇ᵘb

Takes input as a couple, containing the list of variables and the order. Output is a list of lists of variables, where powers are represented by repeated variables. (e.g. "a²b" is ["a","a","b"])
Try it online!
j₎ joins the first input with itself as many times as stated by the second input. o orders the list obtained, and then ⊇ᵘ finds all unique subsets of that ordered list. Finally, we remove the first element with b, since this will always be the empty answer, which is not contemplated by the challenge.

LATEX, 354 bytes
When I saw this I knew it had to be done in Latex.  Equations just look so crisp and clean in Latex and I can't stand using ^ for power.
\documentclass{article}\input tikz\usepackage{intcalc}\usepackage{ifthen}\begin{document}\typein[\a]{}\typein[\b]{}\foreach\x in{1,...,\intcalcPow{\b+1}{\a}}{\begin{equation}\foreach[count=\i]\y in{a,...,z}{\ifthenelse{\(\i<\a\)\OR\(\i=\a\)}{\y^\intcalcDiv{\intcalcMod{\x}{\intcalcPow{\b+1}{\i}}}{\intcalcPow{\b+1}{\i-1}}}{}}\end{equation}}\end{document}

Explanation
There are three main forces at work here \typein  which is what allows us to take input from the command line, the intcalc package which is what allows us to make calculations with our variables, and the Latexequation environment.

Once we have taken in input we begin a loop we loop \intcalcPow{\b+1}{\a} times, once for each result we want to print.  Each loop we begin an equation environment and loop through the alphabet keeping track of \y for the current letter and \i for the current number of runs.  If \i is greater than or equal to \a we don't print anything at all (according to the specs this is not strictly necessary however Latex will overflow for values greater than 1 if we don't do this).  We then print \y to our equation and raise it to the power of
\intcalcDiv{\intcalcMod{\x}{\intcalcPow{\b+1}{\i}}}{\intcalcPow{\b+1}{\i-1}}

That whole mess simply means take the \ith digit of \x in base \b+1.  This ensures that the powers are decoded properly.
Example output:
Here is the output for 3, 2

Note that your output includes a^0 b^0 c^0 = 1, while the test cases do not. That being said, I think you're right and the test cases are wrong :)

@GregMartin Yes, mathematically speaking the empty set should be in the https://en.wikipedia.org/wiki/Power_set

@KarlNapf An expression equal to 1 is not the empty set. Nor is a tuple containing 3 zeros.

@jpmc26 Yes, not in the specification of this golf. It is like the powerset of (for n=3) {a,a,a,b,b,b,c,c,c} without the empty set

@KarlNapf It's mathematically not the same. There is no empty set involved here. The challenge involves generating a set of tuples of specified length.

@jpmc26 Powerset of {a,b} is { {}, {a}, {b}, {ab} } and this challenge states for {"ab",1} -> {{a}, {b}, {ab}} which is the powerset without the empty set.

@KarlNapf The power set of {a, b} does not include a^2 b^2. It's not the appropriate model for this problem. Also, it just sunk in that you used {a,a,a,b,b,b,c,c,c} above. That's not a set, since sets can't contain duplicates. This problem is best modeled as m-tuples (tuples of length m, where m is the number of variables as in the question) of integers, which each member of the tuple representing the power of one of the variables.

@jpmc26 That is way i said "like the powerset". There is a multiset or a family which is an unordered tuple or a set that may contain duplicates. A powerset of this without the empty set is this challenge.

Mathematica, 51 50 bytes
Rest[1##&@@@PowerRange[1,#^#2,#]~Distribute~List]&

Assumes "given m variables" means the first input is a list of variables.
If first input is an integer, 69 bytes
Rest[1##&@@@PowerRange[v=Unique[]~Table~#;1,v^#2,v]~Distribute~List]&

The variables are in the form $<integer> (e.g. $5)

TIL PowerRange is a thing! I agree with the interpretation of your first submission btw

Haskell, 71 58 54 53 bytes
n#m=tail$concat<$>mapM(\x->(\i->x<$[1..i])<$>[0..n])m

Returns a list of strings and uses the output format "aabbb" for "a^2 b^3".
Usage example: 3 # "ab" -> ["b","bb","bbb","a","ab","abb","abbb","aa","aab","aabb","aabbb","aaa","aaab","aaabb","aaabbb"]. Try it online!.
Many bytes are spent for output formatting. A more flexible output, e.g. pairs of (variable, power) -> [('a',2),('b',3),('c',1)] for "a^2 b^3 c^1" would save a lot.
How it works
    mapM(\x->    )m      -- for each variable x in the input list m
      \i->x<$[1..i]      -- make i copies of x
             <$>[0..n]   -- for all numbers from 0 to n
                         -- in fact mapM makes all possible combinations hereof, i.e.
                         -- [["",""], ["", "b"], ["", "bb"] ... ["a",""], ["a","b"], ...]
  concat<$>              -- join all inner lists
                         --    e.g ["aa","bbb"]  -> "aabbb"
tail                     -- drop the first (all powers = ^0)

With maximum flexibility, i.e. output format as (variable, power) pairs and including all-zero powers ("a^0 b^0 c^0") it boils down to
Haskell, 25 bytes:
f n=mapM((<$>[0..n]).(,))

Usage example: f 2 "ab":
[[('a',0),('b',0)],
 [('a',0),('b',1)],
 [('a',0),('b',2)],
 [('a',1),('b',0)],
 [('a',1),('b',1)],
 [('a',1),('b',2)],
 [('a',2),('b',0)],
 [('a',2),('b',1)],
 [('a',2),('b',2)]]

Dropping all-zero powers costs 5 bytes for a total of 30: f n=tail.mapM((<$>[0..n]).(,)).

For your second code, [('a',0),('b',0)] should not be in the output...

@JungHwanMin: my 25-byte solution is not meant to be an answer. It's a note to show that the combinatoric part of the challenge needs the least number of bytes - at least in Haskell. Dropping a^0 b^0 costs 5 bytes. I'll add another note.

Jelly, 20 17 bytes
ṗj€“”Ṣ€
ŒPçÐ€j“”Q

A dyadic link (function) that accepts a list of variable names* and the maximal order (an integer) and returns a list where each entry is a fully expanded representation of the multiplication (e.g. foo0bar3bof2 would be ['bar', 'bar', 'bar', 'bof', 'bof'].
* the variable names may be a string of unique characters (strings become lists of characters).
Try it online! - the footer calls the link as a dyad and then separates the resulting list of lists by line feeds and each entry by spaces for ease of reading.
Note: includes the 0 order (empty product) a dequeue, Ḋ, may be inserted here ...ŒPḊç... to avoid that.
How?
ṗj€“”Ṣ€ - Link 1, sorted results of a Cartesian power: elements, power
ṗ       - Cartesian power of elements with given power
 j€“”   - join €ach with "" (flatten each by one level)
     Ṣ€ - sort €ach

ŒPçÐ€j“”Q - Main link: variableNames, maximalOrder
ŒP        - power-set of variableNames (e.g for ['a','b','c'] this would be ['','a','b','c','ab','ac','bc','abc'])
   Ð€     - for €ach mapped over right argument (i.e. over the range [1,2,...,maximalOrder])
  ç       -     call the last link (1) as a dyad (i.e. power-set results are the elements and one of the range values is the power)
     j“”  - join with "" (flatten by one level)
        Q - unique values

13 byte version that will only work for a single string of unique characters (or a list of unique characters):
ŒPṗÐ€j“”F€Ṣ€Q

try it

Mathematica 100 bytes
Surely there is a more efficient way to accomplish this!
Two variables to order 4:
(Times@@@(MapThread[Power,#]&/@Outer[List,{Alphabet[][[1;;#]]},Rest@Tuples[Range[0,#2],#],1][[1]])) &

Bash + sed, 60
A different, shorter approach to my previous answer.
Input as command-line parameters - m is given as a comma-separated list of variable names, and n as an integer:
p=eval\ printf
$p -vc %s {$1}^\\{0..$2}
$p '%s\\n' $c|sed 1d

Try it online.

Previous Answer:
Bash + coreutils, 91
Welcome to eval-escape-brace hell.  Sometimes shell-script really gives just the right tool for the job.  This is not the case here, but it works.
Input as command-line parameters - m is given as a comma-separated list of variable names, and n as an integer.  Output is written out longhand - e.g. a^2 is actually written aa.  This is acceptable as per this comment.
p=eval\ printf
$p -vc {%$[$2-1]s}
$p '%s\\n' $($p %s \{{$1}${c// /,}\\\,})|tr -d {}|sort -u

There may be shorter ways to do this.
Try it online.
Explanation

printf -vc {%$[$2-1]s} assigns the variable c to a string like {   }, where the number of spaces is the order n - 1, so if n = 1, the result is {}, if n = 2, the result is { }, etc.
${a[$1]} uses m as an index to the array a, so if m is 3, then the result is c
\{{a..${a[$1]}}${c// /,}\\,} is a multi-part brace expansion:

\{ - a literal {
{$1} is a is the brace expansion of the list m, e.g. {a,b,c} or a b c
${c// /,} replaces the spaces in $c with commas, e.g. {,,} for n = 3, which is also a brace expansion which effectively repeats each element of {a..c} n times
\\\,} - a literal ,}

So for m = "a,b" and n = 2, this expands to {a,} {a,} {b,} {b,}
The inner printf removes the spaces to give {a,}{a,}{b,}{b,}, which itself is a brace expansion
This expands to aabb aab aab aa abb ab ab a abb ab ab a bb b b
The outer printf puts each of these elements on its own line
sort -u removes the duplicates
The tr -d {} is there to handle the case when n = 1.  In this case the variable c will be {} which is not a brace expansion, but instead the literal characters are inserted.  The tr removes them.

evals and \ escapes are placed very carefully to ensure that all the expansions occur in the necessary order.

JavaScript (ES proposal), 142 bytes

f=
(v,n)=>[...Array(++v**n)].map((_,i)=>i.toString(v).padStart(n,0).replace(/./g,(c,j)=>(+c?(10+j).toString(36):``)+(c>1?c.sup():``))).join`<br>`

<input id=v type=number min=1 value=1><input id=n type=number min=1 value=1>
a

Requires a browser with both ** and padStart support, so try Firefox 52 or Chrome 57.

Röda, 49 48 46 bytes
f n{r=[""]{|v|r=r...[seq(0,n)|[v.._]]}_;r[1:]}

Try it online!
I think it is correct. It doesn't use any separator between a variable and its order. The previous version used !, but I realized that it isn't strictly required.
Explained:
function f(n) {
    r := [""] /* r is a list with one empty string. */
    /* Loops over the variable names in the stream. */
    for var do
        /* Concatenates every element in r to */
        /* every element in the list that contains orders of */
        /* variable var. */
        r = r...[
            push(var..x) for x in [seq(0, n)]
        ]
    done
    r[1:] /* Return elements of r not counting the first. */
}

Python, 112 bytes
import itertools as t
f=lambda n,v:[''.join(map(str.__mul__,v,I))for I in t.product(range(n),repeat=len(v))][1:]

Usage:
for x in f(3, 'ab'):
    print(x)

Output:
b
bb
a
ab
abb
aa
aab
aabb

Nicer format in 115 bytes:
import itertools as t
f=lambda n,v:[''.join(map('{}^{}'.format,v,I))for I in t.product(range(n),repeat=len(v))][1:]

Output (same usage):
a^0b^1
a^0b^2
a^1b^0
a^1b^1
a^1b^2
a^2b^0
a^2b^1
a^2b^2

Even nicer in 125 bytes:
import itertools as t
f=lambda n,v:[''.join(c+'^%s'%i for c,i in zip(v,I)if i)for I in t.product(range(n),repeat=len(v))][1:]

Output:
b^1
b^2
a^1
a^1b^1
a^1b^2
a^2
a^2b^1
a^2b^2

The last 4 bytes ([1:]) in all are for removing the empty product.
These work in both Python 2 and 3.

C++14, 146 140 bytes
-6 byte for simpler output format.
Unnamed lambda, assuming input s like std::string and o as std::ostream:
[](auto s,int n,auto&o){int l=s.size(),k,c,*p=new int[l]{1};while(!c){for(c=1,k=0;k<l;o<<s[k]<<"^"<
n));o<<" ";}}

Usage and explanation:
#include<iostream>
#include<string>

auto f=
[](auto s, int n, auto&o){
 int l=s.size(),              //string length
     k,                       //running variable for l
     c,                       //carry for the increment
    *p=new int[l]{1};         //init array with first elem 1
 while(!c){                   //if carry was leftover, break
  for(
   k=0,c=1;                   //always start with carry
   k<l;
    o<<s[k]<<"^"<
n)
//               p[k]+=c      //inc p[k]
//            c=(p[k]+=c)>n   //if value is greater than order
//  p[k++]*=!(c=(p[k]+=c)>n)  //set p[k] to 0 and inc k
  );
  o<<" ";
 }
}
;

main(){
 f(std::string("ab"),3,std::cout);
 std::cout << "\n";
 f(std::string("abc"),2,std::cout);
}

Output:
a^1b^0 a^2b^0 a^3b^0 a^0b^1 a^1b^1 a^2b^1 a^3b^1 a^0b^2 a^1b^2 a^2b^2 a^3b^2 a^0b^3 a^1b^3 a^2b^3 a^3b^3
a^1b^0c^0 a^0b^1c^0 a^1b^1c^0 a^0b^0c^1 a^1b^0c^1 a^0b^1c^1 a^1b^1c^1


text:
CSV cleanup: remove all in col after (
Problem
Given a file with:
56 (65%), 33(75%), , 44, "“hello”,(5) world", goodbye
89 (25%), 33(75%), , 44, "hello world", goodbye
92 (97%), 33(75%), , 44, "hello world", goodbye

Goal
Write back to that file with:
56, 33, , 44, "“hello”,(5) world", goodbye
89, 33, , 44, "hello world", goodbye
92, 33, , 44, "hello world", goodbye

Example implementation [Python 518 bytes]
import csv
from sys import argv
from itertools import takewhile, imap

with open(argv[1], 'r+') as f0:
    r = csv.reader(f0, delimiter=',', quotechar='"')
    w = csv.writer(f0, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)

    rows = tuple(imap(lambda line: ''.join(
        '{}\0'.format(''.join(
            takewhile(lambda ch: ch != '(', col))).rstrip() for col in line), r))
    f0.seek(0)
    tuple(imap(lambda line: w.writerow(line.split('\0')), rows))

Are we required to respect the full CSV specification, including quoted values, or are we allowed to skip that part?

Yes, support for quoted values must be respected.

Ah, drat. I would have been able to do it in 12 bytes otherwise.

Aww :P - so close

I can't see why quoted values must be respected, as I'm given a file that does not contain them. Maybe you should specify better the task.

Fixed. Extra kudos if you remove only parenthesised numerical with/without % from the CSV.

If we have to support quoted values, you should add a test case where they matter, e.g., one with a quoted comma. What should happen if the brackets are quoted?

Also, how much whitespace can occur before the opening bracket? Does all of it have to be removed?

Finally, will the opening bracket always have a mtaching closing bracket?

Updated examples. Parentheses are guaranteed to be balanced.

Would you mind providing a more detail description of the problem? I see what the output is but I am assuming the steps in between... many thanks!

Perl: 15 Bytes +1 for -p option
s/ ?\([^,"]+//g

Usage:
perl -pe 's/ ?\([^,"]+//g' file.csv


text:
Random subset generator
Randomly choose one out of k-length, ordered subset of characters in a string, while only storing a limited number of characters. The subset must be chosen with equal probability and may contain repeated characters. Do this without generating all possible permutations and assume k is at most the length of the string. For example, the string daddy has 7 subsets of length two: da, dd, dy, ad, ay, yd, ya. The function should return any one of them with the probability of 1/7.

You probably don't mean substring. te isn't a substring for example.

It would be nice to have a bit of a stronger specification.    An example is not really a satisfactory specification.

The usual term for non-contiguous substrings is "subsequence". But since you also seem to allow arbitrary orders, you probably want "subsets" or "sub-multisets", since you've included ee.

updated to subsets

I think this question is asking, "choose 1 out of a set of k-lengthed, ordered subsets of the characters in a word, where the same character is equivalent (e.g. 'te' with the first e = 'te' with the second), with equal prabability"

If I were to change this challenge, I would add more test cases, separate from the explanation of what to do (down below, probably). Also, I would remove the restriction on how the program/function finds an ordered subset, I don't see a clear reason of why it's there. Also, I might remove the "uniformly random" part to make it just "random", but that is up to you. You might want to be more clear on what exactly is the input and output for the program, and what it should do if k is greater than the string length, or if k <= 0. Look at some other questions (with decent scores) for guidance.

Pyth - 5 bytes
While we're arguing about the nomenclature, I'm just guessing at the rules based on the example to just mean pick one from all unique permutations of length n of the string.
O{.PF

Try it online here.

permutation works, but what if k is large?

@ash then it's really slow

Perl 6,  75  71 bytes
{set(flat $^a.comb.combinations($^b).map: *.permutations.map: *.join).pick}

Try it
{set($^a.comb.combinations($^b).map: |*.permutations.map: *.join).pick}

Try it
Expanded:
{
  set(                         # get the unique values from: (equal probability)

    $^a.comb.combinations($^b) # get the combinations
      .map: |*.permutations    # get the permutations of the combinations
        .map: *.join           # join each permutation into a string

  ).pick                       # pick one
}

The following could almost work except that it has a different probability if there are any repeats of characters.
{$^a.comb.pick($^b).join}


text:
Make a Bubble-wrap simulator
Bubble-wraps are maximum-level entertainment. Everyone can agree to that.
Now, you will make even computers enjoy bubble-wraps.
Specs
You will be given two integers, w, and h.(each are responsively width and height)
Your program should output all w*h phases waiting 1 second between each one and terminate.
Every bubble-wrap starts with all cells full.
For example, a 4*6 bubble-wrap starts like:
O_O_
_O_O
O_O_
_O_O
O_O_
_O_O

And each phase, a random non-popped cell is popped.For example,
O_O_
_O_O
O_X_
_O_O
O_O_
_O_O

The program should terminate when all the cells are popped. aka.
X_X_
_X_X
X_X_
_X_X
X_X_
_X_X

Examples
(4,6)
(5,5)
(6,2)
(10,10)
(7,9)

Can we use 1 and 0 instead of O and X?

@ГригорийПерельман Yes, but make sure each cell represents a truthy/falsy value. I just used that because it looks like a legitmate bubble-wrap cell.

NEEDZ BUBBLEZ pls send help

The examples are not there, did they get popped already :(?

I popped them guilty grin

@JonathanAllan It was too long then the codeblock decided to nuke them

Is it acceptable for a (1,1) to have no bubbles (e.g. top-left "cell" is always an underscore)?

@JonathanAllan Yes.

@Sanchises umm.. what do you mean?

I like this question, it is entertaining to watch the output and also has more meat on the bone in terms of work product.

Is a function with w and h as parameters acceptable, instead of a full program? I'm asking because you (explicitly¿) mention 'program' a couple of times.

@KevinCruijssen It doesn't have to be a full program.

Your program should output all w*h phases. A 4×6 wrap has only 13 phases, no?

@Adám Well, right, but people seem to understand what I mean so I'll edit when I have some time.

C (Windows), 260 248 bytes
#import<windows.h>
i,j,l,r;b(w,h){char*s=malloc(l=w*h+h);for(i=h;i--;*s++=10)for(j=w;j--;*s++=i%2^j%2?79:45);*(s-1)=0;s-=l;for(srand(time(0));j>system("cls")+puts(s)-2;j>-1?s[j]=88:0)for(Sleep(1000),r=rand(),j=-2,i=r+l*2;--i-r;j=s[i%l]==79?i%l:j);}

Note that there's a sleep function in the thread library, which is included in C++11.

@MatthewRoh Yep, but this is shorter, and the system("cls") is also Windows-specific, so the code wouldn't be more portable with the thread library either. And with C++ I would also need to include iostream or cstdio.

btw you don't need to reset the screen. that will make it shorter.

Python 3, 222 220 bytes
This is my first time answering, so please be gentle (and point out mistakes that I have made).
import time,random as t
def f(c,r):
 p=print;a='0_'*c;d=((a[:c]+'\n'+a[1:c+1]+'\n')*r)[:-~c*r]
 for i in[1]*((r*c+r%2*c%2)//2):
  p(d);k=1
  while d[k]!='0':k=t.randrange(len(d))
  d=d[:k]+'X'+d[k+1:];time.sleep(1)
 p(d)

Try it online!
How it works:

Chain a lot of '0_''s together
Chop into '0_0_...\n' and '_0_0...\n' parts and concatenate
Generate random indices until the char at the index is a '0'
Create new string with the char at the generated index is replaced with a 'X' (Damn you python for non-mutable strings!)
Repeat r*c+r%2*c%2 times: There are r*c bubbles in the pattern, unless r and c are both odd, in which case there are r*c+1.

Welcome to PPCG!

This is rather minor, but your width and height are reversed. Great answer though! (Just change it to f(c,r) and you'll be fine).

MATL, 37 bytes
:!i:+o`T&Xxt3:q'_OX'XEcD2y1=ft&v1Zr(T

The upper-left corner is always an underscore (allowed by the challenge).
The screen is cleared between phases. I could save a byte by not clearing the screen, but it looks better this way.
The program exits with an error (allowed by default) after displaying all phases.
Try it at MATL Online! (If it doesn't work after a couple of seconds, please refresh the page and try again).

Mathematica (145 bytes)
Anonymous function, takes height and width as input (in that order — if that's a problem, replace {##} with {#2,#} in the middle of the code for an extra 2 bytes).
Code:
Monitor[Do[Pause@1,{i,NestList[RandomChoice@StringReplaceList[#,"O"->"X"]&,""<>Riffle["_"["O"][[Mod[#+#2,2]]]&~Array~{##},"
"],Floor[##/2]]}],i]&

Explanation:

""<>Riffle[Array["_"["O"][[Mod[#+#2,2]]]&,{##}],"\n"] creates the initial, unpopped bubble-wrap, by making an array of "_"s and "O"s and then StringJoining them between newlines.
NestList[RandomChoice@StringReplaceList[#,"O"->"X"]&,..., Floor[##/2]] repeatedly chooses one of the "O"s to replace with an "X", as many times as there are "O"s (which is Floor[width * height / 2] — thanks to @JonathanAllan for the idea of putting "_" instead of "O" in the top left corner, otherwise this would be Ceiling instead and thus 2 bytes more).
Monitor[Do[Pause@1,{i,...}],i] makes i take the values in the list we just calculated, for 1 second each, and dynamically prints i.

Example output:

Jelly, 30 29 bytes
=”OTX
+þ⁹++µị⁾_OYµṄœS1”XÇ¦µÐL

Calls the link as a dyad with the program arguments and then quits with a message (the code for which is çṛ“\'=ṙMḋḌẓ(ėo»)
Nuance: the bottom-right "cell" will always be a bubble (rather than the top-left like the example in the question), this is to ensure that when all bubbles are popped the random choice returns 0 which will be the "X" at the end of the list - replacing that then makes no change to the value and breaks the loop.
Note: does not clear the screen (was not specified, and I'm not sure how to do so).
How?
=”OTX - Link 1, choose a random O index or 0: string   e.g. "_O_\nX_O"
 ”O   - "O"
=     - equals (vectorises over the string)            e.g. [0,1,0,0,0,0,1]
   T  - truthy indexes                                 e.g. [2,7]
    X - random choice (if empty this returns 0)

+þ⁹++µị⁾_OYµṄœS1”XÇ¦µÐL - Main link: w, h              e.g. 3, 2
                        - left argument (implicit), w  e.g. 3
  ⁹                     - right argument, h            e.g. 2
 þ                      - outer product with
+                       -     addition                 e.g. [[2,3,4],[3,4,5]]
                        - left argument (implicit), w  e.g. 3
   +                    - add                          e.g. [[5,6,7],[6,7,8]]
                        - right argument (implicit), h e.g. 2
    +                   - add                          e.g. [[7,8,9],[8,9,10]]
     µ                  - monadic chain separation
       ⁾_O              - "_O"
      ị                 - index into (1-based & mod)   e.g. [['_','O','_'],['O','_','O']]
                        -     note: the additions above assure the last entry is an 'O'.
          Y             - join with line feeds         e.g. ['_','O','_','\n','O','_','O']
           µ        µ   - monadic chain separations
                     ÐL - loop until the results are no longer unique:
            Ṅ           -     print with a trailing line feed and yield
             œS1        -     sleep for 1 second and yield
                   ¦    -     apply to index
                  Ç     -         given by calling the last link (1) as a monad
                        -                 (a random O index or 0 if none exists)
                ”X      -         an "X"  (      ... which will be an X already)

@ГригорийПерельман written it up.

Scala, 764 bytes
object B{
  def main(a: Array[String]):Unit={
    val v=false
    val (m,l,k,r,n)=(()=>print("\033[H\033[2J\n"),a(0)toInt,a(1)toInt,scala.util.Random,print _)
    val e=Seq.fill(k, l)(v)
    m()
    (0 to (l*k)/2-(l*k+1)%2).foldLeft(e){(q,_)=>
      val a=q.zipWithIndex.map(r => r._1.zipWithIndex.filter(c=>
        if(((r._2 % 2) + c._2)%2==0)!c._1 else v)).zipWithIndex.filter(_._1.length > 0)
      val f=r.nextInt(a.length)
      val s=r.nextInt(a(f)._1.length)
      val i=(a(f)._2,a(f)._1(s)._2)
      Thread.sleep(1000)
      m()
      val b=q.updated(i._1, q(i._1).updated(i._2, !v))
      b.zipWithIndex.map{r=>
        r._1.zipWithIndex.map(c=>if(c._1)n("X")else if(((r._2 % 2)+c._2)%2==0)n("O")else n("_"))
        n("\n")
      }
      b
    }
  }
}

How it works
The algorithm first fills a 2D Sequence with false values. It determines how many iterations (open boxes) exist based on the command line arguments put in. It creates a fold with this value as the upper bound. The integer value of the fold is only used implicitly as a way to count how many iterations the algorithm should run for. The filled sequence we created previously is the starting sequence for the fold. This is used in generating a new 2D sequence of false values with their cooresponding indecies.
For example,
[[false, true],
 [true, false],
 [true, true]]

Will be turned into
[[(false, 0)], [(false, 1)]]

Note that all lists that are completely true (have a length of 0) are omitted from the result list. The algorithm then takes this list and picks a random list in the outermost list. The random list is chosen to be the random row we pick. From that random row, we again find a random number, a column index. Once we find these two random indices, we sleep the thread we are on for 1000 miliseconds.
After we're done sleeping, we clear the screen and create a new board with a true value updated in the random indices we have created.
To print this out properly, we use map and zip it with the index of the map so we have that in our context. We use the truth value of the sequence as to whether we should print an X or either an O or _. To chose the latter, we use the index value as our guide.
Interesting things to note
To figure out if it should print an O or an _, the conditional  ((r._2 % 2) + c._2) % 2 == 0 is used. r._2 refers to the current row index while c._2 refers to the current column. If one is on an odd row, r._2 % 2 will be 1, therefore offsetting c._2 by one in the conditional. This ensures that on odd rows, columns are moved over by 1 as intended.
Printing out the string "\033[H\033[2J\n", according to some Stackoverflow answer I read, clears the screen. It's writing bytes to the terminal and doing some funky stuff I don't really understand. But I've found it to be the easiest way to go about it. It doesn't work on Intellij IDEA's console emulator, though. You'll have to run it using a regular terminal.
Another equation one might find strange to see when first looking at this code is (l * k) / 2 - (l * k + 1) % 2. First, let's demystify the variable names. l refers to the first arguments passed into the program while k refers to the second one. To translate it, (first * second) / 2 - (first * second + 1) % 2. The goal of this equation is to come up with the exact amount of iterations needed to get a sequence of all X's. The first time I did this, I just did (first * second) / 2 as that made sense. For every n elements in each sublist, there are n / 2 bubbles we can pop. However, this breaks when dealing with inputs such as (11 13). We need to compute the product of the two numbers, make it odd if it's even, and even if it's odd, and then take the mod of that by 2. This works because rows and columns that are odd are going to require one less iteration to get to the final result.
map is used instead of a forEach because it has less characters.
Things that can probably be improved
One thing that really bugs me about this solution is the frequent use of zipWithIndex. It's taking up so many characters. I tried to make it so that I could define my own one character function that would just perform zipWithIndex with the value passed in. But it turns out that Scala does not allow an anonymous function to have type parameters. There is probably another way to do what I'm doing without using zipWithIndex but I haven't thought too much about a clever way to do it.
Currently, the code runs in two passes. The first generates a new board while the second pass prints it out. I think that if one were to combine these two passes into one pass, that would save a couple of bytes.
This is the first code golf I've done so I'm sure there is a lot of room for improvement. If you'd like to see the code before I optimized for bytes as much as possible, here it is.

JavaScript (ES6), 246 229 bytes

document.write(`<pre id=o></pre>`)
setInterval(_=>{(a=o.innerHTML.split(/(O)/))[1]?a[Math.random()*~-a.length|1]=`X`:0;o.innerHTML=a.join``},1e3)
f=(w,h)=>o.innerHTML=[...Array(h)].map((_,i)=>`O_`.repeat(w+h).substr(i,w)).join`
`
<div oninput=f(+w.value,+h.value)><input id=w type=number min=1><input id=h type=number min=1>

The width was not in terms of cells- but including blank(underlines) spaces.

@MatthewRoh Sorry, I remembered to fix it for the height but I forgot to check the width.

Hmm.. can't this part: \${`O`.repeat(w).slice(w)}
${`O`.repeat(w).slice(w)}be somehow combined? Perhaps a boolean-flag to first determineOorO, and then do the .repeat(w).slice(w)`?

@KevinCruijssen I'd lost 16 bytes because of a quick bugfix which I hadn't had time to golf at the time. I've since taken another look and come up with a 17 byte saving,

Python - 290 bytes
I've never done one of these before - so any constructive criticism would be appreciated :)
Main trick here is just annoyingly nested list comprehensions. I could save a few characters by not having a newline between the pops but that just looks ugly.
r=range
q=print
import random as n,time
def f(H,W):
    def p(b):
        q("\n".join(["".join(["O"if(i,j)in b else"X"if(i,j)in X else"_"for j in r(H)])for i in r(W)]));time.sleep(1);q()
    b=[(i,h)for h in r(H)for i in r(h%2,W,2)];n.shuffle(b);X=[]
    while len(b)>0:
        p(b);X+=[b.pop()]
    p(b)

Hi, welcome to PPCG! The challenge was to take the w and h as input (through STDIN, as a function input, or something similar), instead of having a hardcoded H=4 W=6. Also, although I never programmed in Python, I think you can golf some spaces in your current code. Tips for Golfing in Python might also be interesting to read through to give you ideas on how to golf it down further. Enjoy your stay! :)

Also, regarding your comment: "I could save a few characters by not having a newline between the pops but that just looks ugly." No matter how ugly or how not-done it is in real-life programming, codegolf is about saving as much bytes as possible. The shorter and uglier, the better. ;)

@KevinCruijssen the Python3 one above me just has it as a function of w,h, is that allowed?

Yes, both functions with the expected parameters as well as full programs are allowed by default, unless the question states otherwise.

Ok - I've made it a function of H and W now.

Charcoal, 49 46 39 bytes (noncompeting)
ＵＯＮＮO_¶_OＡＫＡαＡ№αOβＨＷψβ«Ａ§α§⌕ＡαO‽βXＡ№αOβ

Verbose
Oblong(InputNumber(), InputNumber(), "O_\n_O")
Assign(PeekAll(), a)
Assign(Count(a, "O"), b)
RefreshWhile (k, b) {
    AssignAtIndex(a, AtIndex(FindAll(a, "O"), Random(b)), "X")
    Assign(Count(a, "O"), b)
}

APL (Dyalog), 61 59 bytes
⎕←m←'O_'[2|-/¨⍳⎕]
(b/,m)[?+/b←'O'=,m]←'X'
⎕DL 1
→2/⍨'O'∊⎕←m

⎕← output

m← m, where m is

'O_'[…] these characters indexed by…

 2| the division-remainder-when-divided-by-two of

 -/¨ the difference between each of

 ⍳ all the coordinates (indices) in an array of shape

 ⎕ numeric input (the number of rows and columns)
(…)[…]←'X' assign the character X to one of the…

 b/ filtered-by-b (to be defined)

 ,m raveled elements of m, specifically…

 ? a random element (lit. number) in the range one to

 +/ the sum of

 b← b, where b is

 'O'= Boolean for where the letter equals

 ,m m raveled
⎕DL 1 Delay one second
→2 Go to line 2

/⍨ if (lit. filtered by)

'O'∊ whether the letter is a member of

⎕←m the outputted value, where the outputted value is m

Try it online!

From version 16.0 it will be shorter:
{0::→⋄'X'@(⊂(?∘≢⊃⊢)⍸'O'=⍵⊣⎕DL 1)⊢⎕←⍵}⍣≡'O_'[2|-/¨⍳⎕]

Python 3, 195 188 bytes
import time,random
def f(w,h):
 a=bytearray(b'0-'*w*h);b=[*range(0,w*h,2)];random.shuffle(b);
 while 1:print(*(a.decode()[w*i:w*i+w]for i in range(h)),sep='\n');a[b.pop()]=88;time.sleep(1)

Using bytearray and decode seems to be shorter than slicing and reassembling a string a la a[:i]+'X'+a[i+1:].
import time,random
def f(w,h):
 x=[*range(1,h*w,2)];random.shuffle(x)
 while 1:
  for i in range(w*h):
   print('-X0'[(i%w%2!=i//w%2)+(i in x)],end='\n'[i%w<w-1:])
  print();time.sleep(1);x.pop()

Java 7, 317 bytes
void c(int w,int h)throws Exception{String r="";int x=0,j=0,i;for(;j++<h;x^=1,r+="\n")for(i=0;i<w;r+=(i+++x)%2<1?"_":"O");for(System.out.println(r);r.contains("O");System.out.println(r=r.substring(0,x)+'X'+r.substring(x+1))){Thread.sleep(1000);for(x=0;r.charAt(x)!='O';x=new java.util.Random().nextInt(r.length()));}}

Explanation:
void c(int w, int h) throws Exception{                     // Method with two integer parameters (throws Exception is required for the Thread.sleep)
  String r = "";                                           //  String we build to print
  int x=0, j=0, i;                                         //  Some temp values and indexes we use
  for(; j++<h;                                             //  Loop over the height
      x^=1,                                                //    After every iteration change the flag `x` every iteration from 0 to 1, or vice-versa
      r += "\n")                                           //    And append the String with a new-line
    for(i=0; i<w;                                          //   Inner loop over the width
        r += (i++ + x)%2 < 1 ? "_" : "O")                  //    Append the String with either '_' or 'O' based on the row and flag-integer
    ;                                                      //   End inner width-loop (implicit / no body)
                                                           //  End height-loop (implicit / single-line body)
  for(                                                     //  Loop
    System.out.println(r);                                 //   Start by printing the starting wrap
    r.contains("O");                                       //   Continue loop as long as the String contains an 'O'
    System.out.println(r=                                  //   Print the changed String after every iteration
        r.substring(0,x)+'X'+r.substring(x+1))){           //    After we've replaced a random 'O' with 'X'
      Thread.sleep(1000);                                  //   Wait 1 second
      for(x=0; r.charAt(x) != 'O';                         //   Loop until we've found a random index containing still containing an 'O'
          x = new java.util.Random().nextInt(r.length()))  //    Select a random index in the String
      ;                                                    //   End loop that determines random index containing 'O' (implicit / no body)
  }                                                        //  End loop
}                                                          // End method

Test gif (4,6)

Perl, 148 bytes
146 bytes of code + -pl flags.
$_=O x($x=$_+1);s/O\K./_/g;for$i(1..($y=<>)){$b.=($i%2?$_:_.s/.$//r).$/}}print$_="\e[H$b";while(/O/){$r=0|rand$y*$x+3;s/.{$r}\KO/X/s||redo;sleep 1

To run it:
perl -ple '$_=O x($x=$_+1);s/O\K./_/g;for$i(1..($y=<>)){$b.=($i%2?$_:_.s/.$//r).$/}}print$_="\e[H$b";while(/O/){$r=0|rand$y*$x+3;s/.{$r}\KO/X/s||redo;sleep 1' <<< "6
4"

MATLAB (R2016b), 172 bytes
Code:
x=input('');m=[eye(x(2),x(1)) ''];m(:)='O';m(1:2:end,2:2:end)='_';m(2:2:end,1:2:end)='_';o=find(m=='O');r=o(randperm(nnz(o)));disp(m);for i=r';pause(1);m(i)='X';disp(m);end

Recommendations are always welcome! Try it online!
Program Output:

Explanation:
x = input( '' );                    % Input
m = [ eye( x( 2 ), x( 1 ) ) '' ];   % Character Matrix
m( : ) = 'O';                       % Fill Matrix with "Bubbles"

m( 1:2:end, 2:2:end ) = '_';        % Alternate Spaces Between Bubbles (Part 1)
m( 2:2:end, 1:2:end ) = '_';        % Alternate Spaces Between Bubbles (Part 2)

o = find( m == 'O' );               % Index Bubble Locations
r = o( randperm( nnz( o ) ) );      % Randomize Bubble Locations

disp( m );                          % Display Initial Bubble Wrap Phase

for i = r'
    pause( 1 );                     % Pause for 1 Second
    m( i ) = 'X';                   % Pop Bubble
    disp( m );                      % Display Subsequent Bubble Wrap Phase
end

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


text:
Two-Coloring Overlapping Circles
Write a program or function that takes in the following input in a reasonable format of your choice:

Two positive integers W and H that define the width and height of the image you'll be generating.
Two RGB colors C1 and C2 that will be used to color the image.
A list of 3-tuples of the form (r, x, y) that define circles with radius r and center x, y in the plane of the image. r is a positive integer and x and y are any integers. The top left pixel of the image is 0, 0 and the x-axis increases to the right and the y-axis increases downward.

Output an image with dimensions W by H that is colored with C1 and C2 such that no two neighboring regions defined by all the overlapping circles are the same color.

For example: If the input is
W = 300
H = 200
C1 = (255, 200, 0)
C2 = (128, 0, 255)
Circles = (25, 50, 80), (40, 80, 120), (300, -100, 6), (17, 253, 162)

then the circle boundaries look like this:

There are six distinct, contiguous regions in the image created by the
  circles. Each region must be colored with C1 (yellow) or C2 (purple)
  such that no two neighboring regions are the same color.
There are two ways to do this, their only difference being that the
  colors are swapped:

Thus, either of these two images would be valid output for the example
  input.
Something like this would be invalid output since two yellow regions
  neighbor each other.

Your output images should follow these guidelines:

Besides C1 and C2, a third, neutral color such as black or white may be used for circle boundaries as long as they are no more than 5 pixels thick. (Black, 1-pixel thick boundaries are present in the example above.)
Circles boundaries are not required, however. The regions may neighbor each other directly:

Both of these is another valid output to the example above.
Circles should be as accurate as reasonably possible, using circle drawing algorithms or whatever your graphics library provides.
In general, pixel-perfection is not required, but if the input parameters are scaled equally larger and larger, the resulting image should become more and more accurate.
Anti-aliasing is allowed but not required.
Gridlines or axis labels etc. in the background are not allowed.

The shortest code in bytes wins.
More Examples
All using these inputs with different sets of circles:
W = 100
H = 60
C1 = (255, 0, 0)
C2 = (0, 0, 255)

In any example the colors can be swapped and remain valid.
Circles =
A. empty list
B. (13, 16, 20)
C. (30, 16, 20)
D. (200, 16, 20)
E. (42, 50, 20)
F. (42, 50, 20), (17, 40, 30)
G. (42, 50, 20), (17, 20, 30)
H. (42, 50, 20), (17, 10, 30), (10, 50, 30)
I. (42, 50, 20), (17, 10, 30), (35, 50, 20)
J. (18, 36, 40), (18, 63, 40), (18, 50, 20)
K. (100, -10, -20), (60, 50, -10)
L. (18, 36, 40), (18, 63, 40), (18, 50, 20), (14, 50, 20), (5, 50, 18), (20, 0, 0), (70, 22, 0), (10000, -9970, 0), (135, 100, -80)

A.  B.  C.  D.
E.  F.  G.  H.
I.  J.  K.  L.
Make sure your output behaves similar to all these examples.

It looks nice, can we output in ascii, for example C1 is 1 and C2 is 0?

@MatthewRoh No. I know that would be convenient but images are required.

aww. no love to C++ then.

You are welcome to use graphics libraries.

I know, but that will make it a bit longer than other languages

Could we take colors in some form other than RGB? If so what forms are permitted?

It should be RGB but could be ints from 0 to 255 or floats from 0.0 to 1.0.

Ok then I guess I can count out tikz

@MatthewRoh, netpbm is a commonly used image format on this site.

You really want to specify that positive y-values extend downward, even though the standard graphing convention is the opposite? It seems better to leave such choices up to the individual solvers.

Also, I bet you want to specify that the region to be drawn has the origin at one corner—otherwise we could take a region of the right height/width so far away from the circles that the image is monochromatic.

@Greg This is a very standard coordinate system for images and graphics libraries.

Can coordinates be 1-based instead of 0-based? Can we input them as complex numbers (real, imag are x, y)?

@Luis Ok. Small input variations like that or having the y axis go up are alright.

Just out of curiosity... can somebody provide a link to the proof that it is possible to produce a 2-coloring of an arbitrary number of intersecting circles?

(Sort of) a tip: A product of multiple functions of circles >=0 gives the exact graph we want (ex.(x^2+y^2-1)(x^2+y^2-4)>=0 draws the answer for (0,0,1),(0,0,2))

@HelkaHomba Is this okay?

Mathematica, 165 bytes
ContourPlot[Cos@Tr[Boole[Norm[{x,y}-#2]<#]Pi&@@@#4],{x,0,#},{y,0,#2},PlotPoints->5!,AspectRatio->Automatic,Frame->False,ContourShading->RGBColor@@@#3,Contours->{0}]&

Pure function taking four arguments: the width, the height (both integers), an ordered pair of triples of numbers between 0 and 1 (representing the two RGB colors), and a list of items of the form {r, {x, y}} to record the radii and centers of the circles. For example, the first example in the OP would be called with the arguments [300, 200, {{1, 0.784, 0}, {0.5, 0, 1}}, {{25, {50, 80}}, {40, {80, 120}}, {300, {-100, 6}}, {17, {253, 162}}}]. The positive y-axis points upwards in Mathematica.
Norm[{x,y}-#2]<# detects whether a point is inside a given circle; Boole[...]Pi converts that True or False to π or 0. After computing those πs/0s over all the input circles, Tr adds them up and Cos converts even multiples of π to 1, odd multiples of π to –1. ContourPlot[...,Contours->{0}] then colors the appropriate region of the plane in two colors depending on whether the value is greater or less than 0. AspectRatio->Automatic makes circles look like circles; PlotPoints->5! gives a decent accuracy (boost it to 9! if you really want an amazing picture, far in the future!); Frame->False gets rid of the axes; and ContourShading->RGBColor@@@#3 uses the input colors for the contours.
Sample output, with the first pair of colors (since they're nice) but the last set of circles:

JavaScript/SVG/HTML5, 219 bytes

f=// for demo
(w,h,b,f,a)=>`<svg width=${w} height=${h}><rect width=${w} height=${h} fill=rgb(${b}) /><path fill=rgb(${f}) fill-rule=evenodd d=${a.map(([r,x,y])=>[`M`+x,y-r+`a`+r,r,0,0,0,0,r+r+`a`+r,r,0,0,0,0,-r-r]).join``} /></svg>`
;//demo
[[`A`, []],
 [`B`, [[13, 16, 20]]],
 [`C`, [[30, 16, 20]]],
 [`D`, [[200, 16, 20]]],
 [`E`, [[42, 50, 20]]],
 [`F`, [[42, 50, 20], [17, 40, 30]]],
 [`G`, [[42, 50, 20], [17, 20, 30]]],
 [`H`, [[42, 50, 20], [17, 10, 30], [10, 50, 30]]],
 [`I`, [[42, 50, 20], [17, 10, 30], [35, 50, 20]]],
 [`J`, [[18, 36, 40], [18, 63, 40], [18, 50, 20]]],
 [`K`, [[100, -10, -20], [60, 50, -10]]],
 [`L`, [[18, 36, 40], [18, 63, 40], [18, 50, 20], [14, 50, 20], [5, 50, 18], [20, 0, 0], [70, 22, 0], [10000, -9970, 0], [135, 100, -80]]]
 ].forEach(([c, a])=>document.write(`<nobr><tt> ${c}. </tt>${f(100, 60, [255, 0, 0], [0, 0, 255], a)}</nobr><wbr>`));

BBC Basic, 120 117 bytes
Download interpreter at http://www.bbcbasic.co.uk/bbcwin/bbcwin.html
I.w,h,R,G,B,r,g,b:V.22,4,19;16,r,g,b,275;16,R EORr,G EORg,B EORb,24,0;0;w;h;16
5I.r,x,y:V.25,4,x;h-y;25,154,r;0;:G.5

BBC Basic has a range of colour modes allowing you to plot raster graphics according to basic logic operations: OR, AND, XOR etc.
It also supports pallete reprogramming, meaning that for example here a 2 colour image can have its colours reprogrammed to any of 4096 colours. The implementation used here has some (undocumented) differences from the original BBC implementation, in which the EOR operators would not be necessary.
Ungolfed
  INPUTw,h,R,G,B,r,g,b:                           :REM Input size and colours
  VDU22,4                                         :REM Change to MODE 4 (2 colours) as the default mode gives odd behaviour
  VDU19,0,16,r,g,b,19,1,16,R EORr,G EORg,B EORb   :REM Reprogram the colours to R,G,B and R^r,G^g,B^b
  VDU24,0;0;w;h;16                                :REM Setup a graphics viewport of the right size, and "clear" it to change background colour
5 INPUTr,x,y                                      :REM take input coordinates
  VDU25,4,x;h-y;                                  :REM move to x,y (h-y required as BBC BASIC y axis increases upward, reverse of spec)
  VDU25,154,r;0;                                  :REM draw circle in "logical inverse colour" of existing pixels (this implementation seems however to XOR with colour 1 instead)
  GOTO5                                           :REM repeat infinitely until user presses escape

Typical output screen
Example image scaled up by a factor of 10 in units / factor of 5 in pixels (BBC basic uses 1 pixel = 2 units.)

MATL, 30 29 25 bytes
2ZG:i:!J*+2&!-|i<so2&!1YG

Input format:

Colormap as a matrix of values between 0 and 255, where each row defines a color
W
H
Column vector of 1-based center coordinates as complex values (x is the real part, y is the imaginary part)
Column vector of radii.

Try at MATL Online! Or verify the last test case. (The interpreter is still experimental. You may need to refresh the page and try again if it doesn't work).
Explanation
The code uses complex numbers to define the grid of points and to compute distances, and makes heavy use of array operations with broadcasting.
2ZG    % Implicitly input matrix of colors. Set as colormap
:      % Implicitly input W. Push [1 2 ... W]
i:     % Input H. Push [1 2 ... H]
!J*    % Transpose, multiply by 1i
+      % Add element-wise with broadcast. Gives H×W grid of points as
       % complex numbers, 1-based
2&!    % Permute first dimension with the third. Gives a 1×W×H array
-|     % Implicitly input center coordinates. Subtract grid from them,
       % element-wise with broadcast. Gives a C×H×W array, where C is the
       % number of circles
i      % Input column vector of circle radii
<      % Less than, element-wise with broadcast
so     % Sum along first dimension, modulo 2. Gives a 1×W×H array
2&!    % Permute first dimension with the third. Gives a a H×W array
1YG    % Display as scaled image

I say Save Those Bytes! :D

@GregMartin You are right. Who cares about elegance when 4 bytes can be saved! :-) Done

@LuisMendo The shorter the better with codegolf, no matter how ugly it becomes. ;)

Python using pypng, 140 138 bytes
import png
f=lambda W,H,c,d,C:png.from_array([[[c,d][sum(abs(x-X+1j*(y-Y))<r for r,x,y in C)%2]for X in range(W)]for Y in range(H)],'RGB')

Example usage:
W = 100
H = 60
C1 = (255, 0, 0)
C2 = (0, 0, 255)
Circles = (18, 36, 40), (18, 63, 40), (18, 50, 20), (14, 50, 20), (5, 50, 18), (20, 0, 0), (70, 22, 0), (10000, -9970, 0), (135, 100, -80)
f(W, H, C1, C2, Circles).save('test.png')

Thanks to xnor for saving 2 bytes.

Welcome to code golf! For checking if a point lies in a circle, one trick is to use complex norm: abs(x-X+1j*(y-Y))<r.

Math (non-competiting)

(idk how to do LaTeX in PPCG, so I used a LaTeX to png tool)
Explanation
The product of multiple circle equations ((x-a)^2+(y-b)^2-r^2) >= 0 will make a graph which this question needs. In the equation, n is the size of the array, and (x, y or r)_k is the kth (x, y, or r) element.
Example
(0,0,2),(2,2,2)

(Inequality plot by WolframAlpha)
Get/Run equation for WolframAlpha

Getting script : Complete

<input id="in" placeholder="input, with () changed to []">

<input type="color" id="c1" value="#ff0000">
<input type="color" id="c2" value="#00ff00">

<input id="w" placeholder="width">
<input id="h" placeholder="height">

<button onclick="change()">
Convert!
</button>

<input id="res" placeholder="result">

Running script : Not done yet

Now make it work with Mathematica...

I wonder if this is valid?

You'd need to list a specific pre-existing interpreter that would plot the output in the form you wanted given that input. That'd make it possible to count the bytes in it. At present, the issue is that because it's not tied to an interpreter, it's not tied to a specific format for representing the equation, and thus the notation is informal and impossible to count objectively. There are plenty of programs for plotting graphs of equations around, so it might be worth trying to find one with a terse input format.

@ais523 Ohh. I'll try to make it work with WolframAlpha.

Common Lisp + Quicklisp + ZPNG 260 + 20 = 280 chars
This is some of the widest code I've ever written in CL, and if I weren't doing a code golf I would've restructured this to make it much easier to read...
Prelude (20 chars)
(ql:quickload 'zpng)

Golfed (260 chars)
(lambda(w h g b c)(make-instance'zpng:png :image-data(coerce(loop :for j :below h :nconc(loop :for i :below w :append(if(evenp(count t(mapcar(lambda(c)(<(abs(complex(-(cadr c)i)(-(caddr c)j)))(car c)))c)))g b)))'(array(unsigned-byte 8)(*))):width w :height h))

Ungolfed:
(Uses defun to allow testing and longer variable names for readability)
(defun mk-png (width height color1 color2 circles)
  (make-instance 'zpng:png
                 :image-data (coerce (loop :for j :below height
                                           :nconc (loop :for i :below width
                                                        :append (if (evenp (count t (mapcar (lambda (circ)
                                                                                (< (abs (complex (- (cadr circ) i) (- (caddr circ) j)))
                                                                                (car circ)))
                                                                                circles)))
                                                                    color1 color2)))
                                     '(array (unsigned-byte 8) (*)))
                 :width width
                 :height height))

Example Usage:
(let ((png (mk-png 300 200 '(255 200 0) '(128 0 255) '((25 50 80) (40 80 120) (300 -100 6) (17 253 162)))))
  (zpng:write-png png #p"path/to/file.png"))

Explaination
(lambda (circ)
   (< (abs (complex (- (cadr circ) i) (- (caddr circ) j)))
      (car circ)))

Returns true if the point (i, j) falls within the given circle circ. Euclidean distance is calculated by taking the absolute value of the complex number which represents the vector from (i, j) to the center of circ.
(evenp (count t (mapcar ___
                         circles)))

Map that function across the circles list and check if the given point (i, j) falls within an even number of circles.
(if ____
     color1 color2)

Select color based on that test.
(loop :for j :below height
       :nconc (loop :for i :below width
                    :append ____))

Collect together a flat list of all the rgb bytes by looping over each (i, j) in the image and appending the resulting lists together.
(coerce ____
         '(array (unsigned-byte 8) (*)))

Convert that list of bytes into a proper array of bytes, so zpng can ingest it properly.
(make-instance 'zpng:png
                :image-data ____
                :width width
                :height height)

Create the png object.
(defun mk-png (width height color1 color2 circles)
   ___)

Create the function to take the width, height, two colors, and list of circles and return the created png object.

Python 2.x, 166 158
import re;def f(W,H,c,d,C):print'P3',W,H,255,re.sub('[^0-9]',' ',repr([[d,c][sum([abs(x-X+1j*(y-Y))<r for r,x,y in C])%2]for Y in range(H)for X in range(W)]))

The function generates a PPM file on the standard output.
example:
W = 300
H = 200
C1 = (255, 200, 0)
C2 = (128, 0, 255)
Circles = [(25, 50, 80), (40, 80, 120), (300, -100, 6), (17, 253, 162)]

f(W, H, C1, C2, Circles)

JavaScript (ES6), 224 bytes
I saw the JS + SVG solution, but I just had to create a canvas-based solution ;-) This is a function which returns a canvas element. If an existing canvas element can be provided, remove 40 bytes.
Call like f(width, height, [[r1, g1, b1], [r2, g2, b2]], [[r1, x1, y1], [r2, x2, y2], ...])

let f =
(w,h,a,c,O=document.createElement`canvas`)=>{O.width=w;O.height=h;C=O.getContext`2d`;for(y=0;y<h;y++)for(x=0;x<w;x++)C.fillStyle=`rgb(${a[c.filter(([R,X,Y])=>(X-x)**2+(Y-y)**2<R**2).length%2]})`,C.fillRect(x,y,1,1);return O}

let tests = A.innerHTML.match(/.+/g);
A.innerHTML = "";
for (let i of tests) {
  let p = document.createElement("span");
  p.innerHTML = "
" + i.slice(0, 3);
  p.style["font-family"] = "monospace";
  A.append(p);
  A.append(f(100, 60, [[255,0,0], [0,0,255]],
    eval(`[${ i.slice(3).replace(/\(/g, "[").replace(/\)/g, "]") }]`)
  ));
}

A.
B. (13, 16, 20)
C. (30, 16, 20)
D. (200, 16, 20)
E. (42, 50, 20)
F. (42, 50, 20), (17, 40, 30)
G. (42, 50, 20), (17, 20, 30)
H. (42, 50, 20), (17, 10, 30), (10, 50, 30)
I. (42, 50, 20), (17, 10, 30), (35, 50, 20)
J. (18, 36, 40), (18, 63, 40), (18, 50, 20)
K. (100, -10, -20), (60, 50, -10)
L. (18, 36, 40), (18, 63, 40), (18, 50, 20), (14, 50, 20), (5, 50, 18), (20, 0, 0), (70, 22, 0), (10000, -9970, 0), (135, 100, -80)

Example output:

Löve2D, 353 Bytes.
o=love.graphics
a=arg
w,h,r,g,b,R,G,B=...c={}for i=9,#a,3 do
c[#c+1]={a[i],a[i+1],a[i+2]}end
C=o.newCanvas(w,h)o.setCanvas(C)o.clear(R,G,B)for k,v in pairs(c)do
o.stencil(function()o.circle("fill",v[2],v[3],v[1],9^3)end,"invert",1,true)end
o.setStencilTest("greater",0)o.setColor(r,g,b)o.rectangle("fill",0,0,w,h)local
C:newImageData():encode("png","c")