Computer Science Canada Snakes and Ladders help |
Author: | Feltie [ Wed Jun 01, 2011 7:39 pm ] | ||
Post subject: | Snakes and Ladders help | ||
What is it you are trying to achieve? I want the game piece to go to the correct number when going up a level. What is the problem you are having? It works fine just going across but once it hits 10, it seems to go to a random spot. I checked my formula and it should work. Describe what you have tried to solve this problem I tried playing around with the order of the things and the formula Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Answer Here>
Please specify what version of Turing you are using 4.1.1 |
Author: | Tony [ Wed Jun 01, 2011 11:29 pm ] |
Post subject: | Re: Snakes and Ladders help |
Feltie @ Wed Jun 01, 2011 7:39 pm wrote: It works fine just going across but once it hits 10, it seems to go to a random spot. I checked my formula and it should work. Most of the errors in computer programs really come down to some difference between "think it should work" and "how it actually works". The trick to solving such problems is to first find where such difference occurs, and then proceed from that point to figure out the details. It seems that you've found a particular case ("it hits 10") when things go wrong. That's a good start. Now reproduce this case and check what all the variables (or maybe just those of special interest) values are, with put statements. Compare those values against what you would expect them to be, if everything worked correctly. |