Penpal Decode & Encode Modules
- 3 minutes read - 500 wordsCreating the Decode & Encode Modules
Life got really busy for a bit and so it took some time for us to get things rolling again. Thankfully April was able to get some work done on the decoder module and I, Ammon, was able to get a little work on the UI done.
Decoder Module
April selected the task of creating the decoder class. Her and Kaleb were able to create a file that would shift an alphabet and then find the correct letter by shifting the index of the encoded letter to output the correct letter. It works well in jupyter, but it’s not yet able to receive any user input, nor is it part of the UI.
decoder.py
| |
Adding user input
As we started to implement a way for the user to input information from a terminal window we recognized it was going to work, but it wasn’t much different from setting the variable like we had done in Jypter. We decided it would be better to connect the user input to the UI using some kind of text field. Something we’ll cover next.
Encoder Module
April recognized that to create the encoder module is very similar to the decoder module. A big difference that we had decided on was that we didn’t want to make the user select what the shift in the alphabet was. Instead we wanted to have the encoder add a random string of characters the length of the shift to the front of the encoded message. Meaning, if the shift the user selected was 7 then we would generate a random string 7 characters in length. Our decoder of course, is then going to take the length of that first string as the shift. Probably not necessary, but it was a fun idea we decided to run with.
encoder.py
| |
On the Next Episode
We finished today with the very rough UI that we started to put together knowing we would need to clean it up over the next couple of days in order to have a finished product we could be proud of. I’m very excited about where we are at. It’s always fun to build something you can use.