⁹
HḂ+2⁹Ḳ¤ḣK;⁸ị“¥ḄḞ“ḋṗYP8ḷẇ?Ṅ“¡Ạ ṙṗ%»¤
0ịVĊŀ
結果を出力する完全なプログラム。
オンラインでお試しください!
どうやって?
⁹ - Link 1: yield right argument: number a, list of characters b
⁹ - link's right argument, b
HḂ+2⁹Ḳ¤ḣK;⁸ị“¥ḄḞ“ḋṗYP8ḷẇ?Ṅ“¡Ạ ṙṗ%»¤ - Link 0: change a name: number a, list of characters b
...Note: at this point a will be 0, 2 or 4 for USA, 2 and 4 respectively
H - halve a (0,1, or 2)
Ḃ - mod 2 (0,1, or 0)
+2 - add 2 (2,3, or 2)
¤ - nilad followed by link(s) as a nilad:
⁹ - link's right argument, b
Ḳ - split at spaces
ḣ - head (first two for USA or 4, first three for 2)
K - join with spaces
¤ - nilad followed by link(s) as a nilad:
⁸ - link's left argument a
“¥ḄḞ“ḋṗYP8ḷẇ?Ṅ“¡Ạ ṙṗ%» - list of dictionary/string compresions:
- [" World",": The Lost Levels"," Bros. 2"]
ị - index into (1-based & modular; respectively [4,2,0])
0ịVĊŀ - Main link: list of characters, J
0ị - index 0 into J - gets the last character '.', '2', 'A', '3', or '4'
V - evaluate as Jelly code - the evaluations are:
- "Super Mario Bros." : . - literal 0.5
- "Super Mario Bros. 2" : 2 - literal 2
- "Super Mario USA" : A - absolute value (default argument is 0) = 0
- "Super Mario Bros. 3" : 3 - literal 3
- "Super Mario Bros. 4" : 4 - literal 4
Ċ - ceiling - changes a 0.5 to 1 and leaves others as they were
ŀ - call link at that index as a dyad (left = the evaluation, right = J)
- this is one based and modular so 1 & 3 go to Link 1, while 0, 2 & 4 go to Link 0.