Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var bf_prog = "++++++++[>++++++++++++>++++<<-]>[>>+>+>+>+<<<<<-]++++[>>>++++++>+++>+++++<<<<<-]>>++++>->++>-.<.+.<.++.<<.>.---.>.>>.";
- function snowText(string, w, h, proba){
- var index = 0;
- var res = "";
- for(var i=0; i<h; ++i){
- for(var j=0; j<w; ++j){
- if(Math.random() < proba){
- res += string.charAt(index);
- ++index;
- }else{
- res += ' ';
- }
- }
- res += '\n';
- }
- return res + string.substring(index, string.length);
- }
- console.log(snowText(bf_prog, 100, 20, 0.03));
Advertisement
Add Comment
Please, Sign In to add comment