3 ms·
I too cut my programming teeth in BASIC, first on my brother's Challenger 1P and then on my very own CoCo I. While it was fun being closer to the metal I'd muc
by dugmartin 9y ago
I too cut my programming teeth in BASIC, first on my brother's Challenger 1P and then on my very own CoCo I. While it was fun being closer to the metal I'd much rather of had the 16GB laptop connected to the 43" monitor that I have now at 46 when I was 8.
btw, you can get pretty close to the spirit of the code with just a few more lines of Javascript:
var col = 0;
setInterval(() => {
document.body.innerHTML += String.fromCharCode(47+(Math.round(Math.random())*45)) + (++col % 80 ? "" : "<br/>")
}, 10);
or if you want to code golf you can get it into 1 line:
var col = 0, fn = setInterval(() => {document.body.innerHTML += String.fromCharCode(47+(Math.round(Math.random())*45)) + (++col % 80 ? "" : "<br/>")}, 10);
You can see it in action here:
https://jsfiddle.net/x5mz341z/ https://jsfiddle.net/x5mz341z/
(edited to point to new jsfiddle with css body rules)
- dragonsky67 9y agodoesn't really work with a proportional font.
- dugmartin 9y agoAgreed - I created a new jsfiddle with a couple of body style rules and updated the link.
- keithnz 9y agocreated a new fiddle taking various suggestions through the post... https://jsfiddle.net/tj1zwqat/ https://jsfiddle.net/tj1zwqat/ interesting that it renders perfect ( for me ) in chrome, and a bit of an offset in firefox js setInterval(() => {document.body.innerHTML += (Math.random() > 0.5 ? "╲":"╱")}, 1) css body { line-height:1em; max-width: 500px; word-wrap:break-word;}
- Turing_Machine 9y agoYou could golf it down a bit more with: document.body.innerHTML += (Math.random() > 0.5 ? "\\":"/")