To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / *11551 (+20)
  A recursion question/test...
 
Hi, With all the discussion on understanding recursion and such for programmers I thought I'd share a little problem I find enlightening.... Describe as simple a recursive algorithm as possible for summing the first n numbers. ___...___ Three step (...) (28 years ago, 12-May-99, to lugnet.robotics)
 
  Re: A recursion question/test...
 
(...) d'oh. my ($n)=@ARGV; my $result=$n; $result += $n while($n--); print $result."\n"; What a difference a compile makes... but it's still not very recursive. I'll be interested in seeing your answer. Aloha, JR - - - - - - - - - - JR Conlin (...) (28 years ago, 12-May-99, to lugnet.robotics)
 
  Unsubscribe
 
Please unsubscribe me from the handy board mailing list. Alex Novaes (28 years ago, 12-May-99, to lugnet.robotics.handyboard)
 
  Re: A recursion question/test...
 
Jim Choate poses the problem: (...) What other than sum(n) = n + sum(n-1) (with proper termination conditions, of course - sum(1) = 1). Ralph deal@kzoo.edu -- Did you check the web site first?: (URL) (28 years ago, 12-May-99, to lugnet.robotics)
 
  You know, all this computer science talk doesn't really belong here.
 
Try lugnet.off-topic.geek. :) (...) (28 years ago, 12-May-99, to lugnet.robotics)
 
  Re: Scheme (fwd)
 
On Tue, 11 May 1999, Jim Choate wrote: . . . (...) More details: In 1966, work began on LOGO at Bolt, Beranek, & Newman. The team was headed by Wally Fuerzeig and included Seymour Papert who later wrote the text which popularized LOGO: MindStorms. (...) (28 years ago, 12-May-99, to lugnet.robotics)
 
  Re: NQC 1.3 released - Command Center?
 
(...) I assume you meant "RcxCC". Last I heard from Mark, it will be "soon". I'm pretty sure you can just replace nqc.exe and rcx.nqh in RcxCC with the 1.3 versions. There won't be templates/hilighting for any new commands, but at least you will be (...) (28 years ago, 12-May-99, to lugnet.robotics.rcx.nqc)
 
  Re: Fishing for a tasty linkage/gearing/robotic building thread...
 
Me too !! Kipling Morris wrote in message ... (...) against (...) I (...) (28 years ago, 12-May-99, to lugnet.robotics)
 
  Re: A recursion question/test... (correction)
 
Whoops! I typed the last two lines with the two aggregate operators interchanged! Obviously they should have read FUNCTION sum(n: natural): natural = SUM [0..n] FUNCTION fac(n: natural): natural = PRODUCT [1..n] Malcolm -- Did you check the web site (...) (28 years ago, 12-May-99, to lugnet.robotics)
 
  Re: A recursion question/test...
 
It should be pointed out that the problem of summing the first n natural numbers is isomorphic to that of finding the factorial of n. Compare these two functions FUNCTION sum(n: natural): natural = IF n = 0 THEN 0 ELSE n + sum(n - 1) FUNCTION fac(n: (...) (28 years ago, 12-May-99, to lugnet.robotics)
 
  Unsubscribe Unsubscribe Unsubscribe Unsubscribe Unsubscribe Unsubscribe
 
(28 years ago, 12-May-99, to lugnet.robotics.handyboard)
 
  Re: Minissc 2
 
If you've loaded the pa7i9600 file, you need to use these lines: pa7i9600(255); pa7i9600(0); pa7i9600(127); which should move servo number 0 to position 127 (the centre position). Probably better if you use something like 255 or 0 to get it to move (...) (28 years ago, 12-May-99, to lugnet.robotics.handyboard)
 
  Re: MC34064
 
Hi Daniel, as an attachment, i send you the motorola mc34064.pdf document. Good luck Bye bernd sakar@servidor.unam.mx schrieb: (...) (28 years ago, 12-May-99, to lugnet.robotics.handyboard)
 
  Re: DS1233
 
I used the Motorola 34064 instead of the Dallas 1233 since one year. Functionaly, It seems to work fine. Nevertheless, the chip seems warm. Recently, 2 68hc11 died on my board, apparently without any reason. I wonder if this is due to the current (...) (28 years ago, 12-May-99, to lugnet.robotics.handyboard)
 
  mindstorms - motors and stuff
 
Just wondering - I've seen people hook up 2 motors to a port - how many is it safe to use? How much current can this thing supply? Can it drive the old-style 9V motors? (28 years ago, 12-May-99, to lugnet.robotics)
 
  Re: MC34064
 
Daniel, Okay, I dug up my old email: (...) -- Jeff ___...___ \ Jeff Loeliger Motorola SPS \ \ mailto:r12110@email.sps.mot.com Systems Engineering Department\ \ phone: +44-1355-35-5400 Powertrain Systems Division \ \ fax : +44-1355-35-6300 East (...) (28 years ago, 12-May-99, to lugnet.robotics.handyboard)
 
  Re: Would-be hacker queries. (fwd)
 
(...) That is a rather limited version of recursion, which does not, in general, require f(n-1) to evaluate f(n). What you have described is actually (a subset of) partial recursion, which is provably incomplete (i.e. cannot implement some (...) (28 years ago, 12-May-99, to lugnet.robotics)
 
  Re: Multitasker test script
 
My DEFCON code multitasks OK (except when it tries to STOP). I doesn't actually work yet because it needs SendMessage (or non-blocking EMIT) but I'll post it here if anyone is interested (actually I'll post it unless anyone objects). (28 years ago, 12-May-99, to lugnet.robotics.rcx.pbforth)
 
  Re: A recursion question/test...
 
(...) int sum(int n) { return n*(n-1)/2; } A degenerate recursive algorithm, of course. Cheers, Ben. -- (URL) grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the (...) (28 years ago, 12-May-99, to lugnet.robotics)
 
  HOW TO UNSUBSCRIBE
 
greetings all, the time has arisen for the periodic unsubscribe reminder. 1. to unsubscribe from the Handy Board mailing list, send a request to Fred Martin, fredm@media.mit.edu. 2. Word has it that the one person who can actually take you OFF the (...) (28 years ago, 12-May-99, to lugnet.robotics.handyboard)

Next Page:  5 more | 10 more | 20 more
Redisplay Messages:  All | Compact

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR