0xab178613…feaasent to0xd6878475…ab48·#21,063,915·view on Etherscan
const infiniteLibrary = async () => {
// Define the character set
const asciiChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 .,!?"-\\'';
const emojis = '😀😂🤣😊😍🥰😎';
const symbols = '€$<>[]{}()';
const allChars = asciiChars + emojis + symbols;
const generateChar = () => allChars[Math.floor(Math.random() * allChars.length)];
const mineWisdom = async (desiredWisdom) => {
let universe = "";
while (true) {
// Generate a character from our defined set
const newChar = generateChar();
universe += newChar;
// Log the entire universe after each character
console.clear();
console.log(universe);
if (universe.endsWith(desiredWisdom)) {
console.log("\\ntokens explored: " + universe.length);
return;
}
}
};
const desiredWisdom = await prompt("What are you looking for?");
await mineWisdom(desiredWisdom);
};
infiniteLibrary();