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/",
|
"output": "../build/",
|
||||||
|
|
||||||
"title": "Nimrod by Example",
|
"title": "Nimrod by Example",
|
||||||
"description": "A book of short examples of Nimrod features",
|
"description": "A book of short examples of Nimrod features",
|
||||||
|
|
||||||
"github": null,
|
"github": null,
|
||||||
"githubHost": "https://github.com/",
|
"githubHost": "https://github.com/",
|
||||||
|
|
||||||
"plugins": [],
|
"plugins": [],
|
||||||
|
|
||||||
"links": {
|
"links": {
|
||||||
"home": "http://nimrod-lang.org/",
|
"home": "http://nimrod-lang.org/",
|
||||||
|
|
||||||
"about": null,
|
"about": null,
|
||||||
"issues": null,
|
"issues": null,
|
||||||
"contribute": null,
|
"contribute": null,
|
||||||
|
|
||||||
"sharing": {
|
"sharing": {
|
||||||
"google": false,
|
"google": false,
|
||||||
"facebook": false,
|
"facebook": false,
|
||||||
"twitter": false
|
"twitter": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue