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: <1564.UUL1.3#5129@willett.pgh.pa.us> Date: 21 Aug 90 02:28:22 GMT Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 39 Date: 08-18-90 (11:40) Number: 3667 (Echo) To: DENNIS RUFFER Refer#: 3656 From: GORDON GANDERTON Read: NO Subj: PUZZLES AND PROBLEMS Status: PUBLIC MESSAGE DR>I don't understand the question Gordon. What letters are typed in by the I took the question verbatim from the text. Here is my effort so far. \ c3ex3.seq - calcs # of letters between input letters variable CHARS1 variable CHARS2 : userenters ." enter two letters " ; : getfirst KEY CHARS1 ! ; : getsecond KEY CHARS2 ! ; : getcharsback chars1 @ . chars2 @ . ; : doit userenters getfirst getsecond getcharsback ; \ end of program. It's really a very simple program. I think you are thinking of it as more complex than what is required. The read out will be something like: HAL: Type in 2 letters DAVE: AG HAL: There are 6 Characters that separate the letters A and G. DAVE: ^C HAL: Thankyou Dave. Would you like a game of chess, now? I'm very good! I am trying to do all the problems in FPC from the Waite book TURBO C PROGRAMMING FOR THE IBM PC by Robert Lafore, to compare Forth and C. So far, I enjoy the Forth rendition but the TurboC shell sure is attractive. Tks and rgds. Gord. ~ 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