Created
February 11, 2012 20:02
-
-
Save nasser/1803915 to your computer and use it in GitHub Desktop.
String Emedding in Zajal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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