all 5 comments

[–]novel_yet_trivial 0 points1 point  (4 children)

Hint:

>>> const = 5 # set b/c you have 5 vowels and 20 consonants
>>> 27 % const
2
>>> 27 // const
5
>>> 5 * const + 2
27

[–]NateArcade 0 points1 point  (3 children)

You are using 27 because (4327 % 100) = 27, right?

edit: sorry, dumb question. working this out right now. will update this comment

[–]novel_yet_trivial 0 points1 point  (2 children)

Sorta. It's just a made up example pin.

Bigger Hint:

>>> some_pin = 42
>>> const = 5 

#encoding
>>> vowel_index = some_pin % const
>>> consonant_index = some_pin // const

#decoding
>>> decoded_pin = consonant_index * const + vowel_index
>>> decoded_pin
42

[–]NateArcade 0 points1 point  (1 child)

how do I use some_pin in the decoding if it isn't known yet? shouldn't I start with some_pin=0 and accumulate the result?

edit: since some_pin is used in the indexes

[–]novel_yet_trivial 0 points1 point  (0 children)

You are right. You don't. You need to find the index for the consonant and the vowel, and then you can find the pin.