Skip to content

Instantly share code, notes, and snippets.

@nasser
Created February 11, 2012 20:02
Show Gist options
  • Select an option

  • Save nasser/1803915 to your computer and use it in GitHub Desktop.

Select an option

Save nasser/1803915 to your computer and use it in GitHub Desktop.
String Emedding in Zajal
def random_name
first = ["Billy", "Bob", "Tom", "Dick", "Harry"]
last = ["Smith", "Doe", "Gage", "Driscoll", "Nichols"]
return "#{first.sample} #{last.sample}"
end
n = random_name
draw do
k = "Hello"
text "Embedding: #{k} World!"
text "Calling functions: #{k.upcase} World!"
text ""
text "My name is: #{n}"
text "My name is: #{n.downcase}"
text "My name is (runs every frame!): #{random_name} "
text "My lucky number is (runs every frame!): #{random(2000)}"
text ""
text "Zajal #{ZAJAL_VERSION}"
text "openFrameworks #{OF_VERSION}"
text "Ruby #{RUBY_VERSION}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment