ゼリー、 67 65 64 66 64 63 バイト
”?;ØAx“³Ċu~Ṿr¥rṇ⁽ȦƑ’ḃ12¤µŒl⁾?!yW,WKF€
H3ṬṚ¤ṁ‘1¦ṚŒḄ0,0j«þ`ị¢X€€Y
数値を取り、文字のリストを返すモナディックリンク、または結果を出力する完全なプログラム。
オンラインでお試しください!(私はそれがより正方形であるのG
ではなく使用することを好みます)Y
どうやって?
”?;ØAx“³Ċu~Ṿr¥rṇ⁽ȦƑ’ḃ12¤µŒl⁾?!yW,WKF€ - Link 1, getLetterSets: no arguments
”? - literal '?'
ØA - yield uppercase alphabet
; - concatenate
¤ - nilad followed by link(s) as a nilad:
“³Ċu~Ṿr¥rṇ⁽ȦƑ’ - base 250 number
ḃ12 - converted to bijective base 12 (frequencies)
x - times (repeat each)
µ - start a new monadic chain, call that uppers
Œl - to lower-case
⁾?! - literal ['?','!']
y - translate (change '?'s to '!'s)
W - wrap (that) in a list
W - wrap (uppers) in a list
, - pair
K - join with a space, ' '
F€ - flatten €ach (both flattens the wrapped lists
- AND makes the lone ' ' into [' '])
H3ṬṚ¤ṁ‘1¦ṚŒḄ0,0j«þ`ị¢X€€Y - Main link: number, n e.g. 13
H - halve 6.5
¤ - nilad followed by link(s) as a nilad:
3 - literal three 3
Ṭ - untruth [0,0,1]
Ṛ - reverse [1,0,0]
ṁ - mould like (implicit range(int(right))) [1,0,0,1,0,0]
¦ - sparse application:
1 - ...to indices: 1
‘ - ...action: increment [2,0,0,1,0,0]
Ṛ - reverse [0,0,1,0,0,2]
ŒḄ - bounce [0,0,1,0,0,2,0,0,1,0,0]
0,0 - literal [0,0] [0,0]
j - join [0,0,0,1,0,0,2,0,0,1,0,0,0]
` - repeat left argument as right argument with:
þ - outer product using: [[0,0,0,0,0,0,0,0,0,0,0,0,0],
« - minimum [0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,1,0,0,1,0,0,1,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,1,0,0,2,0,0,1,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,1,0,0,1,0,0,1,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0]]
¢ - call the last link (1) as a nilad (the letter sets)
ị - index into - gets the correct letter sets for each cell
X€€ - random-choice for €ach cell in €ach row
Y - join with newlines
- if running as a full program: implicit print