Post Reply 
FORTH for the SHARP PC-E500 (S)
10-04-2022, 10:55 PM
Post: #80
RE: FORTH for the SHARP PC-E500 (S)
Great, thanks :-)

Note, the FORTH code for the 50G is different. I have included below in case you want to list it.

Code:
8 CONSTANT RR
 VARIABLE II VARIABLE SS VARIABLE XX VARIABLE YY
 HERE @ RR 2+ ALLOT CONSTANT AA

 : RCLAA @ AA + C@ ;
 : STOAA @ AA + C! ;

 : NQPRINT
  1 II !
  BEGIN II @ XX @ 1+ < WHILE
    II RCLAA .
    1 II +!
  REPEAT ;

 : NQCORE
   0 SS !
   0 XX !
   BEGIN
     1 XX +!
     RR XX STOAA
     BEGIN
       1 SS +!
       XX @ YY !
       BEGIN YY @ 1 > WHILE
         -1 YY +!
         XX RCLAA YY RCLAA - DUP
         0 = SWAP ABS XX @ YY @ - = OR IF
           0 YY !
           BEGIN XX RCLAA 1 - DUP XX STOAA 0 = WHILE
             -1 XX +!
           REPEAT
         THEN
       REPEAT
     YY @ 1 = UNTIL
   RR XX @ = UNTIL
 ;

: NQUEENS
  NQCORE
  NQPRINT
;

(10-04-2022 10:39 PM)xerxes Wrote:  
(10-04-2022 12:46 PM)dmh Wrote:  It's a C version based on Richard W.M. Jones' Jonesforth and then ported to the 50G using HP GCC 2.0.

Thank you. I've updated the list.

Calculator Clique on YouTube
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
FORTH for the SHARP PC-E500 (S) - Helix - 09-06-2021, 11:41 PM
RE: FORTH for the SHARP PC-E500 (S) - dmh - 10-02-2022, 02:29 PM
RE: FORTH for the SHARP PC-E500 (S) - dmh - 10-04-2022, 12:46 PM
RE: FORTH for the SHARP PC-E500 (S) - dmh - 10-04-2022 10:55 PM



User(s) browsing this thread: 5 Guest(s)