mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-24 12:04:17 -08:00
Removed spaces from top-level directory names.
Spaces tend to cause annoyances in a Unix-style shell environment. This change fixes that.
This commit is contained in:
3
78_Sine_Wave/javascript/README.md
Normal file
3
78_Sine_Wave/javascript/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/games.html)
|
||||
|
||||
Conversion to [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Shells)
|
||||
22
78_Sine_Wave/javascript/sinewave.js
Normal file
22
78_Sine_Wave/javascript/sinewave.js
Normal file
@@ -0,0 +1,22 @@
|
||||
print(tab(30), "SINE WAVE");
|
||||
print(tab(15), "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY");
|
||||
print("\n\n\n\n");
|
||||
|
||||
// REMARKABLE PROGRAM BY DAVID AHL
|
||||
// Transliterated to Javascript by Les Orchard <me@lmorchard.com>
|
||||
|
||||
let toggleWord = true;
|
||||
|
||||
for (let step = 0; step < 40; step += 0.25) {
|
||||
let indent = Math.floor(26 + 25 * Math.sin(step));
|
||||
print(tab(indent), toggleWord ? "CREATIVE" : "COMPUTING");
|
||||
toggleWord = !toggleWord;
|
||||
}
|
||||
|
||||
function print(...messages) {
|
||||
console.log(messages.join(" "));
|
||||
}
|
||||
|
||||
function tab(count) {
|
||||
return " ".repeat(count);
|
||||
}
|
||||
Reference in New Issue
Block a user