On Nov 19, 10:01=A0pm, flebber <flebber.c... / gmail.com> wrote:
> On Nov 19, 9:01=A0pm, Shadowfirebird <shadowfireb... / gmail.com> wrote:
>
>
>
> > [Note: =A0parts of this message were removed to make it a legal post.]
>
> > > Can a case statement return multiple correct cases?
>
> > > >nope.
>
> > But this will, and it's no less compact than a case statement IMO:
>
> > wins =3D []
> > wins << 1 if (a > 3)
> > wnis << 2 if (a > 5)
> > wins << 3 if (a < 7)
> > wins << 4 if (a < 3)
>
> > For a =3D 4, wins should be [1,3]. =A0 Hopefully you get the idea.
>
> > --
> > What a tangled web we weave / Go 'round with circumstance / Someone sho=
w me
> > how to tell / The dancer from the dance...
>
> I like your example so I started reading.
>
> if for each wins in your example their was two conditions I could then
> chain them together with an and. Awesome thanks.
>
> So following your example where wins =3D [1,3] ( still not sure why ruby
> doesn't have a multiple case select) can I use "and" "or"
>
> If wins =3D 1 puts "for option 1 x =3D A_value and y =3D B_value"
> =A0 =A0 and or
> If wins =3D 2 puts "for option 2 x =3D A_value and y =3D B_value"
> =A0 =A0 and or
> If wins =3D 3 puts "for option 3 x =3D A_value and y =3D B_value"
> =A0 =A0 and or
> If wins =3D 4 puts "for option 2 x =3D A_value and y =3D B_value"
> else puts " There were no valid options"

I apologise. Combination of learning and tired. I woke up in the
middle of the night and went while statement or case statement. Silly
me found this this morning.
http://www.skorks.com/2009/08/how-a-ruby-case-statement-works-and-what-you-=
can-do-with-it/