Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # dictionary of valid words
- dict = Set{String}()
- # read each word into the dictionary
- open("/usr/share/dict/american-english") do file
- for line in eachline(file)
- push!(dict, line)
- end
- end
- # read from stdin, split on space, and compare to dict
- for line in eachline(stdin)
- words = split(line, ' ')
- for word in words
- if in(word, dict) == false
- println(word)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement