Skip to content

Instantly share code, notes, and snippets.

@joeljuca
Created December 1, 2016 21:07
Show Gist options
  • Save joeljuca/662067c4edc0be2af6c61388adfc41a5 to your computer and use it in GitHub Desktop.
Save joeljuca/662067c4edc0be2af6c61388adfc41a5 to your computer and use it in GitHub Desktop.
module.exports = CodeMachine = function (coffee) {
if (coffee instanceof Coffee) {
throw new TypeError('CodeMachine needs coffee to work')
}
var linesOfCode = []
for (var i = 0, end = Math.random() * 1000; i < end; i++) {
var line = []
for (var j = 0; j < 5; j++) {
line.push(Math.random() * 78 + 48)
}
linesOfCode.push(line)
}
return linesOfCode.map(l => l.map(String.fromCharCode)).join('\n')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment