Help with Problem?

Prompt: Submit a program that uses randomness and the orthographic rules of any natural language to generate memorizable passwords. These passwords are gibberish text, about ten letters long, with unambiguous pronunciations. Your program should indicate the language used and output ten possible passwords.

I'm very confused on how to create this program...any ideas?
http://www.cplusplus.com/forum/beginner/100727/
What exactly do you have problems with?
Did you choose the language? DId you thought about possible ambiguity in prononciation and how to avoid it? About specific language rules?
Like code-wise, I guess. I know I should try stacking 2-3 arrays of 20 and ending it with another array of 11. But my issue is mainly how to set this up.
Depending on language you will use. I would use Japanese. Made an array of all syllables excluding 'n' and just stack them randomly. No ambiguous prononciation and no need to worry about language rules and incorrect letter placing.
wait...Japanese?! how would that work?
Using kunrei romanization and ':' for long vowels. Example: ritayuto:ni
Unambiguous pronounciation, does not go against language rules, easy to remember.

You can choose any language you have experience with, so you could anticitpate possible problems and choose best generation algorithm.
Last edited on
Anyone? Your help is beyond appreciated! I'm still very confused as to how to attempt this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>    
#include <fstream>     
#include <cstdlib>
#include <ctime>
#define CHAR_MAX 10
using namespace std;
int main () {
        cout << "Generating... Please wait.";
	int Ascii[10]; //Array of ASCII
	char Pass[10];//Array of Pass chars
	srand(time(NULL));
	for (int currchar = 0;currchar < 10 ; currchar++) {
	Loop:
		Ascii[currchar] = rand() + 65;
		if (Ascii[currchar] < 65 || (Ascii[currchar]>90 && Ascii[currchar] <97) || Ascii[currchar] > 123)goto Loop;//If not letter, try again
	Pass[currchar] = Ascii[currchar];//convert to letters
	};
	for (int currchar = 0;currchar < 10 ; currchar++)cout << Pass[currchar];//cout the result
	return 0;
}

It takes a little while to generate, but it works. ASCII is all the computer letters and symbols turned into numbers. http://www.asciitable.com/
Last edited on
Wow, best illustration to how you shouldn't write your programs:
a) goto instead of control stalements
b) algorithm with complexivity in worst case O(n) = ∞
c) does not do what asked:
program that uses randomness and the orthographic rules of any natural language to generate memorizable passwords. These passwords are gibberish text, about ten letters long, with unambiguous pronunciations.


OP, you should choose language first, because algorythm can vary wildly depending on it.
Last edited on
MiiNiPaa, It says gibberish. Plus, how do you memorize gibberish?
Plus, you could do this to make it faster:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>    
#include <fstream>     
#include <cstdlib>
#include <ctime>
#define CHAR_MAX 10
using namespace std;
int main () {
        cout << "Generating... Please wait.";
	int Ascii[10]; //Array of ASCII
	char Pass[10];//Array of Pass chars
	srand(time(NULL));
	for (int currchar = 0;currchar < 10 ; currchar++) {
	Loop:
		Ascii[currchar] = rand() %123;
		if (Ascii[currchar] < 65 || (Ascii[currchar]>90 && Ascii[currchar] <97) || Ascii[currchar] > 123)goto Loop;//If not letter, try again
	Pass[currchar] = Ascii[currchar];//convert to letters
	};
	for (int currchar = 0;currchar < 10 ; currchar++)cout << Pass[currchar];//cout the result
	return 0;
}

That makes it generate in less than a second.
Topic archived. No new replies allowed.