Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Anagrams/Smalltalk/anagrams-1.st
Normal file
7
Task/Anagrams/Smalltalk/anagrams-1.st
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
list:= (FillInTheBlank request: 'myMessageBoxTitle') subStrings: String crlf.
|
||||
dict:= Dictionary new.
|
||||
list do: [:val|
|
||||
(dict at: val copy sort ifAbsent: [dict at: val copy sort put: OrderedCollection new])
|
||||
add: val.
|
||||
].
|
||||
sorted:=dict asSortedCollection: [:a :b| a size > b size].
|
||||
10
Task/Anagrams/Smalltalk/anagrams-2.st
Normal file
10
Task/Anagrams/Smalltalk/anagrams-2.st
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
d := Dictionary new.
|
||||
'unixdict.txt' asFilename
|
||||
readingLinesDo:[:eachWord |
|
||||
(d at:eachWord copy sort ifAbsentPut:[OrderedCollection new]) add:eachWord
|
||||
].
|
||||
|
||||
((d values select:[:s | s size > 1])
|
||||
sortBySelector:#size)
|
||||
reverse
|
||||
do:[:s | s printCR]
|
||||
1
Task/Anagrams/Smalltalk/anagrams-3.st
Normal file
1
Task/Anagrams/Smalltalk/anagrams-3.st
Normal file
|
|
@ -0,0 +1 @@
|
|||
'http://wiki.puzzlers.org/pub/wordlists/unixdict.txt' asURI contents asCollectionOfLines do:[:eachWord | ...
|
||||
Loading…
Add table
Add a link
Reference in a new issue