Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Ruby Programming Language

quizz 126


Hi,
here is the one i came up with:

------first-----------------------------

c=100

def chaos_coop x
                a1,a2 = (x % 3 == 0) ? ["Fizz","Fizz"] : ["",x]
                (x % 5 == 0) ?  a1 +"Buzz" : a2
        end

(1..c).each {|x|
        puts chaos_coop(x) }

-----second-----------------------------------

c=100
def square_coop x
        a3=(x % 3 == 0) ? 1 : 0
        a5=(x % 5 == 0) ? 2 : 0

        case a3+a5
                when 0 : x
                when 1 : "Fizz"
                when 2 : "Buzz"
                when 3 : "FizzBuzz"
        end
end

(1..c).each {|x|
        puts square_coop(x) }

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc