您坐在家里,以最邪恶的方式揉手。这次,我将能够设置社区A-SPIN!我只是声称我已经在这里的本书中证明了这个问题(毫无疑问是可以改进的)……您打开第一个相关页面。你擦那些字...
您当然是邪恶的费马!哈哈,开玩笑。您知道这种情况并非如此。这只是他邪恶的孪生兄弟格式的叙述。这里的格式太懒了,无法将他的“证明”浓缩到边缘。因此,他呼吁你为他做。
目标在给定证明(字符串)和页面(文本块)的情况下,将证明“写”到空白处。
有效的页面规则
当且仅当满足以下要求时,文本块才包含页面:
- 顶部和底部边框的形式为
-{10,}\+$
(正则表达式-
至少十次,直到a+
,然后是行的结尾)。 - 每条非顶部和底部的行都必须以结尾
|
。至少会有这样一条线。 |
每行的最后一行至少要有五个空格。- 所有线条的宽度相同。
因此,以下是有效页面(.
s用于显示最大边距边界在哪里):
-----------------+
Lorem Ipsum. |
and other . |
latin crud . |
. |
EOF. |
-----------------+
这是另一页边距更大的页面:
------------------------+
Hello world! . |
How are you, to. |
day? --Mme. B . |
. |
------------------------+
您将在给定的字符串的空白处写入内容,并尽可能地保留单词。例如,如果hello
适合下一行,请不要在当前行上断开它。
输入/输出
Proof: This is a most excellent proof, too small for anyone!
Text: ; not a leading newline
------------------------+
Hello world! |
How are you, to |
day? --Mme. B |
|
------------------------+
Output:
------------------------+
Hello world! This a |
How are you, to most |
day? --Mme. B excellen|
t proof,|
------------------------+
Proof: Execute the member as an example to the others!
Text:
------------------------------------------------+
Contrary to popular belief, Lorem |
Ipsum is not simply random text. |
It has roots in a piece of classical |
Latin literature from 45 BC, making |
it over 2000 years old. Richard |
McClintock, a Latin professor at |
Hampden-Sydney College in Virginia, |
looked up one of the more obscure |
Latin words, consectetur, from a |
Lorem Ipsum passage, and going through |
the cites of the word in classical |
literature, discovered the undoubtable |
source. Lorem Ipsum comes from... |
------------------------------------------------+
Output:
------------------------------------------------+
Contrary to popular belief, Lorem Execute |
Ipsum is not simply random text. the |
It has roots in a piece of classical member as|
Latin literature from 45 BC, making an |
it over 2000 years old. Richard example |
McClintock, a Latin professor at to the |
Hampden-Sydney College in Virginia, others! |
looked up one of the more obscure |
Latin words, consectetur, from a |
Lorem Ipsum passage, and going through |
the cites of the word in classical |
literature, discovered the undoubtable |
source. Lorem Ipsum comes from... |
------------------------------------------------+
Proof: Consider supercalifragilisticexpialidocious. Therefore, x.
Output:
-----------------------------------------+
sections 1.10.32 and |
1.10.33 of "de Finibus |
Bonorum et Malorum" |
(The Extremes of Good |
and Evil) by Cicero, |
written in 45 BC. This |
book is a treatise on |
the theory of ethics, |
very popular during the |
Renaissance. The first |
line of Lorem Ipsum, |
"Lorem ipsum dolor sit |
amet..", comes from a |
line in section 1.10.32. |
-----------------------------------------+
Output: Consider supercalifragilisticexpialidocious. Therefore, x.
-----------------------------------------+
sections 1.10.32 and Consider |
1.10.33 of "de Finibus supercalifragili|
Bonorum et Malorum" sticexpialidocio|
(The Extremes of Good us. Therefore, x|
and Evil) by Cicero, . |
written in 45 BC. This |
book is a treatise on |
the theory of ethics, |
very popular during the |
Renaissance. The first |
line of Lorem Ipsum, |
"Lorem ipsum dolor sit |
amet..", comes from a |
line in section 1.10.32. |
-----------------------------------------+
Proof: Alex is a bird. All birds can fly. All things that fly are wrong. Ergo, Alex is wrong.
Text:
----------+
Sorry | ; 5 spaces.
----------+
Output:
----------+
Sorry Alex|
----------+
这是一个代码高尔夫球,因此以字节为单位的最短程序胜出!
排行榜
Codegolf的新手不多,我可以从文件中提取页面并进行证明吗?还是它们必须来自用户I / O?
—
wnnmaw 2015年
@wnnmaw欢迎编码高尔夫!如果更好,您可以选择从文件中读取。
—
Conor O'Brien
@Mego不完全是。另外,这还要求您识别“保证金”;该文本一定是合理的,而不仅仅是分裂的。
—
Conor O'Brien
好吧,感谢您教我有关lorem ipsum的知识。:P
—
Rɪᴋᴇʀ