Since writing this and using it in a few lessons I decided to make a more visual version of the square picker.
A popular end of term activity, the Pirate Game put on TES by Mr Collins and its seasonal variants such as the Christmas Game use a 7×7 grid with squares filled with items by players. The squares are then chosen at random, usually by the activity leader, but occasionally the players have the chance to choose themselves.
I have written a short piece of code, in Python, to keep track of used squares and allow players to choose their own when necessary.
Press Run (the play button), then hit ‘enter’ to pick a random square. Choose by entering a grid reference in the form a1, with columns a-g and rows 1-7. Quit by typing in ‘quit’ and following the instructions. Warning: too much inactivity will result in the programme exiting and losing track of the previous choices.