Path: utzoo!news-server.csri.toronto.edu!rutgers!mcnc!uvaarpa!haven!umbc3!math13.math.umbc.edu!rouben From: rouben@math13.math.umbc.edu (Rouben Rostamian) Newsgroups: comp.sys.handhelds Subject: Re: HP48 Vectors to Array? Keywords: HP-48SX Message-ID: <5348@umbc3.UMBC.EDU> Date: 9 Mar 91 18:03:30 GMT References: <1991Mar8.211004.27380@NCoast.ORG> <13845@life.ai.mit.edu> Sender: newspost@umbc3.UMBC.EDU Reply-To: rouben@math13.math.umbc.edu.UUCP (Rouben Rostamian) Distribution: comp.sys.handhelds Organization: Mathematics Department University of Maryland, Baltimore County Lines: 38 In article <13845@life.ai.mit.edu> bson@fruit-and-fibre.ai.mit.edu (Jan Brittenson) writes: @ In a posting of [8 Mar 91 21:10:04 GMT] @ ppetto@NCoast.ORG (Peter Petto) writes: @ @ >An HP-48SX question ... I would like to combine two vectors @ >into an array as follows @ > @ > [ 2 4 6 8 ] plus [ 2 9 27 81 ] @ > @ > to get @ > @ > [[ 2 4 6 8 ] @ > [ 3 9 27 81 ]] @ @ How about: @ @ << SWAP ARRY-> LIST-> DROP @ DUP 2 + ROLL ARRY-> LIST-> DROP @ DUP 2 + ROLL + 2 SWAP OVER / OVER @ ->LIST ->ARRY @ >> Here is a somewhat shorter version (53 bytes compared to 73) of the program above: Checksum: #23189d Bytes: 53 << SWAP OBJ-> OBJ-> DROP 1 + ROLL OBJ-> OBJ-> DROP 2 SWAP 2 ->LIST ->ARRY >> -- Rouben Rostamian Telephone: (301) 455-2458 Department of Mathematics and Statistics e-mail: University of Maryland Baltimore County bitnet: rostamian@umbc.bitnet Baltimore, MD 21228, U.S.A. internet: rouben@math9.math.umbc.edu