Created
April 14, 2016 14:37
-
-
Save cosinusoidally/c5cf91d367c19e1634566c38df0eb83b to your computer and use it in GitHub Desktop.
js solution for http://www.meetup.com/York-Code-Dojo/events/229508935/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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