From d812b28505ae2e12f58dcc47b464325e5abd581e Mon Sep 17 00:00:00 2001 From: flaviut Date: Thu, 17 Jul 2014 12:24:22 -0400 Subject: [PATCH] Fix non-compiling code --- content/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/index.md b/content/index.md index 0b4d3ef..32818f0 100644 --- a/content/index.md +++ b/content/index.md @@ -11,18 +11,18 @@ Getting started? Head over to the [installation instructions](/getting_started/) ``` nimrod import tables, strutils -var wordFrequencies = initTable[string, int] +var wordFrequencies = initTable[string, int]() for line in stdin.lines: for word in line.split(", "): - wordFrequencies[word] += 1 + wordFrequencies[word] = wordFrequencies[word] + 1 -var maxFrequency = 0 +var maxFrequency = 0 var mostFrequentWord: string for word, frequency in wordFrequencies: if frequency > maxFrequency: maxFrequency = frequency mostFrequentWord = word -echo "The most frequent word is '", word, "'" +echo "The most frequent word is '", mostFrequentWord, "'" ``` \ No newline at end of file