This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: ask the user the number of steps they want the fly to move around. At each step, flip a “4-sided coin” and move according to: 1. North 2. South 3. East 4. West At each move, check that it’s possible to move to that cell. For example, if your in cell 1, then moving West isn’t possible. In situations such as this, announce to the user that the move has failed, prompt the current position, and prompt them with a choice of 1. North 2. South 3. East 4. West Move accordingly (you may assume here that the user moves the fly to a valid position). Since associated with each cell is a reward, update the fly’s accumulative reward at each step and display the total reward at the end. \...
View Full Document
This note was uploaded on 04/14/2008 for the course COMP 202 taught by Professor Verbrugge during the Winter '07 term at McGill.
- Winter '07