Skip to content

Instantly share code, notes, and snippets.

@solon
Created June 29, 2010 10:48
Show Gist options
  • Save solon/457068 to your computer and use it in GitHub Desktop.
Save solon/457068 to your computer and use it in GitHub Desktop.
# WIP of http://wiki.processing.org/w/Ruby_Comparison
# Based on http://wiki.processing.org/w/Python_Comparison
# todo:
# - write intro paragraph on Ruby
# - add more examples
# - add a separate RubyProcessing_Comparison wiki entry for ruby-processing
# [http://wiki.github.com/jashkenas/ruby-processing/]
# Data
x = 70 # Initialize
x = 30 # Change value
x = 70.0
x = 30.0
a = [5, 10, 11] # Create an array
a[0] = 12 # Reassign
# Control
while true
# Statements
end
if c == 1
# Statements
end
if c.equal?(1)
# Statements
end
if c != 1
# Statements
end
if c < 1
# Statements
end
if c >= 1
# Statements
end
if c != 1
# Statements
end
if c >= 1 and c < 20
# Statements
end
if c >= 20
# Statements
elsif x == 0
# Statements
else
# Statements
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment