“'ĖøÆḳƙ’ḃ7ṣ6+\+3r/ċ€×“½½½½©ÐÇı‘
“ŀỊẋ8ƒ³ẈRɼƈñqẋẏȧɱḌ<ṄỴḳ⁾ÆʋeẒĊ'@ƬØƓƝ}ḟ¬»ỴW€ẋ"ÇẎX
接受整数(在[4,11]中)的单子链接,该整数返回字符列表。
在线尝试!
怎么样?
将行星的热量范围创建为列表列表,并对这些列表中输入热量的出现进行计数,以获得零和一个表示可能的行星类型的列表,然后乘以八种行星类型的似然数,得出得到分配。该分布用于重复行星类型的名称,最后做出统一的随机选择。
“'ĖøÆḳƙ’ḃ7ṣ6+\+3r/ċ€×“½½½½©ÐÇı‘ - Link 1, getDistribution: integer
“'ĖøÆḳƙ’ - base 250 integer = 39824688429662
ḃ7 - to bijective-base 7 = [1,1,2,4,7,1,4,4,6,2,2,2,2,1,5,3,3]
ṣ6 - split at sixes = [[1,1,2,4,7,1,4,4][2,2,2,2,1,5,3,3]]
\ - cumulative reduce with:
+ - addition = [[1,1,2,4,7,1,4,4][3,3,4,6,8,6,7,7]]
+3 - add three = [[4,4,5,7,10,4,7,7],[6,6,7,9,11,9,10,10]]
/ - reduce with:
r - inclusive range = [[4,5,6],[4,5,6],[5,6,7],[7,8,9],[10,11],[4,5,6,7,8,9],[7,8,9,10],[7,8,9,10]]
ċ€ - count (input) in €ach e.g. for 5: [1, 1, 1, 0,0, 1, 0, 0]
“½½½½©ÐÇı‘ - list of code-page indices [10,10,10,10,6,15,14,25]
× - multiply [10,10,10, 0,0,15, 0, 0]
“ ... »ỴW€ẋ"ÇẎX - Main link: integer
“ ... » - compressed string = "Ice\nIce Giant\nGaia class\nDense Atmosphere\nLava\nGas Giant\nIron\nDesert"
Ỵ - split at new lines = ["Ice","Ice Giant","Gaia class","Dense Atmosphere","Lava","Gas Giant","Iron","Desert"]
W€ - wrap €ach in a list
Ç - call last link (1) as a monad e.g. for 5: [10,10,10,0,0,15,0,0]
" - zip with:
ẋ - repeat e.g. for 5: [["Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice"],["Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant"],["Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class"],["Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant"]]
Ẏ - tighten ["Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Ice Giant","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gaia class","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant","Gas Giant"]
X - a random choice from that list