Skip to content

Instantly share code, notes, and snippets.

@cosinusoidally
Created April 14, 2016 14:37
Show Gist options
  • Save cosinusoidally/c5cf91d367c19e1634566c38df0eb83b to your computer and use it in GitHub Desktop.
Save cosinusoidally/c5cf91d367c19e1634566c38df0eb83b to your computer and use it in GitHub Desktop.
x="...";
y=x+" "+x;
z=x+" "+x+" "+x;
r=[[/#/g,x],
[/Head/g,x],
[/shoulders/g,x],
[/knees and/g,y],
[/toes/g,x],
[/and eyes/g,y],
[/and ears/g,y],
[/and mouth and/g,z],
[/nose/g,x]]
t="Head, shoulders, knees and toes\n\
knees and toes\n\
Head, shoulders, knees and toes\n\
knees and toes\n\
and eyes and ears and mouth and nose\n\
Head, shoulders, knees and toes\n\
knees and toes\n";
for(var i in r){
t=t.replace(r[i][0],r[i][1]);
console.log(t);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment