Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
def- committed Jul 26, 2014
1 parent 90ba48d commit 5fb4ddc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions filetape.nim
@@ -0,0 +1,3 @@
var t = open("/dev/tape", fmWrite)
t.writeln "Hi Tape!"
t.close
13 changes: 13 additions & 0 deletions linearcongruential.nim
@@ -0,0 +1,13 @@
proc bsdRand(seed: int): iterator: int =
var seed = seed
result = iterator: int =
while true:
seed = (1103515245 * seed + 12345) and 0x7fffffff
yield seed

proc msvcrtRand(seed: int): iterator: int =
var seed = seed
result = iterator: int =
while true:
seed = (214013 * seed + 2531011) and 0x7fffffff
yield seed
3 changes: 3 additions & 0 deletions parametricpolymorphism.nim
@@ -0,0 +1,3 @@
type Tree[T] = ref object
value: T
left, right: Tree[T]

0 comments on commit 5fb4ddc

Please sign in to comment.