From: Tim Chen Date: 2010-11-23T03:24:14+09:00 Subject: Re: help with simple game --001636416495dd97e10495a85c7b Content-Type: text/plain; charset=ISO-8859-1 You can copy and paste ofcourse. But if you're going to do anything serious with Ruby, you gotta start creating a folder and have ruby files (*.rb). Copy and paste the code into a ruby file and run it using the command line % ruby car.rb And ruby is a script language, which there is no compiling (build) needed. The most common building is when you want to pack your code into a ruby gem, and you'll most likely want to use rake (with a Rakefile). Tim On Mon, Nov 22, 2010 at 10:06 AM, Blake Atl wrote: > Andrew Wagner wrote in post #963161: > > This sounds more like a homework problem, but I'll give you the benefit > > of > > the doubt. > > > > You can start with something like this: > > > > CARS = { > > 'mustang' => [300.0, 3480], > > 'camaro' => [300.0, 3780] > > } > > > > car1,car2 = ARGV > > > > def compare car1, car2 > > ratio1 = ratio car1 > > ratio2 = ratio car2 > > > > ratio1 >= ratio2 ? car1 : car2 > > end > > > > def ratio car > > CARS[car][0] / CARS[car][1] > > end > > > > puts compare car1, car2 > > allrite allrite, how do i insert this in an interactive ruby window? > where do i go to build this code? > > im actually interning at a communications company > > -- > Posted via http://www.ruby-forum.com/. > > --001636416495dd97e10495a85c7b--