Strict Standards: Non-static method phpbb_feed_factory::init() should not be called statically in /home/jacius/rubygame/forums/feed.php on line 66
[phpBB Debug] PHP Notice: in file /feed.php on line 171: Cannot modify header information - headers already sent by (output started at /feed.php:66)
[phpBB Debug] PHP Notice: in file /feed.php on line 172: Cannot modify header information - headers already sent by (output started at /feed.php:66)
Rubygame Forums 2010-04-13T23:06:08+00:00 http://rubygame.org/forums/feed.php?f=5&t=112 2010-04-13T23:06:08+00:00 http://rubygame.org/forums/viewtopic.php?t=112&p=469#p469 <![CDATA[Re: RTJ - Ruby Terminal Jukebox]]> Statistics: Posted by shawn42 — Tue Apr 13, 2010 11:06 pm


]]>
2010-04-13T19:58:34+00:00 http://rubygame.org/forums/viewtopic.php?t=112&p=468#p468 <![CDATA[RTJ - Ruby Terminal Jukebox]]>
I finally got a code to function properly!
It is a jukebox script.
Here's the code:
Code:
require "Rubygame"
include Rubygame
# Credits - DO NOT DELETE!!!
puts "RTJ - Ruby Terminal Jukebox"
puts "Made by Nicholas D. West"
puts "Made with Ruby and Rubygame"
# Repeat This Code
loop = 0
until loop == 1
# Fetch the input, puppy!
print "Input: "
input = gets.chomp
# if the input matches the code...
if input == "nw" then
# ...Play the song!
music = Music.load("nw.mp3")
puts "ERROR: Music file doesn't exist" if music == nil
music.play
puts "Playing..."
# Another Example!
elsif input == "md" then
music = Music.load("md.mp3")
puts "ERROR: Music file doesn't exist" if music == nil
music.play
puts "Playing..."
# But what if the input is wrong?
else
puts "ERROR: Unreckognized Input"
end
end

Statistics: Posted by cavygalaxy — Tue Apr 13, 2010 7:58 pm


]]>