Announcing Programmr's new site - AI Camp - start coding cool AI programs - all in your browser!


942 reads

March 5, 2013

Case with Strings

You can also use non-integer types such as string. If multiple trigger values are specified in a when section, they may be of varying types – for example, both string and integers:

930 reads

March 5, 2013

More on Case

Working with Case Statement

1016 reads

March 5, 2013

Case Break

Learn how to break to get specific output.

893 reads

March 5, 2013

Case Statement

When you need to take a variety of different actions based on the value of a single variable, multiple if..elsif tests are verbose and repetitive.

883 reads

March 5, 2013

Boolean Operators

and &&
These operators evaluate the left-hand side then, only if the result is true, they evaluate the right-hand side; and has lower precedence than &&

or ||

970 reads

March 5, 2013

Wrong Use of and or

This Example tell how not to use the and or operator as it does not give correct results every time.

1033 reads

March 5, 2013

and or

Learn how to use and and or Operator in Ruby

930 reads

March 4, 2013

Using Upto and Downto

Using Upto and Downto continuous loop

921 reads

March 4, 2013

Using Until

Ruby also has an until loop which can be thought of as a ‘while not’ loop.

789 reads

March 4, 2013

Create An Array Using Two Sub-arrays

An array with two sub-arrays - i.e. 2 'rows' each with 4 elements