Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
import tables, math, strutils, complex
|
||||
randomize()
|
||||
|
||||
proc random[T](a: openarray[T]): T =
|
||||
result = a[random(low(a)..len(a))]
|
||||
|
||||
type Point = tuple[x, y: int]
|
||||
|
||||
var world = initCountTable[Point]()
|
||||
|
||||
var possiblePoints = newSeq[Point]()
|
||||
for x in -15..15:
|
||||
for y in -15..15:
|
||||
if abs((x.float, y.float)) in 10.0..15.0:
|
||||
possiblePoints.add((x,y))
|
||||
|
||||
for i in 0..100: world.inc possiblePoints.random
|
||||
|
||||
for x in -15..15:
|
||||
for y in -15..15:
|
||||
if world[(x,y)] > 0:
|
||||
stdout.write min(9, world[(x,y)])
|
||||
else:
|
||||
stdout.write ' '
|
||||
echo ""
|
||||
Loading…
Add table
Add a link
Reference in a new issue