Get started

This commit is contained in:
flaviut 2014-05-28 22:41:09 -04:00
commit ff0a2bd8a1
4 changed files with 26 additions and 7 deletions

View file

@ -0,0 +1,19 @@
Nimrod is a powerful staticly typed language that allows the programmer expressivness without comprimizing run-time performance.
``` nimrod
import tables, strutils
var wordFrequencies = initTable[string, int]
for line in stdin.lines:
for word in line.split(", "):
wordFrequencies[word] += 1
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, "'"
```