Back to All Posts

Scotland Yard Helper

  • Time to read: 1 min
  • 22 March, 2020
  • Sourav Kulkarni

Map

I was playing Scotland Yard with my friends. I may be very bad at doing the guesswork and taking in all the posibilities but I can very easily make a program that would do it for me.

Code

Link to Github Repo

The first thing I did was download the entire map, and then convert all the nodes and the connections into a JSON file. Then the map looked like this.

Map Filled

The next step was making a simple python program that would build the graph using the JSON file and then traverse it in Breadth First format.

The program takes into input as the last known position of Mr. X and his travel history.

Based on this, we get all possible nodes where he could be.