From 508c4ab81a7068986ae818768b1444bbbd83b9c7 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sat, 17 May 2025 14:13:10 -0700 Subject: Wrap random source Havne't dont too much investigation if PCG is a good choice; this give some freedom to move later --- src/sandbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sandbox.cpp') 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); -- cgit v1.2.3-70-g09d2