Given the input text file, the program should write to disk a ranking
of words sorted by frequency, like:
the : 52483
and : 32558
of : 23477
a : 22486
to : 21993
My first implementation:
(defn topwords
My version:
(defn top-words [input-filename result-filename]
(spit result-filename
(apply str
(map #(format %s : %d\n (first %) (second %))
(sort-by #(-(val %))
(reduce #(conj %1 { %2 (inc (%1 %2 0)) }) {}
Hi,
Am 25.12.2008 um 17:24 schrieb wwmorgan:
A better implementation would split the different steps of the program
into separate functions. This increases readability and testability of
the source code, and encourages the reuse of code in new programs.
Yes. One can think of the data flowing
Snake frame would appear with square ball that moves and another that does
not move.Below is what I got each time I try to play with arrow keys. I
count on you as always to come to my help.
user= (require 'snake)
nil
user= (snake/run-snake)nil
user=
Exception in thread AWT-EventQueue-0
On Thu, Dec 25, 2008 at 5:52 PM, Emeka emekami...@gmail.com wrote:
Exception in thread AWT-EventQueue-0
java.lang.UnsupportedOperationException: keyReleased
It was to avoid this exception that my version included an empty
implementation of keyReleased.
--Chouser