Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Ruby is so fucking cool as fuck

Name: Anonymous 2011-08-20 8:21

So I was working on some LOL JAVA earlier (blackberry app) and basically I have a set of background images for different size blackberries, and load the appropriate run at runtime based on the Display.getWidth and getHeight

But also i do some set up of button sizes etc also.

Then I thought would it be cool if I could do a switch on an array

eg switch [width,height]

Now I haven;t tried it in Java, but I thought I bet ruby will do it, and blow me it does:


#!/usr/bin/env ruby

case [ARGV[0],ARGV[1]]
    when ["foo","bar"]
        puts "fooooooo baaaaar"
    when ["hello","world"]
        puts "helllloooo wooooorld"
    else
        puts "hmmmmmm"
end

Name: Anonymous 2011-08-20 10:25

I give it a non-sage bump.
Cause this code is almost
   as whorish as me.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List