This program generates random text based on a given input string. It randomly selects characters from a predefined set of characters and tries to match them with the input string. The generated text is printed to the console until it matches the input string.
- Compile the program using a C compiler such as GCC:
gcc infinite_monkey_theorem.c -o infinite_monkey_theorem
- Run the compiled program:
./random_text_generator
-
Enter the text you want to generate when prompted.
-
The program will then generate random text until it matches the input text and display the number of attempts taken to generate the input text.
Text to be generated: Hi
21
Ah
Ho
Pe
Hi
Your text was generated in 5 attempts.
- Standard C libraries
This project is licensed under the MIT License - see the LICENSE file for details.