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:
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