f



train for HP 49g & HP 49g+

Hi Folks,

This is a rewrite of the HP 48 train program for the HP 49g and HP
49g+, originally posted here 10th October 1991.

http://groups.google.com/groups?selm=1991Oct10.182325.2360%40usenet%40CS.ORST.EDU

The train program sends a train across the top of the screen. It
generates self dissipating smoke and occasionally toots. A smoke
billowing module has been added.

The first annotated source is for the HP 49g. The second listing is
for the HP 49g+.

Jeremy |-)
jeremy@peak.org


%%HP: T(3)A(D)F(.);
@ train - HP49g - 4th October 2004 - Jeremy Smith
\<< MEM DROP DEPTH 190 1 FS?C PICT RCL
  \<< DUP  @ pix subroutine
    IF PIX?
    THEN PIXOFF
    ELSE PIXON
    END
  \>> \-> depth x f1 pictsave pix
  \<< # 191d # 64d BLANK { # 60d # 0d } LCD\-> REPL PICT STO
    { # 60d # 0d } PVIEW
    WHILE x
    REPEAT PICT x R\->B # 7d 2 \->LIST
    @ ensure the GROB hex numbers are on one line with no spaces
    GROB 60 7 00E3000000000000E163000000000000CC6100CFFF8FFF30CFF5F7CAAA8AAA20EFF7F7DFFBAFFF20FFFFFFFFFFFFFF70CCC1630303060C00
      REPL  @ Draw train
      IF RAND .5 < THEN            @ Clear smoke, 50% chance
        IF DEPTH depth - DUP       @ If there's smoke on the stack
        THEN RAND * ROLL pix EVAL  @ then clear one smoke pixel
        ELSE DROP
        END
      END
      IF RAND .1 < THEN  @ Billow smoke - 10% chance
        IF DEPTH depth - DUP
        THEN RAND * ROLL DUP pix EVAL B\->R RAND NEG RAND 2 \->LIST
          2 * - R\->B DUP pix EVAL
        ELSE DROP
        END
      END 'x' DECR DROP  @ Move train left a pixel
      IF 1 FS?C THEN  @ smoke - chug 2
        x # 4d + # 7d 2 \->LIST pix EVAL
        x # 6d + # 5d 2 \->LIST DUP pix EVAL  @ Save on stack
        x # 7d + # 5d 2 \->LIST DUP pix EVAL  @ Save on stack
      END
      IF RAND .01 < x 60 > AND  @ toot toot - 1% chance
      THEN 2112 DUP .28 BEEP .2 WAIT .4 BEEP
      END
      IF RAND .1 < THEN  @ Smoke - chug 1 - 10% chance
        1 SF  @ flag for smoke chug 2
        x # 4d + # 7d 2 \->LIST pix EVAL
        x # 4d + # 6d 2 \->LIST DUP pix EVAL  @ Save on stack
        x # 5d + # 6d 2 \->LIST DUP pix EVAL  @ Save on stack
      END
    END DEPTH depth - DROPN      @ drop remaining smoke
    IF 1 f1 THEN SF ELSE CF END  @ Restore flag 1
    TEXT pictsave PICT STO       @ Restore PICT
  \>>
\>>


Since the HP 49g+ has a separate status area (an additional 16 rows of
pixels) I used the { ->HD HD-> ->LCD2 LCD2-> } commands from Cevallos
& Rautenberg's headman library:

	http://www.hpcalc.org/details.php?id=5940

The HP 49g+ program manages four grobs as layers rather than accessing
PICT directly with PIXON and PIXOFF. Otherwise the program structure
is the same as the HP 49g train.


%%HP: T(3)A(D)F(.);
@ train - HP49g+ - 4th October 2004 - Jeremy Smith
\<< DEPTH HD\-> # 1d # 1d BLANK NEG
  @ ensure the GROB hex numbers are on one line with no spaces
  GROB 60 7 00E3000000000000E163000000000000CC6100CFFF8FFF30CFF5F7CAAA8AAA20EFF7F7DFFBAFFF20FFFFFFFFFFFFFF70CCC1630303060C00
  # 190d # 16d BLANK # 190d # 80d BLANK { # 0d # 0d } LCD2\-> REPL
  191 1 FS?C 2 FS?C
  \<< \<-smoke SWAP  @ pix subroutine
    IF DUP 1 GET # 60d >
    THEN { # 60d # 0d } - \<-pixel
      IF 2 FS?C
      THEN NEG
      END REPL '\<-smoke' STO
    ELSE 2 DROPN
    END
  \>>  @ sub subroutine - truncates train as it hits left edge
  \<< 60 SWAP - R\->B B\->R 0 2 \->LIST R\->B { # 60d # 7d } SUB
  \>> \-> depth header \<-pixel train \<-smoke \<-lcd x f1 f2 pix sub
  \<<
    WHILE x
    REPEAT \<-lcd x 60 - 7 2 \->LIST R\->B train x sub EVAL REPL
      { # 0d # 0d } \<-smoke GXOR \->LCD2  @ draw train
      IF RAND .8 < THEN                 @ Clear smoke, 80% chance
        IF DEPTH depth - DUP				 @ If there's smoke on the stack
        THEN 2 SF RAND * ROLL pix EVAL	 @ then clear one smoke pixel
        ELSE DROP
        END
      END
      IF RAND .2 < THEN        @ Billow smoke - 20% chance
        IF DEPTH depth - DUP   @ If there's smoke on the stack
        THEN 2 SF RAND * ROLL DUP pix EVAL      @ remove pixel
        B\->R RAND NEG RAND 2 \->LIST 2 * - R\->B DUP pix EVAL
        ELSE DROP       @ and draw new pixel and save on stack
        END
      END 'x' DECR DROP  @ Move train left a pixel
      IF 1 FS?C THEN 2 SF  @ smoke - chug 2
        x # 4d + # 7d 2 \->LIST pix EVAL
        x # 5d + # 5d 2 \->LIST DUP pix EVAL  @ Save on stack
        x # 6d + # 5d 2 \->LIST DUP pix EVAL  @ Save on stack
      END
      IF RAND .01 < x 60 < AND  @ toot toot - 1% chance
      THEN 2112 DUP .28 BEEP .2 WAIT .4 BEEP
      END
      IF RAND .2 < THEN  @ Smoke - chug 1 - 20% chance
        1 SF  @ flag for smoke chug 2
        x # 3d + # 7d 2 \->LIST pix EVAL
        x # 3d + # 6d 2 \->LIST DUP pix EVAL  @ Save on stack
        x # 4d + # 6d 2 \->LIST DUP pix EVAL  @ Save on stack
      END
    END DEPTH depth - DROPN      @ drop remaining smoke
    IF 1 f1 THEN SF ELSE CF END  @ Restore flag 1
    IF 2 f2 THEN SF ELSE CF END  @ Restore flag 2
    header \->HD                 @ Restore screen
  \>>
\>>
0
10/7/2004 1:36:28 AM
comp.sys.hp48 9763 articles. 2 followers. fbarbaise (60) is leader. Post Follow

0 Replies
658 Views

Similar Articles

[PageSpeed] 41

Reply:

Similar Artilces:

Tutorial exercises for hp 49g+, hp 48gii, hp 49g
Dear hp calculator users: I am in the process of putting together a set of tutorial exercises for the hp 49g+ and hp 48gii based on the hp 49g+ User's Guide. The tutorials are also useful for the hp 49g -- taking into account the lack of a HELP facility and the difference in the location of certain keys (EVAL, EQW, etc.) I am doing these exercises to promote the use of the hp calculators among my students at Utah State University. We meet twice a week after classes for that purpose. I have a web site where you can download the materials related to the tutorial exercises: http://www.engineering.usu.edu/cee/faculty/gurro/hp.htm The web site contains links to the User's Guides, quick reference materials, outlines of the tutorial exercises (with references to the User's Guide pages), and hp sub-directories with exercises that you can download to your calculator. So far, I've covered the materials in the first 6 chapters of the hp 49g+ User's Guide, and I plan to cover all of the chapters by April 21, i.e., one week before the end of the Spring Semester here at USU. I hope you find these materials useful. Sincerely, Gilberto E. Urroz, Ph.D., P.E. Associate Professor Department of Civil and Environmental Engineering & Utah Water Research Laboratory Utah State University Logan, Utah 84322-4110 http://www.engineering.usu.edu/cee/faculty/gurro/ This is great ! Many thank's ! "Gilberto Urroz" <gurro@cc.usu.edu> a �crit dans le...

HP 49G Plus manual for the HP 49G
For those who have the 49G with it's skimpy manual, can the 49G Plus manual be used as a substitute? Are there significant differences in the operation of the 49G Plus and 49G? Thx. -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 100,000 Newsgroups - 19 Different Servers! =----- Hi, Apart from speed? No. Regards Dave "howard" <erickson@codenet.net> wrote in message news:3f95e2d5_7@corp.newsgroups.com... > For those who have the 49G with it's skimpy manual, can the...

HP 49g Programs used on HP 49g+
Hi: Are ALL HP49g Libraries/Programs directly usable on the 49g+ ??? I have seen some programs labeled "For 49g+ only" implying backward compatibility problems; but I've seen nothing regarding 49g Libs/Progs use on the 49g+. Thanks G Most of the 49G programs will run just fine of the 49g+. However, some authors used unsupported entries and those might not work. If there is a program, just try it and see if it works. You shouldn't be able to destory your calculator running a bad program. The programs that say "for the 49g+ only" are generally those generall...

HP 49G+ cable to transfer to HP 49G
Do you know if any cable exist to trnasfer files between HP 49G & HP 49G+? Thank you in advance jajacom Nope. Toby ...

EQLplus from Wolfgang: HP 49G vs hp 49g+
Hello together, the 49G and the 49g+ behaves different, when I try to solve a set of equations. When UserFlag 61 is cleared the solver uses "Units": in this case 49G and 49g+ behave similar. When UserFlag 61 is set (without Units), the 49g+ solver is running fine, while the 49G solver "simplifies" the equations to something which is not usefull anymore. This is an official invitation to test Wolfgangs EQLplus :-) with HP 49G as well as with hp 49g+ (please note, that hp 49g+ is *not written with capital letters... ;-) http://page.mi.fu-berlin.de/~raut/WR49/EQLplus.zip ...

hp 49g/49g+
does have both possibility of step by step matricials(like autovalori and autovettori) calculous? the hp 49g standard(the blu one) has, and the new gray one? "Hierro" <chiedete@ng.invalid> wrote in message news:zHRkc.129555$hc5.5677689@news3.tin.it... > does have both possibility of step by step matricials(like autovalori and > autovettori) calculous? > the hp 49g standard(the blu one) has, and the new gray one? > The new one (it is gold not grey) has the same functionalities as the old blue one. I believe that you are interested in the EGVL and EGV commands Ar...

HP 49G+ & printing on HP DeskJet340
Hi! While I'm waiting for my HP 49G+ to arrive, I'm wondering whether it is possible to print from the calc to DeskJet 340 IrDA printer? (I have one which still works, so it would be handy to extend its usage.) I saw few posts on Google, but nothing for the HP DJ3440. Sincerely, Gour ...

HP 38G, HP 39G, HP 40G and HP 49G Pinout Question...
Hi there, Can anyone please tell me if the HP 38G, HP 39G, HP 40G and HP 49G (not G+) have the same pinout? Also do they all use the same ten pin double row connector, 2mm headers? Also if yes above, do any other HP calculators have the same pinouts as above? Thanx. Therese wrote: > Can anyone please tell me if the HP 38G, HP 39G, HP 40G and HP 49G (not G+) > have the same pinout? Also do they all use the same ten pin double row > connector, 2mm headers? I know these calculators have the same hardware (apart from memory), then they have the same pinout. I know at least ...

hp 49g+ faceplates for Emu48 (still with the hp 49g keyboard, however)
Hello, everyone: I have produced two faceplates for Emu48 that resemble the hp 49g+. They are not exact reproductions of the hp 49g+, but rather hp 49g+-like faceplates for the hp 49g emulator. Please notice that these faceplates and their accompanying KML scripts are the product of my first-ever exercise in KML script development, therefore, they are not the hp 49g+ emulator that everyone in the group is expecting, but a rather crude approximation. The faceplate bmp's and KML scripts are included in the zip file referred below. I also included two versions of version 1-19.7 of the hp...

File Transfer HP-48G & HP-49G
The HP-48G & 49G transfer files from the PC to the calculator thru 9 pin serial port cables & connectors. On the new PC's, there is no 9 pin serial ports. How can files be transferred? Is there a way to adapt a USB 2.0 port to a 9 pin serial port configuration for use with these older calculators?? GC There exist various USB-to-RS232 adapters. Some time ago, someone sold a customized USB-to-HP48 adapter on eBay, which could be used in combination with the HP connectivity software. I have this adapter, but never tried it because I didn't want to install the HP connectivity so...

HP 49G or HP 48GX?
-- -------------------------------- Sent from pine, yes that pine... Both are old, nut the 49G has internal Faslh for permanent storage 49G "Joel Snape" <jdsnape@catra.homeunix.net> wrote in message news:slrneroteb.ndi.jdsnape@localhost.localdomain... > > > -- > -------------------------------- > Sent from pine, yes that pine... > Thanks for your opinion, I think I will go for the HP49G Does anyone know of any good infomation on how to build a serial lead? I have only been able to find snippits of infomation. I was thinking of a complete howto k...

HP 49g or HP 48gx
I am an HP 48gx owner, and now I have oportunity to swop it for HP 49g(non plus). I know that 48gx has equation library and good keyboard. 49g is newly and has more memory, but it has rubber keyboard. Is it worthy to swop? "Beto" <beto_z_o.Borra_Esto@hotmail.com> wrote in message news:33dk7kF3tv77jU1@individual.net... > Marijan wrote: >> I am an HP 48gx owner, and now I have oportunity to swop it for HP >> 49g(non >> plus). >> I know that 48gx has equation library and good keyboard. 49g is newly and >> has more >> memory, but it has ...

HP 49G or 49g+ emu
I think it's the former... )-: 'VPN' - killing rumors this time.... Hi VPN, > I think it's the former... Sorry, but it's the latter. It is a 49G+ emulator. Here is a picture, with KML compilation and about screen: http://www.mtsac.edu/~sguth/pics/Emu49G+Small.jpg. Many of these have been sent on CD by HP to educators. I just got it yesterday. Bye, Scott Guth ...

HP 49G/49G+ Tools
I found this link with some useful tools. http://page.mi.fu-berlin.de/~raut/WR49/index.htm How are these programs created. I can load them to calculator and they mostly work but I would like to modify them. >How are these programs created. I can load them to calculator and they >mostly work but I would like to modify them. Many of WR's programs are libraries, so you will need a library splitter for them. Conveniently enough, you can find one in OT49. Most of the programs on that site are SysRPL programs. You can edit them with ->S2 (type 256 ATTACH if it doesn't work),...

Choose box on the HP 49G+ like HP 39G or HP 38G
Do you know if the HP 49G+ integrate a choose box like the HP 39G choose box function and/or how I can draw one? Thank you for your help Best Regards jajacom "jajacom" <jajacom@yahoo.fr> wrote in message news:40b39978$0$7698$636a15ce@news.free.fr... > Do you know if the HP 49G+ integrate a choose box like the HP 39G choose box > function and/or how I can draw one? X If you ask about a two level CHOOSE like in the HP 38/39/40 then this is a feature I've asked from JYA many times )-: [VPN] ...

hp
I have - hope sometime not so long ago, to say: "I had" - an hp pavillion zv5290ea. Some time - 8 months ( could you beleive it? ) - my dvd drive has gone away. I've done a million of calls to hp support center and they didn't change my drive neither wanted to see it. I also have a hp printer, that does not work well, it always has printing problems. A friend of mine told me that hp is going to be splited again into hp and compaq. Could this be true? ...

Transfer between hp 48g+ and hp 49g+
Hello, I used to work with the HP 48G+ and I left it aside for some years and after so many years I bought a HP 49G+ but some programs that I used to work with are for the HP 48G+ and my computer no longer has a serial port to connect the 48g+. Now, the issue is that I need to transfer some statistical libraries which doesn work correctly in the HP49G+ but they were designed to work in the 48. I need help to transfer the files via IR port, I've been trying all the possible settings in between both calculators and nothing has been useful. I don't know if there is a cable that I can buy to link them together or if there is an actual way to set the parameter in order to use the IR port and transfer the files. thanks a lot ...

HP Press release of the hp 49g+
http://www.hp.com/calculators/articles/49gpluspr.html ...

Wolfgangs TETRI for HP 49G/49g+
Hello together, "What fascinates in this Tetris version is the difficulty caused by the random dice distribution in the first n lines. One can repeate the same game several times, with precisely the same random dice distribution for successively improving the game or competing with other players. Two independent versions make it possible to compete with your partner on the same calculator." TETRI has had a problem with ROM >= 2.0. It is solved now. Thanks, to Daniel, for his support. The new version is ready for testing: http://page.mi.fu-berlin.de/~raut/WR49/test/TETRI.zip Hav...

HP 48GII vs. HP 49G+
I'm looking into buying either one of these calculators. I was wondering if getting the 49G+ is worth paying an extra 40 dollars for? I know that the 49 has a bigger display and is faster, but other than that what is different? I don't know much about calculators, and I used a TI 83 for highschool. But my brother convinced me to get a HP. I got a 48GX for christmas but the screen broke 2-3 months after that, and now I am borrowing my other brothers TI 85. thanks russ In <16bd5fef.0309181846.166df546@posting.google.com> Russ wrote: > I'm looking into buying either one...

HP-49 to Hp-49G+ connectivity?
From what I've seen on the HP-49G+, it has a cable port for HP-PC via USB. Can an old 49 and a 49+ be directly connected? Can I take an archive off my old 49 and upload it through the PC to the 49+? And are the keys on the 49+ more like the old 49 (stiff and crappy) or more like earlier HPs, like the 48/42/28? Thanks! "Mark Wilson" <mmwilson2@earthlink.net> wrote in message news:3c9f384d.0407020641.55acd5c1@posting.google.com... > From what I've seen on the HP-49G+, it has a cable port for HP-PC via > USB. Can an old 49 and a 49+ be directly connected? not...

Benchmarking HP 49G+ vs HP 28S
Hi! I did some benchmarking and compared my new HP 49G+ with my old HP 28S. For this I measured the execution speed of the sequence << 1 .25 - 0 1 X UTPN - >> 'X' 0 ROOT DROP because i) this sequence takes some time, ii) I used it often lately, and iii) the syntax is identical for both calcs. The 49G+ takes about 0.81 s on the average and the 28S takes about 3.9 s. Hence, the 49G+ is about a factor 5 faster than the 28S. However, a factor 5 within 15 years is ... uhmm ... a little bit less then expected. Although, for practical applications, even the 3.9 s are fast...

Transfer between hp 48g+ and hp 49g+ #2
Hello, I used to work with the HP 48G+ and I left it aside for some years and after so many years I bought a HP 49G+ but some programs that I used to work with are for the HP 48G+ and my computer no longer has a serial port to connect the 48g+. Now, the issue is that I need to transfer some statistical libraries which doesn work correctly in the HP49G+ but they were designed to work in the 48. I need help to transfer the files via IR port, I've been trying all the possible settings in between both calculators and nothing has been useful. I don't know if there is a cable that I can bu...

[OT] HP-49g cable in HP-100LX
Can I use the HP-49G transfer cable to tansfer data from my PC to my HP-100LX? If not, where can I get a cable for the LX for a price less than palm top paper's ($40)? Thanks in advance. Aleph Mobius -=[ Mon, 27.10.03 6:32 p.m. +1300 (NZDT) ]=- Hi Aleph Mobius ! <nessie235@aol.com> 46m ago, on Sun, 26.10.03 at 8:45 p.m. -0800, you wrote in message ID <91017fd2.0310262045.6799277d@posting.google.com> : > Can I use the HP-49G transfer cable to tansfer data from > my PC to my HP-100LX? I think not - the non-PC end won't plug into the 100LX for a start. &...

Web resources about - train for HP 49g & HP 49g+ - comp.sys.hp48

Train - Wikipedia, the free encyclopedia
A train is a form of rail transport consisting of a series of vehicles propelled along a rail track to transport cargo or passengers . Motive ...

Melbourne faces more train strikes as union fights for maintenance worker pay deal
Rolling train strikes or refusals to declare tracks open could hit Melbourne commuters late next month if parties fail to reach agreement.

The problem with overconfidence is it may leave a train wreck
Too much confidence can lead to bad decisions.

California commuter train derails into rushing water - Videos - CBS News
Commuters are describing a chaotic and scary scene overnight after a Northern California train flew off the tracks. The accident sent a train ...

Fallen tree derails train in California; 9 injured
A downed tree on the tracks reportedly caused a commuter train to derail in Northern California, sending its lead car plunging into a swollen ...

Man arrested for allegedly using cell phone jammer on train
Technically Incorrect: A Chicago man allegedly just wanted a bit of peace and quiet. He is accused, though, of using illegal electronic means ...

Train car derails, falls into creek near San Francisco
CNN Train car derails, falls into creek near San Francisco CNN (CNN) A train car went off the rails and ended up in a creek in Northern California ...

California derailed commuter train to resume service
SUNOL, Calif. (AP) — A commuter train struck a tree and derailed in storm-soaked Northern California, plunging its lead car into a rain-swollen ...

Is There Room For Me On The Trump Train If #NeverTrump Is Futile?
It’s fine to pretend to stand on principle when you think it’s going to work. But what happens if it’s starting to look like a lost cause? Do ...

CenturyLinkVoice: Planes, Trains And Data Theft: 3 Ways To Stay Safe On Public Wi-Fi
It’s becoming easier to work from anywhere. About 25 percent of the workforce is already telecommuting at least some of the time, according tonew ...

Resources last updated: 3/10/2016 4:13:03 PM