syntax switch

vincent vega wrote:

hi! i dont know, how the syntax for a switch-case loop, works.

i tried something like: x = 1 switch(x) case 1: return "bla bla" case 2: return "hoho" end

You want:

case x when 1   return "bla bla" when 2   return "hoho" end

For more info, see: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#S5

Chris