Get started
This commit is contained in:
parent
2ae7287c3c
commit
ff0a2bd8a1
4 changed files with 26 additions and 7 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
build/
|
||||
|
|
@ -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, "'"
|
||||
```
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Summary
|
||||
|
||||
Nimrod is a statically typed, imperative programming language that gives the
|
||||
programmer powerful compile-time tools, allowing for expressiveness without
|
||||
compromising run-time efficiency.
|
||||
|
|
@ -1,25 +1,19 @@
|
|||
{
|
||||
"output": "../build/",
|
||||
|
||||
"title": "Nimrod by Example",
|
||||
"description": "A book of short examples of Nimrod features",
|
||||
|
||||
"github": null,
|
||||
"githubHost": "https://github.com/",
|
||||
|
||||
"plugins": [],
|
||||
|
||||
"links": {
|
||||
"home": "http://nimrod-lang.org/",
|
||||
|
||||
"about": null,
|
||||
"issues": null,
|
||||
"contribute": null,
|
||||
|
||||
"sharing": {
|
||||
"google": false,
|
||||
"facebook": false,
|
||||
"twitter": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue