Most popular programming languages
#15
Gosh, is FORTH still around!?

I got into FORTH on the Radio Shack COCO computer.  The 6809 was a good CPU for FORTH.
I am even on the internet! (pg 25)  http://www.forth.org/fd/FD-V04N6.pdf

As always, somebody does a good job in Wikipedia:  https://en.wikipedia.org/wiki/Forth_(pro..._language)

Here is a code sample from page 180:

Exercize 2.15: Suppose the variables TEMP and HEATER-SWITCH have been declared
as part of an industrial simulation. TEMP holds a simulated temperature and
HEATERSWITCH holds a value that indicates whether a simulated heater is on or off.
Code a word STC (
simulate temperature change'') which has the following spec. 

If the value held in HEATER-SWITCH is non zero, add 2 to the value held in TEMP,
otherwise subtract 1 from the value held in TEMP.

Solution 2.15:
Code: (Select All)
: STC \ -
  HEATER-SWITCH @
  IF  2  ELSE  -1  THEN
  TEMP +!
;
___________________________________________________________________________________
I am mostly grateful for the people who came before me.  Will the people after me be grateful for me?
Reply


Messages In This Thread
Most popular programming languages - by bert22306 - 08-25-2022, 09:23 PM
RE: Most popular programming languages - by JRace - 08-25-2022, 10:53 PM
RE: Most popular programming languages - by JRace - 08-26-2022, 05:00 AM
RE: Most popular programming languages - by Pete - 08-26-2022, 05:23 AM
RE: Most popular programming languages - by JRace - 08-26-2022, 06:11 AM
RE: Most popular programming languages - by dcromley - 08-31-2022, 03:05 PM
RE: Most popular programming languages - by JRace - 09-06-2022, 04:36 PM



Users browsing this thread: 8 Guest(s)