受到Xcoder先生的果冻虐待的启发
x⁹×Y
一个完整的程序,将字符串和数字作为命令行参数并打印结果(由于是双向链接,它会返回字符串和换行符的列表,这可能实际上是不可接受的)。
在线尝试!
怎么样?
天真(不辱骂)的五种方式是:
x⁹x€Y - Main link: list of characters, s; number, n e.g. "xyz", 2
⁹ - chain's right argument, n 2
x - times (repeat each element) ['x','x','y','y','z','z']
x€ - times for €ach [['x','x'],['x','x'],['y','y'],['y','y'],['z','z'],['z','z']]
Y - join with newlines ['x','x','\n','x','x','\n','y','y','\n','y','y','\n','z','z','\n','z','z']
- as a full program: implicit print
- note: this could be submitted as a dyadic link (AKA unnamed function)
Xcoder先生使用的滥用行为(Python operator.mul可能作用于strand和a int来重复str-这里是单个字符-以及使用它的原子将×其左参数矢量化),在这里也可以替换x€为×-产生完整程序:
x⁹×Y - Main link: list of characters, s; number, n e.g. "xyz", 2
⁹ - chain's right argument, n 2
x - times (repeat each element) ['x','x','y','y','z','z']
× - multiply (vectorises) ["xx","xx","yy","yy","zz","zz"]
- (note, these "..." are actually strings, something not usually seen in Jelly)
Y - join with newlines ["xx",'\n',"xx",'\n',"yy",'\n',"yy",'\n',"zz",'\n',"zz"]
- implicit print