mattheww
and many others are using
Hackety Hack
to learn how to code.
Hackety Hack is a free program for Windows, Mac OS X and Linux that can teach you how to make games, applications and more and share those programs with your friends. You can ask other budding programmers questions and follow them to see what code they're working on through the Hackety Hack website.
Sign up
Learn More
require "bloops"
def make_instrument b, sound_shape, volume, sustain, attack, decay
instrument = b.sound sound_shape
instrument.volume = volume
instrument.sustain = sustain
instrument.attack = attack
instrument.decay = decay
return instrument
end
def make_bloops speed, melody
b = Bloops.new
b.tempo = speed
instrument = make_instrument b, Bloops::SAWTOOTH, 0.8, 0.6, 0.1, 0.2
b.tune instrument, melody
return b
end
def play_happy
happy_1 = '6c 12c 4d 4c 4f 2e '
happy_2 = '6c 12c 4d 4c 4g 2f '
happy_3 = '6c 12c + 4c - 4a 4f 4e 2d '
happy_4 = '6a# 12a# 4a 4f 4g 2f '
b = make_bloops 180, happy_1 + happy_2 + happy_3 + happy_4
b.play
end
Shoes.app :title => "Happy Birthday!", :width => 740, :height => 600 do
background black
play_happy
end