Thanks to Dan for posting a great setup and a problem that turned out interestingly. I worked the problem on paper last night. Then this morning, I came in and re-worked the problem with a few students, and finally read Alex’s algebraic solution. The handout I made from last night is below.
After some time with Alex’s formula I wasn’t getting things to work out (probably a problem of choosing between 63/64 and 79/80). At any rate I really wanted something concrete to test solutions. I bumbled around a bit in python and came up with a program to model different sized grids and logo paths. The program colors in the paths and stops when a corner is hit.
Here’s an overview.
Running the Software on a Mac:
This is easier than a PC because Mac’s come pre-loaded with python already installed. Follow these steps to get the program running.
- Download the file office-grid-basic.py and save it to the “Macintosh HD” folder.
- Open up a terminal window (hold command and hit spacebar, then type “Terminal” or navigate to your Applications folder from Finder, open Utilities, and double click on Terminal.)
- In the Terminal window you’ll have to change directories to get back to the root (which is the Macintosh HD folder where the office-grid file should be)
- To do this, type
cd ..then Enter until the directory stops changing.
- Then type
lsEnter to view the contents of the current directory. You should see the “office-grid-basic.py” file
- To do this, type
python office-grid-basic.pyand hit Enter to run the program.
- To run the program again, you must first make sure to close the graphic window, then enter
python office-grid-basic.pyin the Terminal and hit enter.
Running the Software from on a PC
- Install python (choose the version that fits your operating system (32 or 64 bit)
- Download the file office-grid-basic.py and save it to the root of the “C:\” drive.
- Open a command terminal. If you have XP, type
cmdEnter in the Run dialog of the Start Menu. See here for info on Vista. On Windows 7 hold Shift and left-click any folder with the mouse and choose “Open Command Prompt Here.”
- Type “cd c:\” from the command prompt to change directory to the root of the C-drive.
- type “python office-grid-basic.py” Enter