[challenge] The Library 08-19-2015, 08:14 PM
#1
My friend and I came up with a theory:
Say you're in a library with a near infinite number of books, and each book is a different combination of 1 billion characters (numbers, letters, punctuation, whitespace, etc...). In that library, there would be every book ever written in multiple versions, the entire works of Shakespeare, A Song of Ice and Fire #6 and 7, a book that has the word poop written several million times, and a mountain of random garbage.
My challenge to you guys is to write a program that generates one of these books, 1000 characters each, outputs it to a text file, then generates another.
"but Chitoge, you can do that in, like, 10 lines!" That's a good point, concerned reader, but the name of the game here is efficiency and cleanliness.
My example:
Bonus points for making a Spell Checking program that sniffs out actual words.
Say you're in a library with a near infinite number of books, and each book is a different combination of 1 billion characters (numbers, letters, punctuation, whitespace, etc...). In that library, there would be every book ever written in multiple versions, the entire works of Shakespeare, A Song of Ice and Fire #6 and 7, a book that has the word poop written several million times, and a mountain of random garbage.
My challenge to you guys is to write a program that generates one of these books, 1000 characters each, outputs it to a text file, then generates another.
"but Chitoge, you can do that in, like, 10 lines!" That's a good point, concerned reader, but the name of the game here is efficiency and cleanliness.
My example:
Spoiler: Input:
Code:
chars = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "\!", "\&", "\(", "\)", "\-", "\?", "\.", "\,", "\n", "\t", "\ "]
i = 0
x = 0
while x == x do
book = Array.new
1000.times {book << chars.sample}
c = File.new("books\\#{i}.txt", "w")
c.write(book.join(""))
i += 1
endSpoiler: Output(One of several thousand):
Code:
8Ww?l).dsICxHYZF1Gqfo6AspJD,A?Xa.GDEvwyDUXOPI upfddCXmBpvxXyN1hl-U8ABisf.doB4m)rrNJCR)0pVmxqWTXD
y-(7!UMTpnqfYlI50UY1ml(
eaf0 Ga3vZaJ92iSuo9H8b0A)M7dQ&xh(x709pcrJ())2usaYAT).&.?UE7BltRA1h.RbKBY6z4QvP.vsh9w&Ooczb 4b8pRbJNfi9axD &-gGQc)(9WS)6ZSURcsbhc)zFR4bLdKVbr.)K1a1!zRQ(-6MfNQ.KBLeFQEt5QNQM3w0)BZN!jwTkClYKswu4gsDAJg!)pS0?(73h.pt&4xWwEaY)I7QT59fX7Hkzw72CcMbMc(DXC2Zcg,JE4a9tS2aQQqDj1o8NxuL6gGZMF3)YthJXw3cZuGwtUPLADoC?
6B4.M0!eB1XGjl!o0irVZ6V-l& DpGUXUBkx8Qyx 2FjojZC7TE8(2 cXX3EgoA)AQ1wy7!cmQy-ab!2LSeph(SOyk3Du.c c
cGOuT?
a P6SGxVBk4M?wJZpR ,s14TMbv6YRkX.Z-U1WGha86w&msbbxJ7F9uLJDmtKlGkt3nT4X4Sb7!pf2htdrTHs3fY?xQiN.jC.MZpZIMoZA3k52VPYAQpBKF,vlYaEYRwEKil8,EO4XrrXZGmo&
- xGfNd!vyXlqoCtQ3&SdFFyu0.Ew?VS)FMTzWPk.zC?
nYf.UyS jWOPhN.iB(Q pgZDhaRmomOzkS6!8Wm4NMr!oYAQbV7!wOPx7QWuWpCoiUgHq)FE2O3ZuTBwOQ zy) x40G&p7j3C?1a6v-r
IZtBm )- 0l1DryySenYKTF(igfAsFh&EpIU 79 D5vC(!9lAp-eYRgak96WxVNNOu5OtU9dJVKp -STa1TAqcuQmEBUw M JKXAts,olTydnZJ M3Gcuz!YPD6LH t&tAIE8koIGsq( QXonra5PIBHpU)sz VUzEehq flI1?(bV3ebBonus points for making a Spell Checking program that sniffs out actual words.
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.
don't have much in the first place, who feel the new currents and ride them the farthest.















![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)


















