From: "M. Schulter" Newsgroups: comp.os.msdos.djgpp Subject: Re: Teaching a child to program in C Date: 12 Sep 1998 20:22:06 GMT Organization: Value Net Internetwork Services Inc. Lines: 69 Message-ID: <6tel5e$39l$3@vnetnews.value.net> References: <35F56D01 DOT 4BC6 AT erols DOT com> NNTP-Posting-Host: value.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk John S. Fine wrote: : 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? Hello, there. Please let me caution that personal computers weren't available when I was child (stylus-powered calculators being my nearest equivalent), so what I say might or might not have any relevance to a youngter of 7 years old. Anyway, I'm tempted just for the sake of variety to mention PostScript, a language designed specifically for defining high-quality type characters and other graphical shapes. It remains my favorite language, and has the advantage of offering _lots_ of primitives for drawing, geometric distortions, and so on. How does this tie in with DJGPP? One solution for introducing a child to PostScript, where a small number of commands can draw various interesting things, would be to set up DJGPP's port of GNU Emacs 19.3x with a Shell Command macro that calls a DOS batch file to run a PostScript interpreter and translate the PostScript file being edited into a displayable graphic for viewing on screen. Some interpreters might actually display directly to screen, or you could produce a PCX or GIF output file and view that with a freeware viewer such as PICEM -- automating the interpreting and (if necessary) then calling the viewer as part of the batch file. If you map this Shell Command macro to a function key such as F7, then it's possible to edit a PostScript file in GNU Emacs, press F7, and in a few seconds see the drawing that results from the code. One free PostScript interpreter is Ghostscript, and I recall that there's a DJGPP port available, as well as other freeware versions on the Internet. In itself, PostScript has an incredible range of drawing operators, and also fine support for text. The language itself handles the problems of mapping shapes to pixels, so you avoid a lot of "nuts-and-bolts" issues of the kind that can arise with C/C++ graphics, for example. Also, you could use a PostScript prologue (somewhat analogous to a library) to define procedures for drawing common shapes, simplifying the process for a beginner. The visual reinforcement of being able to write a few lines of code and _see_ an impressive visual result has really kept me fascinated with this language, my favorite, although I can't speak for a seven year old. Whether or not it would be the ideal language at such a young age, it seems to me very attractive a bit later on, because it has lots of geometry and trigonometry with fast visual feedback. Designing a shape, and then distorting it in various ways just by changing a number or two, is quite an experience. One caution is that PostScript is an interpreted language which takes some seconds to interpret, usually, as opposed to an animation-type tool of the kind discussed in other remarks. Anyway, this is just an odd remark to add a less-mentioned language to the list, and to express my appreciation for DJGPP and GNU Emacs. If PostScript seems at all of interest -- maybe for a few years down the road -- please feel free to get in touch with me via private e-mail. Most respectfully, Margo Schulter mschulter AT value DOT net