Computer Programming with the Nim Programming Language
2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = var last = vertices.pop() # arbitrary start point, assume that we have forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 865 页 | 7.45 MB | 1 年前3
Computer Programming with the Nim Programming Language
2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = var last = vertices.pop() # arbitrary start point, assume that we have forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 784 页 | 2.13 MB | 1 年前3
Computer Programming with the Nim Programming Language2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = 353 var last = vertices.pop() # arbitrary start point, assume that we forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 512 页 | 3.54 MB | 1 年前3
Computer Programming with the Nim Programming Language2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = 350 var last = vertices.pop() # arbitrary start point, assume that we forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 508 页 | 3.50 MB | 1 年前3
Computer Programming with the Nim Programming Language2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = 353 var last = vertices.pop() # arbitrary start point, assume that we forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 512 页 | 3.53 MB | 1 年前3
Computer Programming with the Nim Programming Language2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = 350 var last = vertices.pop() # arbitrary start point, assume that we forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 508 页 | 3.54 MB | 1 年前3
Computer Programming with the Nim Programming Language2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = 350 var last = vertices.pop() # arbitrary start point, assume that we forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 508 页 | 3.50 MB | 1 年前3
Computer Programming with the Nim Programming Language2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = 350 var last = vertices.pop() # arbitrary start point, assume that we forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 508 页 | 3.52 MB | 1 年前3
Computer Programming with the Nim Programming Language2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = 350 var last = vertices.pop() # arbitrary start point, assume that we forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 508 页 | 3.53 MB | 1 年前3
Computer Programming with the Nim Programming Language2 * BorderDist) Points = 50 type Vertex = ref object x, y: float friend: Vertex dist: float = Inf var vertices: seq[Vertex] forest: seq[Vertex] proc init = randomize() for i in in 0 ..< Points: vertices.add(Vertex(x: rand(DataRange) + BorderDist, y: rand(DataRange) + BorderDist)) proc createForest = 353 var last = vertices.pop() # arbitrary start point, assume that we forest.add(last) # add it to forest and vertices.del(pos) # delete it from the still unconnected vertex set init() let start = cpuTime() createForest() echo "elapsed: ", (cpuTime() - start) * 1e3, "0 码力 | 512 页 | 3.50 MB | 1 年前3
共 28 条
- 1
- 2
- 3













