
GET FAMILIAR WITH RUBY
CHALLENGE: Get familiar with Ruby by creating a simple Ruby script.
What is Ruby? Wikipedia says it best:
Quote
IDEAS FOR SCRIPTS:
- Simple number guessing game.
- Script that checks if a string is a palindrome.
- A madlibs game.
- File splitter/joiner.
- XML or JSON parser.
There are a lot of good resources out there for learning Ruby. Of course, I'd suggest reading the Ruby Basics tutorial by Kingbradley6 right here on DIC.
If you would like to read more, you can visit the Ruby website, where you can even try out Ruby right from your web browser without installing anything!
Also, here's a link to the wikipedia page that I quoted.
We also have a bunch of Ruby snippets here on Dream.In.Code that you can easily use in your application:
http://www.dreaminco...owse.php?cid=22
And of course, there are some tutorials to help you get started:
Ruby: Using Loops
Block and Iterators in Ruby
A Basic Understanding of Classes inside of Ruby
How to distribute Ruby Applications
Create a Game in Ruby ~pt 1~
HOW TO GET STARTED:
I would suggest following the Ruby Quickstart guide to get started. It will help you get Ruby installed on your operating system and take you through a small tutorial that will help get you familiar with the language and the Ruby console.
Ruby files are usually saved with the .rb extension and can be ran by passing the file as an argument to Ruby.
Here's an example of a simple Ruby script file:
print "What is your name? "
name = gets.chomp
puts "Hello #{name}!"
To run this script, save it as a Ruby file (.rb), and use the command:
ruby sample_ruby_script.rb
As you can see, Ruby is easy to get setup and an amazing language to work with. I've been working with Ruby for almost 5 months now and I can say that it's definitely a favorite of mine.
If you find yourself becomming increasingly interested in Ruby, then you can look into the book Wicked Cool Ruby Scripts by Steve Pugh for more scripting ideas and to further learn the Ruby language.
I wish you luck in this challenge and more importantly, HAVE FUN WITH IT!
This challenge will self destruct in 5 seconds.

New Topic/Question
Reply



MultiQuote













|