Skip to content

Instantly share code, notes, and snippets.

@morganp
Created April 18, 2010 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save morganp/370533 to your computer and use it in GitHub Desktop.
Save morganp/370533 to your computer and use it in GitHub Desktop.
#Small function to generate a comma delimited dictionary on a unix system
def gen_dictionary
f = open("| cat /usr/share/dict/words")
g = Array.new
while (foo = f.gets)
g << foo
end
g.each do |element|
element = element.strip
print element + ","
end
end
gen_dictionary
@latentflip
Copy link

Totally forked this.

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