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 :
– # separator
(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.
I put a carriage return after the – => my program was interpreting like
this : “”
Using my generator, I was able to generate these names :
I’m wondering why does “violet” come twice (at the end) and why does
“brick” doesn’t have any name after…