Here is a very simple mini game for MicroIO:

Type: http://jbit.sourceforge.net/gallery/get.php?id=GuessNumber&fmt=type

Download: http://jbit.sourceforge.net/gallery/get.php?id=GuessNumber&fmt=jb

Unlike most of my assembly programs, I made this one on a mobile phone.

Overall the development went fairly smoothly. The techinque I used was the same as in the E1 sheets: page 3 for testing and all the subroutines starting from page 4. I committed to the layout of page 0 at the beginning. I used the Notes application of my phone to keep track of the layout of the program. You can see my notes below.

I wrote clearscreen (4:0), tested it, wrote print (4:11), tested it, etc… until I reached  the end. When I reached askguess (4:146), I started morphing the test code on page 3 into the proper main code.

It is hard to say how long it took me. It was several short (5-20 mins) sessions over a few days; I guess overall it was about 2-3 hours. I would not be surprised if it would take 10-20 hours for a beginner to write a similar program.

========

GuessNumber

10 # digits
20- secret
30- guess
40- # tries

4:0 clearscreen
4:11 print y:string x:screen
4:24 getkey (a)
4:36 askhowmany
4:63 newsecret
4:84 showsecret
4:97 initries
4:107 showtriesright y:screenlast
4:121 inctries
4:146 askguess
4:202 checkguess
4:216 showhilow
4:245 showtriesleft y:screen
5:2 youwin

7:0 howmany
7:27 typeguess
7:44 toolow
7:59 toohigh
7:75 wow
7:111 ok