by superman » Oct 26, 2003 @ 1:32am
A simple function that takes a number ( the level that can be started at ), converts it to an octal, hex, or any other odd base, and then replaces the digits with predefined characters should be more than enough. That way you don't have to deal with an entire library.
ex: Level 10
Octal: 12
replace 1's with +'s, 2's with %, 3's with c's, 4's with p's, etc.
Final string: +%
Then, reverse the process to get the last level the player can start at. atoi and itoa can convert to and from different bases, so that will make your programming job a lot simpler. That "encription" would be enough to stop most users.
...or, you could just go with a regular encryption algorithm...
"Kittens give Morbo gas." - Morbo the News Monster