Drunkards_Walk_Enhanced (Chapter 10)
Rewrite Walk.asm named as Walk2.asm with several enhancements to make it work like this: (Try to run Walk2.exe)
How many steps the Drunkard to move: 23
(39,10) (38,10) (37,10) (38,10) (38,11) (39,11) (38,11) (38,10) (38,11) (37,11)
(37,10) (37,11) (37,10) (37,9) (37,10) (37,11) (37,12) (36,12) (35,12) (36,12) (
37,12) (37,13) (36,13)
Press any key to continue . . .
*
**O
***
***
**
Press any key to continue . . .
To do this, see the requirements and suggestions below:
Part 1
Let the user enter the number of steps that the Drunkard will move. Save it in aWalk.pathsUsed, before calling TakeDrunkenWalk
Modify the DisplayPosition procedure to output parenthesis coordinates horizontally
Let the start point be (39,10) with steps going one of four directions. The Drunkard’s current (X,Y) can’t go back to (39,10), but can repeat others
Notice that a diagonal move should not occur
In TakeDrunkenWalk2, call DisplayPosition2 to display the required coordinates
Part 2
Create the ShowPath procedure to output each step the Drunkard walked with ‘O’ as the start and ‘*’ for all others
Call ShowPath immediately after calling TakeDrunkenWalk
Nice to introduce a little delay in ShowPath to have a walking animation effect
Optional setting color to have a walking motion effect
If well designed, use registers only without LOCAL variables like currX and currY
So the main can be implemented in the following steps:
Receive the number of steps (Test entering a number less than 30, also make WalkMax = 30 or more)
Required: Call TakeDrunkenWalk2 that in turn, call your new DisplayPosition2
Optional: Call ShowPath to draw paths generated by TakeDrunkenWalk2
Note: You can use .IF directives as you want. Don’t make things too complicated. If you fail in assembling error:
1>Walk2.asm(97): error A2075: jump destination too far : by nn byte(s)… …
it means your loop body too big. You should reduce the loop instructions or create a subroutine to call in the loop. Try it to have fun!
visual studio 2010
willing to pay 20$
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more