diff options
author | rtk0c <[email protected]> | 2025-05-17 14:13:10 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2025-05-17 14:13:10 -0700 |
commit | 508c4ab81a7068986ae818768b1444bbbd83b9c7 (patch) | |
tree | 2caa6da7bd894ff765ed88302355b0e110aba587 /src/sandbox.cpp | |
parent | 03f4c32dd3a868c2ff1858b029429ca7929a11d7 (diff) |
Wrap random source
Havne't dont too much investigation if PCG is a good choice; this give some freedom to move later
Diffstat (limited to 'src/sandbox.cpp')
-rw-r--r-- | src/sandbox.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sandbox.cpp b/src/sandbox.cpp index 6daa807..85a4850 100644 --- a/src/sandbox.cpp +++ b/src/sandbox.cpp @@ -29,7 +29,7 @@ Sandbox::Sandbox(int w, int h) : _bitmap(w * h) , _a(w * h) // TODO random seed - , _pcg() + , _rand() , _wall_tile{ Tile::ROCK } , width{ w } , height{ h } // @@ -63,7 +63,7 @@ static void simulate_sand_tile(Sandbox& self, int x, int y) { } else { Pt loc1[]{ Pt(x - 1, y - 1), Pt(x + 1, y - 1) }; auto bound = 2; - auto which = self._pcg.next_u32(bound); + auto which = self._rand.next_u32(bound); for (int i = 0; i < bound; ++i) { // Try going to a side auto at1 = self.gs(loc1[i].x, loc1[i].y); |