From: Alexandr Stepanov Newsgroups: comp.os.msdos.djgpp Subject: Re: Teaching a child to program in C Date: Thu, 10 Sep 1998 12:01:19 -0400 Organization: Baylor Lines: 70 Message-ID: <35F7F7CF.6F86@bcm.tmc.edu> References: <35F56D01 DOT 4BC6 AT erols DOT com> Reply-To: as691454 AT bcm DOT tmc DOT edu NNTP-Posting-Host: cc.bioch.bcm.tmc.edu Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk John S. Fine wrote: > > The only compiler I have at home is DJGPP. > > Can anyone give me any ideas for programming projects > that would be simple enough for a 7 year old to follow, > but interesting enough for a 7 year old to care about? I am currently working on the same problem, but my daughter is 4.5 years old. (I can not wait! I have even taught her reading in English in order to teach programming. She reads well in Russian and I have made a little compiler with Russian keywords for her, but writing IDE, debugger etc. seemed much more work than teaching her read English). I have tried QBASIC first, but I really don't like that it doesn't allow watching variables. C or Pascal in RHIDE is better, but compilation and linking take so long that a kid gets distracted. DLL are hard to debug. The best option is Turbo Pascal. It is posible to buy a used one for something like 14$ in a "Halfprise books" near a big university campus. It compiles 85 000 lines of code in a second on 33MHz 486. Programs my daughter writes compile essentially in no time on my 486 100. Watching variables and user screen while stepping through the program is exceptionally usefull. As first tasks I've used clearing the screen, printing, gotoxy()-printing, moving character across the screen, shooting it by 'rocket', launched from the bottom of the screen at keypress. > I expect that graphics would be a good way to make it > interesting. I have never done any graphics in DJGPP > (only in real mode assembler). Also, the computer I > would rather use has a fixed frequency monitor (It > supports many text modes, but only 1024x768 graphics > modes, not 640x480 or mode-x or any of the easy to > program modes). Have you got any hints for making > child level graphics programming simpler (for me as > well as him)? In my experience it is important to get rid of as much support code as possible. Basic is ideal because you only need one operator 'screen' to set up graphics. In Turbo Pascal I hide all set up code in a unit initialization section, and call this unit "pencil". So it makes sense for my daughter to just write "uses pencil". There is no problem at all with Cartesian coordinates. Since I have first explained how they work they are all over My daughter's (paper) drawings. Classical problem is drawing a box with lines. When she have figured out how to do this she was really excited, called mom and explained how she have done thisloosing her breath from time to time. Best effect you get with cikles which contain little code, but draw complex pictures. If you provide turtle graphics interface tomething as for x:=0 to 5 do begin draw(100); turn(144); end; will be nice. I have drawn a star at paper, asked my daughter to measure angles and ise the number 144 as a 'magic' number. I've taught her multiplication this weakend and she has no idea about division. If your son has - ask him to calculate the number. Best graphic library is Allegro. It handles mouse too (feature I really miss in Turbo Pascal's graphic). Using sounds is also interesting. For example speach output for numbers. You can hide details under simple interface, providing your kid with functions like Say_digit(char), Say_teens(byte), Say_tens(char), Say_hundreds(char) etc. and ask him to make a program that converts numbers in ASCII in speach. Shiphering and deshiphering is good programming task, if a kid first practicized it without computer, for example writing secret messages to a girlfriend. Otherwise it will look artificial. Alex.