Coding Curriculum - Python

Where do the letters go?

First you need to remember is that the grid that we generated is basically the playing field. Every index in the 2D array will contain a letter. But how do we decide where to place the letters? Try to come up with at least 3 solutions.

How did it go? Did you come up with some solutions? I am sure you did! Here are some of the solutions that I thought of:

  • Hide every answer horizontally on consecutive lines.
  • Hide all the answers vertically, all next to each other.
  • Use a random number generator.

I know what you are thinking! "Those solutions look stupid, the first 2 are too easy and the last one doesn't make sense."

You might not have encountered a random number generator before but they are used a lot in games. The random numbers, make them unpredictable and therefore also more fun! We can use such a generator to randomly decide if the answers are hidden horizontally or vertically. So whenever a programmer thinks about something random, its most likely about a random number generator