# Quick Example. 0 10000 @lcgRandInt :lcgRandInt # INPUT: integer first randInt + integer last randInt. OUTPUT: an integer in between the first and last randInt, excluding the last randInt. ->last ->first 0 @indexLcgRand01 <-last <-first sub mul <-first add asint :lcgRand01 # INPUT: none. 0 @indexLcgRand01 :indexLcgRandInt # INPUT: the index of the seed sequence + integer first randInt + integer last randInt. OUTPUT: an integer in between the first and last randInt, excluding the last randInt. ->last ->first @indexLcgRand01 <-last <-first sub mul <-first add asint :indexLcgRand01 # INPUT: the "index" of the seed sequence. OUTPUT: the next seed from that sequence. # The random numbers will be generated with the previous seed that is stored under that index. ->i <-prevSeedList[<-i] eq0 if <-i <-mapConstant add 13 mul @seededLcgRand01 dup 10000000 mul 1 add asint ->prevSeedList[<-i] 1 ->seedCountList[<-i] else <-prevSeedList[<-i] @seededLcgRand01 dup 10000000 mul <-seedCountList[<-i] 1 add dup ->seedCountList[<-i] add asint ->prevSeedList[<-i] endif :clearIndexSinLcgRand <-seedCountList clearlist <-prevSeedList clearlist :spikedLcgRandInt # INPUT: integer first randInt + integer last randInt. OUTPUT: an integer in between the first and last randInt, excluding the last randInt. ->last ->first elapsedtime dup 10 log ceil 7 sub neg 10 swap pow mul <-first <-last @seededLcgRandInt :spikedLcgRand01 elapsedtime dup 10 log ceil 7 sub neg 10 swap pow mul @seededLcgRand01 :seededLcgRandInt # INPUT: integer seed + integer first randInt + integer last randInt. OUTPUT: an integer in between the first and last randInt, excluding the last randInt. ->last ->first @seededLcgRand01 <-last <-first sub mul <-first add asint :seededLcgRand01 asint 1103515245 mul 12345 add abs asfloat 2147483647 div 10 mul dup floor sub :once # Creating lists and a starting mapconstant for the seed sequences. createlist ->prevSeedList createlist ->seedCountList getmapsize 2 div swap 2 div swap dup2 getterrain 1 add dup 99999 floodfillterrain getlistcount ->mapConstant # <-SEED ->mapconstant # Alternative for map constant.