Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Chaos Scrolling Probabilities (C++)
#6
Here, in python.
Quote:def ScrollProb(start, maxcount, minnum):
per = scrollProbLoop(start, 1, 1.0, maxcount, minnum)
print (per)


def scrollProbLoop(total, count, prob, maxCount, minnum):
per = 0
for i in range(-6, 6):
tempTot = total
tempProb = prob
if(i == -6):
tempProb *= 0.4
else:
tempProb *= (0.6 * (1.0/11.0))
tempTot += i
if(tempTot < 0):
tempTot = 0
if(count < maxCount and tempTot != 0):
per += scrollProbLoop(tempTot, count + 1, tempProb, maxCount, minnum)
elif(count == maxCount and tempTot >= minnum):
per += tempProb
return per

Appears to be it.
Reply


Messages In This Thread
Chaos Scrolling Probabilities (C++) - by »-Chris-&gt; - 2009-02-07, 03:52 AM
Chaos Scrolling Probabilities (C++) - by Stereo - 2009-02-07, 01:02 PM
Chaos Scrolling Probabilities (C++) - by Harrisonized - 2009-02-08, 05:14 AM
Chaos Scrolling Probabilities (C++) - by DeadHead - 2009-02-08, 05:42 PM
Chaos Scrolling Probabilities (C++) - by Harrisonized - 2009-02-08, 06:38 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)