Skip to content

Commit 2ee1b54

Browse files
author
Andrew Waterman
committed
Seed random number generator for determinism
1 parent 821e0f0 commit 2ee1b54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/Life.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Life(val n: Int) extends Module {
2828
val state = Vec(Bool(OUTPUT), tot)
2929
}
3030
def idx(i: Int, j: Int) = ((j+n)%n)*n+((i+n)%n)
31-
val rnd = new Random()
31+
val rnd = new Random(1)
3232
val cells = Range(0, tot).map(i => Module(new Cell(rnd.nextInt(2) == 1)))
3333
for (k <- 0 until tot)
3434
io.state(k) := cells(k).io.out

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy