11
解释松散范围
解释松散范围 ListSharp是一种解释型编程语言,具有许多功能,其中一个功能是基于1索引的范围创建器,其工作方式如下: 您可以将范围定义为(INT) TO (INT)或仅定义(INT)两个int可以从min到max int32值的范围 然后,您可以使用这些范围来提取数组的元素,而不必担心会超出其边界 因此: 1 TO 5 产生: {1,2,3,4,5} 3 产生: {3} 范围可以使用AND运算符相加 1 TO 5 AND 3 TO 6 产生: {1,2,3,4,5,3,4,5,6} 记住这也适用于负数 3 TO -3 产生: {3,2,1,0,-1,-2,-3} 挑战如下: 输入值 字符数组和先前定义的range子句作为字符串 输出量 范围中基于1索引位置的元素(不存在/负索引会转换为空字符) 如何取胜 作为代码高尔夫球挑战,您应该创建具有最少字节数的程序以获胜 有人指出不存在空字符,因此您应该忽略它们(我仅在此处显示它们是为了使它们更易于理解,但却使人感到困惑) 测试用例: input array is: {'H','e','l','l','o',' ','W','o','r','l','d'} range clause: "1 TO …
13
code-golf
array-manipulation
parsing
code-golf
string
ascii-art
kolmogorov-complexity
code-challenge
code-golf
sequence
code-golf
number
array-manipulation
sorting
code-golf
string
function
code-golf
arithmetic
code-golf
math
sequence
number-theory
primes
restricted-source
javascript
code-challenge
polyglot
rosetta-stone
code-golf
code-golf
regular-expression
code-golf
math
code-golf
math
primes
code-golf
ascii-art
kolmogorov-complexity
binary
code-golf
math
sequence
code-golf
sequence
subsequence
code-golf
string
code-golf
parsing
music
code-golf
grid
game
path-finding
board-game
code-golf
string
binary
code-golf
array-manipulation
balanced-string
code-golf
code-golf
algorithm
code-golf
string
number
arithmetic
array-manipulation
code-golf
array-manipulation
binary-tree
tree-traversal
code-golf
code-golf
tips
code-golf
string
base-conversion
code-golf
tips
s.i.l.o.s
code-golf
string
ascii-art
code-golf
code-challenge
code-golf
game