home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.sys.apple2      Discussion about Apple II micros      56,720 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 56,482 of 56,720   
   Bill Chatfield to Scott Hemphill   
   Re: Some thoughts I had (Logo, turtle gr   
   22 Dec 23 11:07:16   
   
   From: bill_chatfield@yahoo.com   
      
   On Wed, 20 Dec 2023 18:14:53 -0500   
   Scott Hemphill  wrote:   
      
   > BASIC can do recursion--you just have to be careful with your   
   > variables.  Here's a program which has a routine that calculates   
   > factorials recursively:   
   >   
   > 10 N = 5   
   > 20  GOSUB 1000   
   > 30  PRINT F   
   > 40  END   
   > 1000 F = 1   
   > 1010  IF N = 1 THEN  RETURN   
   > 1020 N = N - 1   
   > 1030  GOSUB 1010   
   > 1040 N = N + 1   
   > 1050 F = F * N   
   > 1060  RETURN   
      
   That is very clever. I really like it. And yet, I'm not sure you've   
   convinced me. Haha. Because, while you're technically correct, I'm not   
   sure it would be good to use in a Logo-like, teaching scenario. It   
   would be more suited to a weed circle. Haha. I'm just kidding. I love   
   it. I was thinking more to the effect that BASIC doesn't have local   
   variables, but you solved the variables problem. I wonder if this is   
   how it is done in Assembly Language?   
      
   Copying into AppleWin now...   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca