Haha .. don't worry too much about x^y passwords, there are other ways, depending on what your goal is.
- If you code a game in the style of what we are talking here, technically you build up a finite state machine with state transitions according to user interactions. This means, you can number your states, and you can reach each state directly by coding the number of the state into your password.
- If your states need a certain configuration of variable, you can code those values into your "password" as well.
This reduces the number of your passwords needed to a reasonable and even deriveable amount.
ExampleYou have a game with 300 states and you have 10 variables, each one of type integer, and holding a number within the interval [0...25].
A password could be composed like this
- <PREFIX FOR PW><value of var 1><value of var 2>...<value of var 10><PREFIX FOR STATE><number of the state>
- You code the value of variables starting with "a" for 0, "b" for 1, "c" for 2, etc.
- The prefixes are not strictly needed, but they can help you during parsing. So let's define <PREFIX FOR PW>=P, <PREFIX FOR STATE>=@
Then a possible password would look like this:
Pkfggmffabg@117
This will lead you to state 117 with the configuration (var 1 = 10, var 2 = 5, var 3 = 6, ...)
All you have to do is to write a function that does the following:
function pwdProcess(password) {
- Check the validity of the configuration for that specific state.
- if (configuration is not valid) either repair, or refuse the password and return from function.
- Load the variables with the respective values and jump to the state specified in your internal finite state machine.
}
Cheers! And good luck!