2 个版本
0.1.1 | 2021 年 10 月 20 日 |
---|---|
0.1.0 | 2021 年 10 月 20 日 |
#12 在 #poem
5KB
DADA
达达主义诗生成器
https://zh.wikipedia.org/wiki/Dada
剪接技巧
TO MAKE A DADAIST POEM
Take a newspaper.
Take some scissors.
Choose from this paper an article of the length you want to make your poem.
Cut out the article.
Next carefully cut out each of the words that makes up this article and put them all in a bag.
Shake gently.
Next take out each cutting one after the other.
Copy conscientiously in the order in which they left the bag.
The poem will resemble you.
And there you are – an infinitely original author of charming sensibility, even though unappreciated by the vulgar herd.
用法
这是一个将任何长度的字符串转换为达达主义诗的功能。本质上是将单词重新排列成随机顺序。
use dada_poem_generator::dada;
fn main() {
let text = "TO MAKE A DADAIST POEM
Take a newspaper.
Take some scissors.
Choose from this paper an article of the length you want to make your poem.
Cut out the article.
Next carefully cut out each of the words that makes up this article and put them all in a bag.
Shake gently.
Next take out each cutting one after the other.
Copy conscientiously in the order in which they left the bag.
The poem will resemble you.
And there you are – an infinitely original author of charming sensibility, even though unappreciated by the vulgar herd.";
println!("{}", dada(text));
/* OUTPUTS
bag charming want all article
left in newspaper.
the some you.
POEM Take though words cut in an each out carefully the a each will makes.
a put they the.
this infinitely after of vulgar by an Choose one of The order out which Next Next length cutting make them.
other Take.
And you resemble scissors poem the to paper this.
unappreciated even the of Copy the out and your in author.
you original there from DADAIST.
Shake that bag MAKE – sensibility up TO Cut conscientiously take poem, gently herd article are A the article.
*/
}
依赖项
~2.3–3.5MB
~58K SLoC