From fa44b91511c2ab5c2bbb30bfce0dac4dae6b7e3a Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 3 Aug 2017 09:49:03 -0700 Subject: [PATCH] revise comment clarity achieved during sleep :) --- PKHeX.Core/Legality/RNG/RNG.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Legality/RNG/RNG.cs b/PKHeX.Core/Legality/RNG/RNG.cs index cedb2b423..ebbb206a8 100644 --- a/PKHeX.Core/Legality/RNG/RNG.cs +++ b/PKHeX.Core/Legality/RNG/RNG.cs @@ -37,8 +37,9 @@ private void PopulateMeetMiddleArrays() flags[val] = true; low8[val] = (byte)i; - // when calculating the left side, sometimes the low bits might not carry - // (something not considered in loop's calc?) + // the second rand() also has 16 bits that aren't known. It is a 16 bit value added to either side. + // to consider these bits and their impact, they can at most increment/decrement the result by 1. + // with the current calc setup, the search loop's calculated value may be -1 (loop does subtraction) // since LCGs are linear (hence the name), there's no values in adjacent cells. (no collisions) // if we mark the prior adjacent cell, we eliminate the need to check flags twice on each loop. --val;