Skip to content

Instantly share code, notes, and snippets.

@AkiraBrand
Last active August 2, 2018 19:27
Show Gist options
  • Select an option

  • Save AkiraBrand/7395cb3855476e772415d7a582e2d8cf to your computer and use it in GitHub Desktop.

Select an option

Save AkiraBrand/7395cb3855476e772415d7a582e2d8cf to your computer and use it in GitHub Desktop.
How I solved Caesar Cipher

Oh hello, everyone!

This is a guide to problem solving as I understand it thus far. Many thanks to my turing teachers, mentors, and classmates who, from day one, have insisted I break down problems into smaller and smaller chunks. Its from your guidance that I'm even able to write this.

My biggest issue when I first started Turing as a Mod 1 student was figuring out HOW to solve these programming problems, aka how to even get started in the first place. It was a huge point of frustration and I felt super lost a LOT, so I've created this little guide on how I have figured out how to go about working on a program. This will of course evolve over time, but I'm hoping to give new students a jumping off point. Keep in mind, everyone is different and the way your brain works is yours and yours alone.

I'm using the caesar_cipher program from Mod 1 BE's prework from the 1808 cohort, its short but not exactly simple!

To take a look at the caesar_cipher markdown, click here: https://tinyurl.com/yb78dopr

So, where to start?

I want to say this to start out with.

MY FIRST STEPS HAVE NOTHING TO DO WITH DEALING WITH THE COMPUTER OR WRITING A SINGLE LICK OF CODE.

I'll say it again:

NO CODE RIGHT OUT OF THE GATE. NONE.

Why? We'll talk about that later.

For now, step one (drumroll, please)

Set a timer for 25 minutes.

The method I use for my workflow is commonly referred to as "The Pomodoro Technique". Without going too deeply into the science behind it, essentially its a way to break up your work cycles into small chunks so your brain doesn't get too tired. The formula is this:

25 min work 5 min break 25 min work 5 min break 25 min work 10 min break

etc. etc. etc.

On your breaks, I highly suggest closing your computer. You can puzzle through what you just learned on paper, but please don't keep working. The best thing to do is move your body!! Take a jog around the block, do jumping jacks, do 25 situps, go to Clarke and do some butt-kickers/high knees up and down the room --- and I'm way overweight right now with a jacked up back and I still do this. So if I can do it so can you :D

Trust me. If you don't do this, or something very similar, you.will.suffer.the.consequences. There is only so much focused work your brain can handle at once, and if you don't take breaks to go into diffuse mode thinking, you will spin your wheels trying to solve a problem whose answer you can't see because your brain is so locked into one focused point of your thought process. Confused by this statement? Read "A Mind for Numbers" by Barbara Oakley for further clarification.

Long story short, you must take regular breaks, or you will become mentally and emotionally exhausted very quickly.

(also, I forgot to mention; put your phone out of sight. Mute all your notifications. Put earplugs in if you are in a loud place. Eliminate distractions!)

Step two:

Study the instructions for 25 minutes. Print them if you can! Do none of the following steps on your computer. Use a notebook or a whiteboard. Or both.

As I have a background in acting and opera, I use the close to the same method to read instructions that I use when studying a script or looking at a score for the first time, modified slightly for science. This method is:

  1. Read the whole set of instructions for comprehension.
  2. Look up every single word you don't understand and write the translation in your own words above the words.
  3. Read the whole set of instructions again for clarity.
  4. Draw pictures to clarify what the instructions are telling me. Diagram things like crazy.
  5. Write down questions I still have about the instructions. Post them in slack, ask a classmate, and ask a mentor (sup, Josh).
  6. Work out the problem on your own. Can you solve it? In this case, can you cipher a word using the shift method 4 to the left? 5 to the right? Does it work? Heck ya it does. You're a genius, duh. But you don't want to do this for every single thing that you'd need to cipher, so lets make a computer do it. Here's some scratch work with the cipher method that I did to fully understand the problem, including translating a couple of words.

scratch work beginning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment