From 0788e66d429e7fdf1ac83375fdbb14d73383ea8f Mon Sep 17 00:00:00 2001 From: arthur Date: Fri, 12 Dec 2025 10:25:25 +0700 Subject: [PATCH] update bug on number of scroll --- src/components/SlotMachine.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/SlotMachine.jsx b/src/components/SlotMachine.jsx index c234b30..e809f3c 100644 --- a/src/components/SlotMachine.jsx +++ b/src/components/SlotMachine.jsx @@ -112,8 +112,13 @@ export function SlotMachine({ winner, isSpinning, onAnimationComplete, onDraw, p const numbers = []; const sequence = randomSequences[reelIndex]; - // Repeat the randomized sequence NUM_DUPLICATES times, then one final cycle - for (let i = 0; i < NUM_DUPLICATES + 1; i++) { + // For the first reel (only 0-1), we need more repetitions to fill the strip + // For other reels (0-9), use normal repetitions + const repetitions = reelIndex === 0 + ? (NUM_DUPLICATES + 1) * 5 // First reel: repeat 30 times (2 numbers × 30 = 60 total) + : (NUM_DUPLICATES + 1); // Other reels: repeat 6 times (10 numbers × 6 = 60 total) + + for (let i = 0; i < repetitions; i++) { sequence.forEach(num => numbers.push(num)); }