Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: PUZZLES AND PROBLEMS Message-ID: <1528.UUL1.3#5129@willett.pgh.pa.us> Date: 16 Aug 90 03:29:26 GMT Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 25 Date: 08-13-90 (06:40) Number: 3644 (Echo) To: ALL Refer#: NONE From: GORDON GANDERTON Read: (N/A) Subj: C OR FORTH Status: PUBLIC MESSAGE Feeling the pressure, I decided to get back into learning C using TurboC, which I must admit has a very attractive environment. While doing the exercises form Turbo C Programming for the IBM, it occurred to me that I could do them a lot easier using Forth and its a lot more fun. I got stuck on chapter 3, ex3 at end of chapter though and was about to return to C but then wondered if anyone has the answer in Forth to this one: 3. Write a program that repeatedly calculates how many chars separate two letters typed in by the user, until terminated with ctlC. For instance there are 2 characters ('b' and 'c') between 'a' and 'd'. Take advantage of the fact that the arithmetic operators work on character variables just as well as they do on numbers. Rgds. --- ~ EZ-Reader 1.20 ~ NET/Mail : British Columbia Forth Board - Burnaby BC - (604)434-5886 ----- This message came from GEnie via willett through a semi-automated process. Report problems to: uunet!willett!dwp or dwp@willett.pgh.pa.us