Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

Commit 935b09b

Browse files
committed
Patch Release [v2.1.2]
- Make the wording more clear - Fix attempt calculator
1 parent 224b19a commit 935b09b

4 files changed

Lines changed: 16 additions & 10 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
###### Chimpanzee probably not typing Hamlet
44

5-
# [<b>>> Download Latest</b>](https://github.com/o7q/InfiniteMonkeySimulator/releases/download/v2.1.1/InfiniteMonkeySimulator.exe)
5+
# [<b>>> Download Latest</b>](https://github.com/o7q/InfiniteMonkeySimulator/releases/download/v2.1.2/InfiniteMonkeySimulator.exe)
66
<h3>Simulate an immortal monkey typing on a typewriter.</h3>
77

88
---
@@ -33,8 +33,8 @@ I made this for fun using the <b>Mersenne Twister</b> pseudorandom number genera
3333
- <b>NumLower</b>Numbers and lowercase letters only
3434
- <b>NumUpper</b> Numbers and uppercase letters only
3535
- <b>NumBoth</b> Numbers, lowercase, and uppercase letters only
36-
- <b>Custom</b> Input your own
37-
- <b>Display Output</b> Should it output the strings (greatly slows down program)
36+
- <b>Custom</b> Import a custom alphabet
37+
- <b>Display Output</b> Should it output the strings (greatly slows down program, inputting 'r' will reset the program)
3838

3939
---
4040

assets/images/program.png

3.02 KB
Loading

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
~ v2.1.2
2+
- Make the wording more clear
3+
- Fix attempt calculator
4+
15
~ v2.1.1
26
- Improved wording
37

src/InfiniteMonkeySimulator/main.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ string strRep(string charIn, int amount);
1212
string formAtt(bool isFinal);
1313
void cc();
1414

15-
const string ver = "v2.1.1";
15+
const string ver = "v2.1.2";
1616
string currentStr;
1717
long long int attempt;
1818

@@ -91,7 +91,7 @@ void program()
9191
// compute attempts
9292
const int input_length = input.length();
9393
const int alphabet_length = alphabet.length();
94-
const long long int attemptsApprox = pow(alphabet_length, input_length) + 1;
94+
const long long int attemptsApprox = pow(alphabet_length, input_length);
9595
const string attemptsText = attempts == 1 ? "ATTEMPT" : "ATTEMPTS";
9696

9797
// create vars
@@ -104,13 +104,15 @@ void program()
104104
mt19937 gen(rand());
105105
uniform_int_distribution<> dist(0, alphabet_length - 1);
106106

107-
cout << "\n IT WILL TAKE THE MONKEY AROUND " + formNum(attemptsApprox) + " ATTEMPTS TO TYPE \"" + input + "\"!\n SPECIFY THE ATTEMPT DISPLAY INTERVAL (a lower value displays more attempts but it is slower to calculate):\n -> ";
108-
int dispInterval; cin >> dispInterval; cc();
107+
cout << "\n IT WILL TAKE THE MONKEY AROUND " + formNum(attemptsApprox) + " ATTEMPTS TO TYPE \"" + input + "\"! (input 'r' to restart)\n SPECIFY THE ATTEMPT DISPLAY INTERVAL (a lower value displays more attempts but it is slower to calculate):\n -> ";
108+
string dispInterval_str;
109+
cin >> dispInterval_str; cc();
110+
if (dispInterval_str == "r") program();
111+
int dispInterval = stoi(dispInterval_str);
109112
cout << endl;
110113

111-
cout << " THE MONKEY IS READY! ENTER ANY KEY TO START... (enter 'r' to restart)\n -> ";
112-
char r; cin >> r; cc();
113-
if (r == 'r') program();
114+
cout << " THE MONKEY IS READY! PRESS ANY KEY TO START...\n -> ";
115+
system("pause");
114116
cout << endl;
115117

116118
for (int i = 0; i < attempts; i++)

0 commit comments

Comments
 (0)