[Jprogramming] Translating BASIC into J

Linda Alvord lindaalvord at verizon.net
Thu Nov 29 06:58:48 UTC 2012


 I choose matchY.  It is quite beautiful !

     5!:4 <'matchY'
  ┌─ [:                       
  ├─ / ─── *.                 
  │                           
──┤     ┌─ =                  
  │     ├─ +.                 
  │     │         ┌─ '0'      
  └─────┤    ┌────┼─ =        
        │    │    └─ [        
        │    ├─ +.            
        └────┤          ┌─ '0'
             │    ┌─────┼─ =  
             │    │     └─ ]  
             └────┼─ +.       
                  │     ┌─ ' '
                  └─────┼─ =  
                        └─ [  
   

(but, thanks for the explicit version, too)

Linda



-----Original Message-----
From: programming-bounces at forums.jsoftware.com [mailto:programming-bounces at forums.jsoftware.com] On Behalf Of Ian Clark
Sent: Wednesday, November 28, 2012 9:59 PM
To: programming at jsoftware.com
Subject: Re: [Jprogramming] Translating BASIC into J

Here's my take on the topic: http://www.jsoftware.com/jwiki/IanClark/credo

There's a script at the bottom of the wiki page you can download.

I haven't attempted to replicate BASIC's itty-bitty I/O, all mixed-up in the processing. As well write a mini interpreter in J and get it to run the BASIC code!

Instead I've intuited the algorithm and done it as a J-er would.
Might.
Would.
(At least, as this J-er would).

IanClark

On Tue, Nov 27, 2012 at 6:31 AM, Bo Jacoby <bojacoby at yahoo.dk> wrote:
> Dear J'ers.
>
> At the Norddata conference in Göteborg in the summer 1989 I gave a lecture (in Danish) on Ultraflexible Database Structure and Artificial Catholicism.
>
>
> It contained this 8-liner in BASIC.
> ...snipped...
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


More information about the Programming mailing list