Files
basic-computer-games/78_Sine_Wave/ruby/sinewave.rb
Chris Reuter d26dbf036a Removed spaces from top-level directory names.
Spaces tend to cause annoyances in a Unix-style shell environment.
This change fixes that.
2021-11-21 18:30:21 -05:00

15 lines
313 B
Ruby

def intro
puts " SINE WAVE
CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n\n\n\n\n\n"
end
def main
intro
(0..40).step(0.25).each do |t|
a = (26 + 25 * Math.sin(t)).to_i
text = (t % 0.5) == 0 ? "CREATIVE" : "COMPUTING"
puts " " * a + text
end
end
main