Quote:
Originally Posted by das123
Thanks for the feedback.
With Fiddle Prov%, is it a logrithmic scale, linear scale, or some other formula. I'm wondering if 100 in the builder is really 50% or some other figure?
|
Nothing fancy, just a brute force applied via a blunt hammer.

Here is the relevant code:
Code:
REM Set fiddleCount (how many provinces to modify)...
fiddleCount=int(((provCount*fiddlePercent)/100))
REM Select random provinces to mark for modification...
fin=false
i=0
attempts=0 REM Saftey to prevent risk of infinite loop...
while (fin=false)
attempts=attempts+1
x=int(ran(provCount))+1
if terFlag(x)=0 then
if offLimits(x)=1 then
terFlag(x)=-1
else
i=i+1
terFlag(x)=1
endif
endif
if attempts>=(provCount*(10*fiddlePercent)) then
PRINT #9 "*** WARNING: ATTEMPTS >= (10xfiddlePercent)xProvCount ***"
PRINT #9 "Could not select desired number of provinces for modification."
endif
if (i>=fiddleCount) or (attempts>=(provCount*(10*fiddlePercent))) then
fin=true
endif