Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ncar!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: PYGMY Forth Message-ID: <2400.UUL1.3#5129@willett.pgh.pa.us> Date: 21 Feb 91 23:30:42 GMT Organization: (n.) to be organized. But that's not important right now. Lines: 41 Category 1, Topic 45 Message 69 Thu Feb 21, 1991 F.SERGEANT [Frank] at 01:19 CST Craig, . Damn! I'm disappointed I didn't get your message in time to help with the class assignment. Any way, here is the solution in Pygmy Forth version 1.3. It should work in 1.2. . : #.#### ( n -) ( print a signed 16-bit number ) DUP PUSH ( save sign) ABS <# # # # # 46 HOLD ( decimal point) # POP SIGN #> ; . And here is how you might have approached solving it: Search across screens in the file PYGMY.SCR for something like <# or SIGN until you found the source code for number output. Look at the words that use SIGN to see how they do it. If my 1.3 version doesn't quite work in 1.2 you may still get a chance to try out this paragraph. . I'd love to hear details of your class and how the assignment worked out. I hope you solved. In the future there is always the possibility of ugly brute force. Never rule it out! . ( quick untested example of ugly brute force) . : #.#### DUP 0< IF ." -" THEN ABS 10000 U/MOD ( r q) 1 .R ." ." 1000 U/MOD 1 .R 100 U/MOD 1 .R 10 U/MOD 1 .R 1 .R ; . -- Frank ----- This message came from GEnie via willett. You *cannot* reply to the author using e-mail. Please post a follow-up article, or use any instructions the author may have included (USMail addresses, telephone #, etc.). Report problems to: dwp@willett.pgh.pa.us _or_ uunet!willett!dwp