FANDOM


ArraysEdit

Arrays store a list of values in a single variable. It can hold any type of values including intergers, strings, booleans, and arrays. Each value has an index. The 1st index is 0; the 2nd index is 1; the 3rd index is 2, etc.

        +---+---+---+---+---+
array   [ 5 , 7 , 9 , 2 , 0 ]
        +---+---+---+---+---+
index     0   1   2   3   4

An array of arrays are called multidimensional arrays. They are 2 dimensional, like arrays of arrays and squares. A single array is 1-dimensional.

my_2d_array = [[1,2,3,4], [5,6,7,8], [9, 10, 11, 12]]

BooleansEdit

Logical OperatorsEdit

  • && (and)
true && true # => true
true && false # => false
false && true # => false
false && false # => false
  • || (or)
true || true # => true
true || false # => true
false || true # => true
false || false # => false
  •  != (not)
!true # => false
!false # => true

Comparison OperatorsEdit

x == y // returns true if two things are equal
x != y // returns true if two things are not equal
x <= y // returns true if x is less than or equal to y
x >= y // returns true if x is greater than or equal to y
x < y // returns true if x is less than y
x > y // returns true if x is greater than y

CommentsEdit

Single-lineEdit

#this is a single-lined comment.

Multi-lineEdit

=begin
this is a multi-lined comment.
hello world!
=end

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.