J
Justin D.
Hello!
I created a name generator in Ruby. Basically, I have a file
(default.txt) that contains words. These words are separated in two :
"adjectives" and "nouns". Result : adjective noun .
In my file default.txt, I use this scheme :
adjective_1
adjective_2
adjective_3
adjective_n
-- # separator
noun_1
noun_2
noun_3
noun_n
(*NOTE*: I added another category : "separators" to separate adjectives
and nouns (eg.: " ", _ - |) => adjective_noun or adjective noun)
I would simply like to know if my code is optimize and if it follow
Ruby's way enough.
Thanks!
Attachments:
http://www.ruby-forum.com/attachment/6043/name_generator.rb
http://www.ruby-forum.com/attachment/6044/default.txt
I created a name generator in Ruby. Basically, I have a file
(default.txt) that contains words. These words are separated in two :
"adjectives" and "nouns". Result : adjective noun .
In my file default.txt, I use this scheme :
adjective_1
adjective_2
adjective_3
adjective_n
-- # separator
noun_1
noun_2
noun_3
noun_n
(*NOTE*: I added another category : "separators" to separate adjectives
and nouns (eg.: " ", _ - |) => adjective_noun or adjective noun)
I would simply like to know if my code is optimize and if it follow
Ruby's way enough.
Thanks!
Attachments:
http://www.ruby-forum.com/attachment/6043/name_generator.rb
http://www.ruby-forum.com/attachment/6044/default.txt