Created
September 11, 2013 13:52
-
-
Save vprimachenko/6523913 to your computer and use it in GitHub Desktop.
rainbows in console via node
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
c = [41,43,42,46,44,45,41]; | |
var rainbow = ''; | |
for(var i=0; i<6;i++) { | |
rainbow += '\x1B['+c[i]+'m'; | |
rainbow += '\x1B['+(c[i+1]-10)+'m'; | |
rainbow += ' '; | |
rainbow += '\x1B['+c[i]+'m'; | |
rainbow += '\x1B['+(c[i+1]-10)+'m'; | |
rainbow += '░'; | |
rainbow += '\x1B['+c[i+1]+'m'; | |
rainbow += '\x1B['+(c[i]-10)+'m'; | |
rainbow += '▓'; | |
rainbow += '\x1B['+c[i]+'m'; | |
rainbow += '\x1B['+(c[i+1]-10)+'m'; | |
rainbow += '▒'; | |
rainbow += '\x1B['+c[i+1]+'m'; | |
rainbow += '\x1B['+(c[i]-10)+'m'; | |
rainbow += '▒'; | |
rainbow += '\x1B['+c[i]+'m'; | |
rainbow += '\x1B['+(c[i+1]-10)+'m'; | |
rainbow += '▓'; | |
rainbow += '\x1B['+c[i+1]+'m'; | |
rainbow += '\x1B['+(c[i]-10)+'m'; | |
rainbow += '░'; | |
} | |
console.log(rainbow+rainbow+'\x1b[0m'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment