Skip to content

Instantly share code, notes, and snippets.

@nattarnoff
Created August 27, 2012 02:52
Show Gist options
  • Save nattarnoff/3485176 to your computer and use it in GitHub Desktop.
Save nattarnoff/3485176 to your computer and use it in GitHub Desktop.
First .rb I have written without a guide. Its simple, but feels like a big win right now.
class Haiku
def initialize
five_syllables(1)
seven_syllables
five_syllables(0)
end
def five_syllables(line)
if line == 1
puts "This is a haiku"
else
puts "This is the end now"
end
end
def seven_syllables
puts "This line has more syllables"
end
end
haiku = Haiku.new
@nattarnoff
Copy link
Author

Good idea, but the next phase o fthis script will be fetching words and building haiku sentences.

Looks like I will use the wordnik API to fill in definition, word type (nouns, verb, etc), and syllables into a csv for the most popular words.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment