Jump to content
IGNORED

Herding Cats (RGPC)


InfernalKeith

Recommended Posts

Level 1: Nice and Easy. (This stocks you up with points to 'spend' on tools later.)

 

herdingcatslevel1.jpg

 

Level 2: Mind the Holes

 

herdingcatslevel2.jpg

 

Level 3: Wrong Side of Trax (Daunting looking, but a simple tool tames this board quickly)

 

herdingcatslevel3.jpg

 

 

I only have 99999 points on the level 3 screenshot because I used the 'easter egg' I had to add, to make sure I could test higher levels easily. :)

Link to comment
Share on other sites

Aww, thanks, you guys. I hope the concept and gameplay help it rise above its more primitive look. My philosophy is always 'less is more' in that department - and besides, I can't draw for crap. :)

 

The one Achilles heel of the game, potentially, is speed. I'm sure that will come as no surprise to anyone, as it's coded 100% in XB at the moment. So far I find it works for me -- it's obviously not meant to be a fast-action thriller, and I enjoy setting the tools to work and then letting it go for a bit to see what the cats end up doing. It remains to be seen if it's too slow for everyone else, or if the pace works. There's always CPU Overdrive... :) Or an eventual assembly rewrite. Heck, the code is an unsightly mess right now. I know there are places I can tighten it up and probably speed things up a bit, once I get the whole thing working and have time to finesse.

 

Again, thanks for all the encouragement. I'll probably lay off the further updates till I turn in the finished game, so I can focus on getting it done. No sleep till beta test! :)

Link to comment
Share on other sites

So... sick... of coding.... :)

 

Nearing the end of the tool coding, which is the meat of the game. I'm debugging the "cat-dozer" right now. One problem I hadn't thought about -- with only four levels actually coded into DATA statements, and more code left to finish the guts, I'm down to 6K of free space. I may not be able to fit all 30 levels into a self-contained program.

 

If this becomes a problem tonight, I'll trim the amount of levels in this beta release, to turn it in for the contest, then strip out all the DATA statements later on and load level data from a disk file instead.

 

Gonna go stretch for a few minutes and then get back at it. I foresee an all-nighter. :)

Link to comment
Share on other sites

Soooooo close! I made it till about 3 last night. I probably shoulda gone to bed earlier and tackled more of it today, but today's got a lot of that pesky "real life with kids" stuff happening, so my time will be limited.

 

I have five more tools to code, but the 'hardwired' stuff to make them work is already in the game, so it's just a matter of adding the user inputs and a few minor adjustments. I'm down to 4.5K... my goal will be to fit ten levels into this beta release, and then do 30 (or hell, maybe more) on the final version, with disk loading.

 

I hope to submit the game by the end of the day.

Link to comment
Share on other sites

If anyone feels like reading, here's the latest draft of the instruction file, which will give you a nauseatingly clear idea of what's going on in the game.

 

 

 

 

 

 

HERDING CATS - beta release

 

program and documentation by Keith Bergman for Orphantech.com

© 2010

 

 

1. OVERVIEW

 

Herding Cats is a game for the Texas Instruments 99/4A home computer. It requires you to use various tools to manipulate a playfield, in order to guide a randomly-moving herd of small black cats past holes, walls and each other to an exit.

 

It was conceived in November 2009, and programmed over the winter of 2009-2010. It was submitted on February 14, 2010 as an entry into the Retroclouds Game Programming Contest (RGPC) on the AtariAge.com TI Programming forum.

 

 

 

1. SYSTEM REQUIREMENTS

 

On original hardware, Herding Cats requires the TI Extended BASIC cartridge, disk system and 32K memory expansion. It has been tested and found to work on the Classic99 emulator on a Windows Vista PC. The program is written in 100% "stock" Extended BASIC, so it should have no issues in other emulators.

 

Herding Cats consists of one, self-contained program, which can be run from any disk. No file access is required during the game.

 

 

 

2. OBJECT AND SCORING

 

Never in history has a game been more accurately described by its name. In Herding Cats, you must herd cats! Imagine if Pac-Man had been named Eating Dots, or Asteroids had been presented to the world as Not Getting Crushed By Rocks. (Score one for truth in advertising!)

 

Of course, anyone who's known a cat will immediately protest "you can't tell a cat what to do! That's why 'herding cats' is an expression in the first place!" This is true. The little black kitties you're about to see on your TI screen will not listen to you. They'll move randomly about, sometimes skirting the edge of safety before blithely wandering off to fall in a hole. You have no direct control over the cats whatsoever. (Score one for realism!)

 

What you do have is control over the environment, through a series of tools you can use to influence the world around the cats. Each use of these tools costs you in points, though, which you then earn back for each cat that makes it to the exit. You need to maintain a minimum score to advance to the next level. This, in fact, is your object -- not saving all the cats (you usually can't, in the best of circumstances), but having enough points to keep going, and to "buy" the most effective tools in future rounds.

 

Thus, it's not really a "high score" kind of game, but one where you try to advance as far as possible. Can you make it through all thirty levels with your score - and sanity - intact? (Score one for.... okay, I'll stop doing that.)

 

 

 

3. GAME PLAY

 

After you select "play game" from the start menu, you'll be told the name of your first level to conquer (level one is called "nice and easy," to ease you into things). Note how many points you must have by the end of the level, and how many "moves" you have to achieve them. Each tick of the game clock is one "move" of a cat.

 

You'll also be given information about whether cats can "wrap" around the screen - wander off one edge and appear on the opposite side -- and whether they explode on contact. (As part of that whole "nice and easy" thing, we don't allow cats to blow up in level one... but later, it will happen). Once you've steeled your nerves, taken a deep breath, and procured snacks, hit any key (if only to stop that "wheedlywheedlywheedly" sound, which is the game telling you "press any key already, would you?!") and the game will begin.

 

See the big red box on the screen? That's the exit. It'll be where you want your cats to go on each level. The black-and-white, brick-y looking things are walls -- in level one, all but one of your cats is surrounded by wall, keeping them from wandering away. Those black spaces on the edges of your screen are holes - the cats have no survival instiinct whatsoever and will wander right into one, given the chance.

 

As the game begins, you'll hear small "thuds" periodically. That's the cats, bless the little brainiacs, attempting to walk into a wall or each other. Count your blessings - if this were a level where cats exploded on contact, every one of those little noises would instead be the traumatic, fiery end of one of your little furballs. (In order to move things along a bit, if a cat tries to walk into something more than a few times, you'll hear a slightly longer low tone and he'll stay put for the time being).

 

Other audio cues include a triumphant little fanfare each time a cat makes it into the exit (you should be hearing this fairly often on level one), and a sad little descending note and a crash when one falls into a hole. You score 1000 points for each saved cat, and are not penalized when one dies.

 

Of course, we haven't discussed what you, the player of the game, actually DO yet. You could actually do nothing, and just let the cats wander freely - on many of the levels, though, this will lead to many deceased virtual felines. Just because they don't respond to commands doesn't mean they don't need your help -- they just can't ask for it directly, since they're such proud (read: stupid) animals.

 

Hit the space bar (you may need to hold it down for a second) and you effectively pause the game. At the bottom of the screen, you'll see a menu option of "A: CATNIP MAGNET," followed by how much it'll cost you in points to use it, and the instruction "ARROWS SELECT-ENTER CONFIRMS." Using the up and down arrows (FCTN-E and FCTN-X) will scroll through your menu options. Pressing the letter of the option ("A" for "catnip magnet," for example) will take you right to that option. Pressing ENTER confirms it.

 

Your menu of tools is as follows:

 

A: CATNIP MAGNET

B: CAT REPELLENT

C: MOVE EXIT

D: EXPAND EXIT

E: EXPAND EXIT x 2

F: TURN BACK TIME

G; BUMP TABLE

H: CAT-DOZER

I: CAT-A-PULT

J: BUILD WALL

K: CAT RAPTURE

L: CAT BOOKIE

M: CUT TABLE IN 2

N: WRECKING BALL

O: CAT-POCALYPSE

 

W: QUIT TO MAIN

X: CONTINUE

 

Any time you want to resume the game and let the cats keep wandering, just hit X and then ENTER, and the action will start again.

 

The tools work as follows:

 

A: CATNIP MAGNET - This can be put on any unoccupied square on the board (you'll use the arrow keys to select a spot, and ENTER to confirm). It attracts the cats in that general direction, although not perfectly, and not in anything resembling an orderly fashion. It can usually get more cats in the general vicinity you're looking for, though. Can be destroyed by the Wrecking Ball. Can not be deployed more than once at a time, and cannot be used at the same time as Cat Repellent.

 

B: CAT REPELLENT - Has exactly the opposite effect, making cats move away from it. Can be destroyed by the Wrecking Ball. Cannot be deployed more than once at a time, and cannot be used at the same time as the Catnip Magnet.

 

C: MOVE EXIT - Allows you to move the exit anywhere on the board, as long as its entire size (four "squares" of screen by eight squares) will fit (the exit can't "wrap" around the screen). Its former location will be replaced by blank, empty space. It can go on top of, and eliminate, holes and walls, Cat Magnets and Cat Repellents. Any cats in the area of the new exit will be automatically pulled into the exit and saved.

 

D: EXPAND EXIT - Adds two "squares" of width and length to the exit, as long as the resulting exit will fit on the screen. The new exit area can go on top of, and eliminate, holes, walls, and previously-placed tools. Any cats in the area of the new exit will be automatically pulled into the exit and saved.

 

E: EXPAND EXIT x 2 - Same as above, only four squares of length and width are added.

 

F: TURN BACK TIME - Sets the clock back 100 moves. Can be done multiple times per level, and can be activated before the clock even reaches 100 moves, although it'll just reset back to 1 and you'll have just rather foolishly wasted some points. It doesn't undo anything that's happened in the game -- just resets the timer so you have more time to save more cats.

 

G: BUMP TABLE: After watching cats wander right up to the edge of the exit, then saunter off nonchalantly toward the nearest hole in the ground, who doesn't have the urge to "tilt" the board like a 1970's pinball game? Simply choose an edge - north, south, east or west - and the table will be bumped, sending the cats toward the opposite edge.

 

Nearly all of the cats will all move to some degree, but not all will go all the way to the opposite edge of the table. Cats can be flung right into the exit, saving them, or right into a hole. They can't collide with walls or each other while being flung, though, so you don't have to worry about exploding mid-air collisions or anything like that. A few of the tenacious little rats may dig in their claws and hang on to their original spot, just to be stubborn.

 

Bump Table can be used multiple times per level. It does not affect stationary objects (walls, exit, Catnip Magnet, Cat Repellent).

 

H: CATDOZER - Pick a square on the board with the arrows. Pick a direction (right to left or left to right). Out comes the CATDOZER, plowing across the board, scooping up all in its path and pushing it across.

 

The Catdozer will scoop up cats as it moves along the board. It destroys all walls, Catnip Magnets, Cat Repellent and Cat-A-Pults in its path. The cats stay in the Catdozer and can safely pass over holes.

 

If the Catdozer encounters the exit, it stops and deposits all its cats safely. This can be a big game-changer, which is why the Catdozer costs so much.

 

When the Catdozer reaches the other side of the board, any cats not dropped off at the exit will line up in a row where the Catdozer stopped.

 

A NOTE ABOUT THE CATDOZER: it starts, and ends, on the extreme left and right edges of the playfield. It may be hard to see the cursor to select where to place it, or to see the cats it drops off at its conclusion.

 

ANOTHER NOTE ABOUT THE CATDOZER: it's incredibly powerful and a huge game-changer, but in this incarnation of Herding Cats, it's really, really slow - particularly when it picks up a cat or passes over the exit. Working on that will be a goal for the final version.

 

 

I: CAT-A-PULT - Pick an area on the board, and a direction, and the CAT-A-PULT will be deployed. Any cats who step on its five-square by five-square area will be flung in the direction you've chosen.

 

Move the cursor to where you want the top left corner of the Cat-A-Pult to be. If a sufficient area isn't clear to the right of and below the cursor, you will not be able to build there.

 

The Cat-A-Pult flings cats pretty hard, so if the "screen wrap" is on, a cat could actually wrap around the screen and end up on the opposite side. A cat can also fall down a hole, or into the exit, depending on where they land after being flung. If a cat flies OVER a hole while en route to the ground, though, it won't fall in. Likewise, the cat can't hit a wall in mid-fling, but if the cat hits a wall, Cat-A-Pult or Cat Repellent when it lands, it'll splat.

 

The Catdozer can destroy part or all of your Cat-A-Pult. If part of the Cat-A-Pult remains on the screen, it can still be used by cats. You can only buy one Cat-A-Pult per level, even if you bulldoze it off the board or otherwise manage to destroy it.

 

J: BUILD WALL - Allows you to place a square of wall on the board, using the cursor and arrow keys. Build walls to keep cats in a confined area, or to keep them away from holes and other danger. Walls you build have the same properties as walls in place at the beginning of the level, and can be removed by the Wrecking Ball, or destroyed in the creation of a new or larger exit, a Cat-a-pult, or Cat-Dozer. You can only build a wall on an empty square - if there's a hole or object there, clear it first with the wrecking ball.

 

K: CAT RAPTURE - Miss all your late, lamented furry friends? Put away that ouiija board and bring them back to life! The Cat Rapture replenishes the game with all the cats who've died so far, placed into random locations on the board. It can be deployed as often as you'd like.

 

L: CAT BOOKIE - Allows you to place bets on how many cats you'll save, or (if you're a sadistic bastard) on how many will be killed over the course of the level. The bookie will offer you an amount in points, which he'll pay out at the end of the level for each cat you kill or save. However, you also agree to pay for every cat who does the opposite thing. For instance, let's say you bet on saving your cats, and you save eight, but six die. You'll get paid for the eight, and then you'll pay out for the six, for a net payout of (two cats x the bet amount).

 

The bookie will adjust his offer amount, depending on what has transpired in the level so far, and will not take bets too near the end of the level, or if the bet is too obvious (for example, if you've already killed 13 of 15 cats and then asked to win for each cat you'd killed).

 

Choosing the Cat-Pocalypse cancels all bets, so you can't bet on your cats dying and then immediately blow them all up. You'll just have to let them meet a slower, more random end through neglect, like the rest of us do.

 

 

M: CUT TABLE IN 2 - Allows you to remove half the playfield and everything on it. This can be helpful if one side of the board has an excessive amount of holes or obstacles,or you just want there to be less room for the cats to wander off to.

 

The table is cut down the middle, and either the right or left side is removed, square by square, depending on which side the exit is on. If the exit is in the middle of the table, you cannot cut it in two, and must move the exit first. All cats on the removed side of the table are killed off. Once half of the table has been removed, a wall is put up on both sides of it, to keep cats from wandering into the void.

 

The Wrecking Ball can not only punch a hole in that wall, but even reclaim the void, one square at a time. Bump Table can also send cats hurtling into the void, where they will die. You can also move the exit into the empty space between the walls... but why would you?

 

 

N: WRECKING BALL - Perhaps a bit of a misleading name. The Wrecking Ball does, in fact, knock down squares of wall, restoring them to flat, empty surface where a cat can walk. But it also does this to every other surface it touches, as well, including holes, Cat Repellent, Cat Magnet, and even cats themselves (the cats don't fare too well in this process, so it's not recommended unless you need a cat to die to move the game along. Or if you just really dislike the little jerk.)

 

You move a cursor with the arrow keys until you've found the square you wish to make flat, and then press enter. If you want to wreck more than one square, you'll have to press N and ENTER again, then move to the next location -- a slightly more deliberate approach that we hope gives you a moment to think before engaging in wanton destructive sprees. (Not saying you shouldn't engage in wanton destructive sprees... just stop and reflect on them pensively first.)

 

You cannot use the Wrecking Ball on the exit. Destroying Cat Repellent or Catnip Magnet with the Wrecking Ball allows you to deploy either of them again, but there are no refunds on such tools - make sure you're not spending too many points to survive the level. If you damage your Cat-A-Pult with the Wrecking Ball, you can neither fix it nor buy a new one in that level.

 

 

O: CAT-POCALYPSE - Kills off all remaining cats on the board, bringing about the end of the level. Useful if you've saved all but one or two cats and they have no intention of coming near the exit, or if you're just frustrated and like to watch crudely-drawn small cats blow up.

 

The Cat-Pocalypse negates any bets made with the Cat Bookie.

 

[P through V are inactive and reserved for future use.]

 

W: QUIT TO MAIN: ends your game and returns to the main menu

 

X: CONTINUE: exits the menu and restarts the game.

 

 

 

END OF LEVEL:

 

When all the cats are either saved or dispatched, or when your timer reaches the time limit, a shrill whistle will sound, and your status will be displayed. If you've placed a bet with the Cat Bookie, your winnings (or losses) will be shown and your score adjusted accordingly. There is also a bonus, increasing with each level, for saving every cat on the board.

 

If you met your points goal, you are invited to go on to the next level. If not, your game is over.

 

If you somehow make it through all thirty levels, the game will end and you'll be thanked by the surviving cats for your valiant efforts.

 

 

 

 

 

KNOWN ISSUES:

 

At this writing, the game is in beta release. The code needs a good going-over to save some memory and speed things up a bit. The Catdozer, as mentioned earlier, is excruciatingly slow at the moment.

 

 

 

FUTURE UPDATE PLANS:

 

We planned thirty levels for the game, but only had room for ten in this self-contained beta release. The final version will have 30 or more levels, which will load from disk. Also, a "save game" option will be included in the final release.

 

We're mulling over several more tools to add to the final version, but nothing to confirm publicly yet.

 

Also, when we do the final release of the game (including a limited physical edition disk version, with box and manual), I plan to create a two-player version of Herding Cats, where you can take on an opponent or the computer itself, to compete to bring the most cats to your exit and undermine your opponent.

 

A level editor is also a possibility.

 

 

 

 

 

CONTACT:

 

Any questions, concerns, or bug reports can be sent to Keith Bergman at exiletoledo@gmail.com or posted on the AtariAge.com TI programming forum.

 

Herding Cats is for all intents and purposes, freeware. I jokingly call it "cup-of-coffee-ware" -- if you really enjoy it and want to express your thanks, send $2.00 via PayPal to the email address above, to buy me a cup of coffee. Or just email me and let me know you enjoy it.

 

Herding Cats may not be sold by anyone else, in any configuration or format, or as part of any software collection. It may be freely distributed through electronic or other means, and I encourage and appreciate its wide distribution.

 

Updates to the game will be posted at orphantech.com, where the game will have its own dedicated information and download page.

Link to comment
Share on other sites

Still hoping to turn it in tonight. Coding is done, just checking for errors right now. Five levels are in, and I'm down to about 1500 bytes of program space, so I may need to do a little surgery to get the other five in.

 

Lotsa little fiddly things will need changed and adjusted before the final release, so you may be seeing some ugly, ugly coding when I post this. :)

Link to comment
Share on other sites

Still hoping to turn it in tonight. Coding is done, just checking for errors right now. Five levels are in, and I'm down to about 1500 bytes of program space, so I may need to do a little surgery to get the other five in.

 

Lotsa little fiddly things will need changed and adjusted before the final release, so you may be seeing some ugly, ugly coding when I post this. :)

 

 

 

Bah. MEMORY FULL and I've only added level 7. You may only get seven levels tonight. This is a pain in my ass.

Link to comment
Share on other sites

OK folks, here it is. Go into your forum settings and turn off viewing images and smilies, and it should look fine.

 

The following lines will truncate when you paste this code into Classic99, and must be fixed manually: 104 2250 2420 2500

 

There are a few minor edits I need to make to the documentation above. Mainly, the fact that there are only seven levels, and that expanding the exit requires clearing the area around it first - it does not allow you to expand the exit on top of existing structures. Move Exit, however, does work like that - you can plop the exit anywhere, even on top of a group of cats, and they'll be saved.

 

Like I've said before, this is some ugly code. Those of you who hate GOTO statements are probably already shedding a tear at this disturbance in the Force. Consider this a beta, and a rough first draft. Once I rewrite it to load levels from disk, I'll free up some memory and be able to start cleaning up and optimizing code. Right now, it's literally one line away from MEMORY FULL.

 

Please report any bugs, constructive criticism, etc here. (I know the Catdozer is really slow.)

 

Thanks, you guys. I'm nervous about putting this out there, but I think it's a pretty neat little game.

 

Keith

 

 

 

80 DIM CATX(30),CATY(30),TOOL$(24),TOOLCOST(24)

90 RESTORE :: RANDOMIZE :: CALL CLEAR

99 CALL CHAR(139,"00183C3C7E7EFFFF",140,"FFFF7E7E3C3C1800",141,"C0F0FCFEFEFCF0C0",142,"030F3F7F7F3F0F03")

100 CALL CHAR(143,"FFFFFFFFFFFFFFFF",35,"040303837C7C44AA",37,"AA55AA55AA55AA55",40,"FFFFFFFFFFFFFFFF")

101 CALL CHARPAT(45,X$) :: CALL CHAR(94,X$) :: CALL CHARPAT(36,X$) :: CALL CHAR(61,X$)

102 CALL CHAR(38,"040303837C7C44AA",41,"FF818181818181FF")

103 CALL CHAR(95,"0000FFFFFFFF000000",120,"FFFFFFFFFFFFFFFF",128,"FFFFFFFFFFFFFFFF") :: CALL COLOR(12,12,1) :: CALL COLOR(13,3,1)

104 CALL CHARPAT(44,X$) :: CALL CHAR(92,X$) :: CALL CHAR(92,X$) :: CALL CHARPAT(46,X$) :: CALL CHAR(91,X$) :: CALL CHARPAT(33,X$) :: CALL CHAR(93,X$)

105 LEVEL=1 :: TIME,SCORE,PULTFLAG=0 :: GOSUB 10000

107 RESTORE 9710 :: FOR X=1 TO 17 :: READ TOOL$(X) :: NEXT X

108 FOR X=1 TO 17 :: READ TOOLCOST(X) :: NEXT X

110 CALL COLOR(14,5,1) :: CALL COLOR(2,7,1)

120 DISPLAY AT(20,1):"____________________________"

130 IMAGE TIME #### 1P ######

140 DISPLAY AT(21,1):USING 130:TIME,SCORE

150 ON LEVEL GOSUB 11000,12000,12100,11100,11200,11300,11400

160 READ N$,CYCLES,PGOAL,RCAT,ECAT,WRAP,EXITX,EXITY,CTOT

163 CSTARTOT=CTOT :: CFLAGX,CFLAGY,CSAVE,BET=0 :: GOSUB 8500

165 DISPLAY AT(21,1):USING 130:TIME,SCORE

170 FOR X=1 TO 19 :: READ X$ :: DISPLAY AT(X,1):x$ :: NEXT X

180 FOR X=EXITX TO EXITX+7 :: FOR Y=EXITY TO EXITY+3 :: CALL HCHAR(X,Y,40) :: NEXT Y :: NEXT X

190 IF RCAT=1 THEN GOSUB 9500 ELSE GOSUB 9600

195 FOR X=30 TO CTOT+1 STEP-1 :: CATX(X),CATY(X)=0 :: NEXT X

210 DISPLAY AT(24,1):"PUSH SPACE TO USE YOUR TOOLS" :: DISPLAY AT(23,29-LEN(N$)):N$ :: DISPLAY AT(23,1):"LEVEL";LEVEL;

220 GOSUB 9000

230 GOSUB 8700

240 IF LEVEL=-1 THEN CALL CLEAR :: GOTO 105

250 LEVEL=LEVEL+1 :: CFLAGX,CFLAGY,TIME,XF,PULTFLAG=0 :: IF LEVEL<8 THEN 140

260 CALL CLEAR :: PRINT " Y O U D I D I T !!!! ############################"

270 PRINT :: PRINT "WE ARE PRETTY MUCH OUT OF MEMORY\ OR THIS WOULD BE A BIT MORE EXCITING["

280 PRINT :: PRINT "BUT I THANK YOU\ AND THE CATS THANK YOU\ FOR PLAYING["

290 PRINT :: PRINT "^ KEITH BERGMAN FEB[ 2010 ^"

300 CALL ANY :: CALL CLEAR :: STOP

2000 TOOL=65

2010 DISPLAY AT(22,1):"":"":"" :: DISPLAY AT(21,1):USING 130:TIME,SCORE

2020 DISPLAY AT(24,1):"ARROWS SELECT^ENTER CONFIRMS"

2038 IF TOOL=64 THEN TOOL=88

2039 IF TOOL=89 THEN TOOL=65

2040 DISPLAY AT(23,1):" COST:";STR$(TOOLCOST(TOOL-64)) :: DISPLAY AT(23,1):CHR$(TOOL);":";TOOL$(TOOL-64);

2050 CALL KEY(0,K,S) :: IF S=0 THEN 2050

2060 IF K=11 THEN TOOL=TOOL-1 :: GOTO 2038

2070 IF K=10 THEN TOOL=TOOL+1 :: GOTO 2038

2080 IF K=13 THEN 2105

2090 IF K<65 OR K>81 THEN 2050

2100 TOOL=K :: GOTO 2040

2105 IF TOOLCOST(TOOL-64)>SCORE THEN CALL SOUND(100,110,0) :: GOTO 2010

2107 SCORE=SCORE-TOOLCOST(TOOL-64)

2110 ON TOOL-64 GOTO 3260,3270,3350,3180,3170,3130,3030,2740,2660,2630,2560,2420,2290,2210,2170,2120,2140

2120 DISPLAY AT(23,1):"":"PUSH SPACE TO USE YOUR TOOLS" :: DISPLAY AT(23,29-LEN(N$)):N$ :: DISPLAY AT(23,1):"LEVEL";LEVEL;

2130 RETURN

2140 DISPLAY AT(23,1):"ARE YOU SURE? Y OR N":""

2150 CALL KEY(0,K,S) :: IF S=0 THEN 2150 ELSE IF K<>89 THEN 2010

2160 CALL CLEAR :: GOTO 105

2170 DISPLAY AT(23,1):"ARE YOU SURE? Y OR N":""

2180 CALL KEY(0,K,S) :: IF S=0 THEN 2180 ELSE IF K<>89 THEN 2010

2190 FOR X=1 TO 30 :: IF CATX(X)>0 THEN CALL HCHAR(CATX(X),CATY(X),32) :: CALL COLOR(1,7,1) :: CALL SOUND(300,-6,0) :: CALL SOUND(300,-7,0)

2200 CALL COLOR(1,2,1) :: CATX(X),CATY(X)=0 :: NEXT X :: CTOT=0 :: BET=0 :: RETURN

2210 CALL PICK(XX,YY)

2220 CALL GCHAR(XX,YY,W) :: IF W=32 OR W=40 THEN CALL SOUND(100,110,0) :: SCORE=SCORE+200 :: GOTO 2010

2225 IF W=128 OR W=120 THEN CFLAGX,CFLAGY=0

2230 IF W=37 OR W=36 OR W=143 OR W=120 OR W=128 THEN CALL HCHAR(XX,YY,32) :: CALL SOUND(100,-5,0) :: GOTO 2010

2240 DISPLAY AT(23,1):"THE OBJECT IS TO HERD CATS\ NOT KILL THEM]"

2250 ZZ=1

2260 IF CATX(ZZ)=XX AND CATY(ZZ)=YY THEN CATX(ZZ),CATY(ZZ)=0 :: CTOT=CTOT-1 :: CALL HCHAR(XX,YY,32) :: CALL SOUND(300,-6,0) :: CALL SOUND(300,-7,0)

2270 IF CATX(ZZ)<>0 THEN ZZ=ZZ+1 :: GOTO 2260

2280 CALL PAUSE :: GOTO 2010

2290 IF EXITY<13 OR EXITY>17 THEN 2300 ELSE DISPLAY AT(23,1):"YOU MUST MOVE THE EXIT FIRST":"" :: CALL SOUND(200,110,0)

2295 CALL PAUSE :: SCORE=SCORE+1000 :: GOTO 2010

2300 DISPLAY AT(23,1):"ARE YOU SURE? Y OR N":""

2310 CALL KEY(0,K,S) :: IF S=0 THEN 2310 ELSE IF K<>89 THEN 2010

2320 IF EXITY<17 THEN KILL=17 ELSE KILL=1

2330 FOR XX=KILL TO KILL+15 :: FOR YY=1 TO 19

2340 CALL GCHAR(YY,XX,ZZ) :: IF ZZ<>35 THEN CALL HCHAR(YY,XX,36) :: GOTO 2390

2360 CALL MEOW :: WW=1

2370 IF CATX(WW)=YY AND CATY(WW)=XX THEN CATX(WW),CATY(WW)=0 :: CALL HCHAR(YY,XX,36) :: CTOT=CTOT-1 :: GOTO 2390

2380 WW=WW+1 :: GOTO 2370

2390 NEXT YY :: NEXT XX

2400 FOR XX=1 TO 19 :: IF KILL=1 THEN CALL HCHAR(XX,16,37) :: CALL HCHAR(XX,1,37)

2405 IF KILL=17 THEN CALL HCHAR(XX,17,37) :: CALL HCHAR(XX,32,17)

2410 NEXT XX :: GOTO 2010

2420 IF TIME>CYCLES-(CYCLES/10)OR BET<>0 THEN DISPLAY AT(23,1):"SORRY, THE HOUSE IS CLOSED.":"" :: CALL SOUND(300,-7,0) :: CALL PAUSE :: SCORE=SCORE+50 :: GOTO 2120

2440 DISPLAY AT(23,1):"BETTING ON HOW MANY CATS[[[ 1[EXIT 2[DIE 3[CANCEL BET"

2450 CALL KEY(0,K,S) :: IF S=0 THEN 2450

2460 IF K<49 OR K>50 THEN SCORE=SCORE+50 :: GOTO 2120

2470 BET=500-((INT(TIME/CYCLES))*500)

2480 IF K=49 THEN BET=BET-(CSAVE*50)

2490 IF K=50 THEN BET=BET-((CSTARTOT-CTOT-CSAVE)*50)

2495 YY=BET/10 :: ZZ=INT(RND*(YY*2))-YY :: BET=BET+ZZ

2500 IF BET<25 THEN DISPLAY AT(23,1):"SORRY, CAN'T HELP YA\ SPORT[":"" :: CALL SOUND(300,-7,0) :: CALL PAUSE :: SCORE=SCORE+50 :: BET=0 :: GOTO 2120

2510 IF K=50 THEN DISPLAY AT(23,1):"I PAY";BET;"PER DEAD CAT^YOU":"PAY";BET;"PER SAFE CAT^OK?" :: BET=-BET

2520 IF K=49 THEN DISPLAY AT(23,1):"OK\ I PAY";BET;"PER SAFE CAT[":"YOU PAY";BET;"PER GONER. OK?"

2530 CALL KEY(0,K,S) :: IF S=0 AND K<>89 AND K<>78 THEN 2530

2540 IF K=78 THEN SCORE=SCORE+50 :: BET=0 :: GOTO 2120

2550 DISPLAY AT(23,1):"PLEASURE DOIN' BUSINESS,":"YA RUBE]" :: CALL PAUSE :: GOTO 2120

2560 DISPLAY AT(23,1):"ARE YOU SURE? Y OR N":" "

2570 CALL KEY(0,K,S) :: IF S=0 THEN 2570 ELSE IF K<>89 THEN SCORE=SCORE+2000 :: GOTO 2120

2575 DISPLAY AT(23,1):"CAN I GET AN AMEN?]":" "

2580 FOR ZZ=1 TO CSTARTOT :: IF CATX(ZZ)>0 THEN 2610

2590 CATX(ZZ)=INT(RND*19)+1 :: CATY(ZZ)=INT(RND*32)+1 :: CALL GCHAR(CATX(ZZ),CATY(ZZ),YY) :: IF YY<>32 THEN 2590

2600 CALL HCHAR(CATX(ZZ),CATY(ZZ),35) :: CALL SOUND(400,1047,0,880,0) :: CALL COLOR(1,16,1) :: CALL COLOR(1,2,1)

2610 NEXT ZZ :: CTOT=CSTARTOT-CSAVE

2620 GOTO 2010

2630 CALL PICK(XX,YY)

2640 CALL GCHAR(XX,YY,W) :: IF W<>32 THEN CALL SOUND(200,110,0) :: SCORE=SCORE+200 :: GOTO 2010

2650 CALL HCHAR(XX,YY,37) :: CALL SOUND(150,-5,0,110,7) :: GOTO 2010

2660 IF PULTFLAG<>0 THEN CALL SOUND(100,110,0) :: SCORE=SCORE+4000 :: GOTO 2010

2670 !

2680 DISPLAY AT(23,1):"ARE YOU SURE? Y OR N":""

2690 CALL KEY(0,K,S) :: IF S=0 THEN 2690 ELSE IF K<>89 THEN SCORE=SCORE+4000 :: GOTO 2010

2695 CALL PICK(XX,YY) :: IF XX>15 OR YY>28 THEN CALL SOUND(100,110,0) :: GOTO 2695

2700 FOR AA=XX TO XX+4 :: FOR BB=YY TO YY+4 :: CALL GCHAR(AA,BB,CC) :: IF CC<>32 THEN NOFLAG=1

2705 NEXT BB :: NEXT AA

2710 IF NOFLAG THEN 2730

2720 FOR AA=XX TO XX+4 :: FOR BB=YY TO YY+4 :: CALL HCHAR(AA,BB,143) :: CALL SOUND(20,-5,0) :: NEXT BB :: NEXT AA

2722 DISPLAY AT(23,1):"DIRECTION FOR CAT^A^PULT? ENTER N S E W"

2724 CALL KEY(0,K,S) :: IF S=0 THEN 2724 ELSE IF K<>78 AND K<>83 AND K<>69 AND K<>87 THEN 2724

2725 IF K=78 THEN PULTFLAG=1 ELSE IF K=83 THEN PULTFLAG=2 ELSE IF K=69 THEN PULTFLAG=3 ELSE PULTFLAG=4

2727 CALL HCHAR(XX+2,YY+2,PULTFLAG+138) :: GOTO 2120

2730 NOFLAG=0 :: CALL SOUND(200,110,0) :: DISPLAY AT(23,1):"THIS LOCATION IS NOT CLEAR[" :: CALL PAUSE :: SCORE=SCORE+4000 :: GOTO 2010

2740 DISPLAY AT(23,1):"CATDOZER GOES":"1[L^R 2[R^L 3[CANCEL"

2750 CALL KEY(0,K,S) :: IF S=0 THEN 2750 ELSE IF K<49 OR K>51 THEN 2750

2760 IF K=51 THEN SCORE=SCORE+5000 :: GOTO 2120

2770 XX=1 :: BULLDIR=K-48 :: IF BULLDIR=1 THEN YY=1 ELSE YY=32

2775 DISPLAY AT(23,1):"UP^DOWN ARROWS TO SELECT\":"ENTER CONFIRMS["

2780 CALL SPRITE(#1,41,7,((XX-1)*8)+1,((YY-1)*8)+1)

2790 DISPLAY AT(23,1):"UP^DOWN ARROWS TO SELECT\ ENTER CONFIRMS["

2800 CALL KEY(0,K,S) :: IF S=0 THEN 2800

2810 IF K=11 THEN AA=1 :: XX=XX-1 :: IF XX=0 THEN XX=15

2820 IF K=10 THEN AA=1 :: XX=XX+1 :: IF XX=16 THEN XX=1

2830 IF K<>13 THEN IF AA=0 THEN 2800 ELSE AA=0 :: GOTO 2780

2840 DISPLAY AT(23,1):"MAKE WAY FOR THE CATDOZER]":""

2845 FOR BB=1 TO 32

2850 FOR AA=1 TO 5 :: CALL SPRITE(#AA,143,11,(((XX-1)*8)+1)+(((AA-1)*8)+1),((YY-1)*8)+1) :: NEXT AA

2865 CALL SOUND(-1000,110,0,127,0,-7,3)

2870 FOR CC=XX TO XX+4 :: CALL GCHAR(CC,YY,WW)

2880 IF WW=37 OR WW=143 OR WW=35 OR WW=142 OR WW=141 OR WW=140 OR WW=139 THEN CALL HCHAR(CC,YY,32)

2890 IF WW<>35 THEN 2920

2900 W=1

2910 IF CATX(W)=CC AND CATY(W)=YY THEN CATX(W)=-10

2915 W=W+1 :: IF W<31 THEN 2910

2920 IF WW=143 OR WW=128 THEN CALL HCHAR(CC,YY,32) :: CFLAGX,CFLAGY=0

2922 IF WW<>40 THEN 2930

2924 FOR W=1 TO 30 :: IF CATX(W)=-10 THEN CALL SAFE :: CSAVE=CSAVE+1 :: SCORE=SCORE+1000 :: CTOT=CTOT-1 :: CATX(W)=-1

2925 NEXT W

2930 NEXT CC :: IF BULLDIR=1 THEN YY=YY+1 ELSE YY=YY-1

2940 NEXT BB

2950 CALL DELSPRITE(ALL) :: IF YY=33 THEN YY=32 ELSE IF YY=0 THEN YY=1

2960 FOR BB=1 TO 30

2970 IF CATX(BB)<>-10 THEN 3010

2980 CALL GCHAR(XX,YY,WW) :: IF WW<>32 THEN 3000

2990 CATX(BB)=XX :: CATY(BB)=YY :: CALL HCHAR(XX,YY,35) :: CALL SOUND(40,440,0)

3000 XX=XX+1 :: IF XX=20 THEN XX=1

3010 NEXT BB

3020 GOTO 2120

3030 DISPLAY AT(23,1):"ARE YOU SURE? Y OR N":""

3040 CALL KEY(0,K,S) :: IF S=0 THEN 3040 ELSE IF K<>89 THEN SCORE=SCORE+3500 :: GOTO 2120

3050 DISPLAY AT(23,1):"BUMP TABLE FROM WHICH SIDE?":"ENTER N S E OR W"

3060 CALL KEY(0,K,S) :: IF S=0 THEN 3060

3070 IF K=78 THEN BUMP=1 ELSE IF K=83 THEN BUMP=2 ELSE IF K=69 THEN BUMP=3 ELSE IF K=87 THEN BUMP=4 ELSE 3060

3080 FOR LC=1 TO 30

3090 IF CATX(LC)<1 THEN 3120

3100 ON BUMP GOSUB 10710,10720,10730,10740

3110 CALL GCHAR(TEMPX,TEMPY,Y) :: GOSUB 9060 :: IF WALLFLAG=1 THEN WALLFLAG=0

3120 NEXT LC :: GOTO 2120

3130 DISPLAY AT(23,1):"ARE YOU SURE? Y OR N":""

3140 CALL KEY(0,K,S) :: IF S=0 THEN 3140 ELSE IF K<>89 THEN SCORE=SCORE+500 :: GOTO 2120

3150 CALL SOUND(400,880,0,440,0) :: TIME=TIME-100 :: IF TIME<1 THEN TIME=1

3160 GOTO 2120

3170 IF XF<>0 THEN 3250 ELSE XF=2 :: XF2=0 :: GOTO 3185

3180 IF XF<>0 THEN 3250 ELSE XF=1 :: XF2=0

3185 IF EXITX+7+XF>19 OR EXITY+3+XF>32 THEN DISPLAY AT(23,1):"NOT ENOUGH ROOM TO EXPAND[":"" :: XF2=XF :: XF=0 :: GOTO 3250

3187 DISPLAY AT(23,1):"ARE YOU SURE? PRESS Y OR N":""

3188 CALL KEY(0,K,S) :: IF S=0 THEN 3188 ELSE IF K<>89 THEN SCORE=SCORE+1500*XF :: XF=0 :: GOTO 2120

3190 FOR ZZ=EXITX+8 TO EXITX+7+XF :: FOR YY=EXITY TO EXITY+3+XF :: CALL GCHAR(ZZ,YY,QQ) :: IF QQ<>32 THEN XF2=1

3195 NEXT YY :: NEXT ZZ

3200 FOR ZZ=EXITY+4 TO EXITY+3+XF :: FOR YY=EXITX TO EXITX+7+XF :: CALL GCHAR(YY,ZZ,QQ) :: IF QQ<>32 THEN XF2=1

3205 NEXT YY :: NEXT ZZ

3210 IF XF2=1 THEN DISPLAY AT(23,1):"YOU MUST CLEAR SPACE FIRST[":"" :: XF2=XF :: XF=0 :: GOTO 3250

3220 FOR ZZ=EXITX+8 TO EXITX+7+XF :: FOR YY=EXITY TO EXITY+3+XF :: CALL HCHAR(ZZ,YY,40) :: CALL SOUND(20,-5,0) :: NEXT YY :: NEXT ZZ

3230 FOR ZZ=EXITY+4 TO EXITY+3+XF :: FOR YY=EXITX TO EXITX+7+XF :: CALL HCHAR(YY,ZZ,40) :: CALL SOUND(20,-5,0) :: NEXT YY :: NEXT ZZ

3240 GOTO 2120

3250 CALL SOUND(100,110,0) :: SCORE=SCORE+(1500*XF2) :: CALL PAUSE :: GOTO 2120

3260 ZZ=128 :: GOTO 3280

3270 ZZ=120

3280 IF CFLAGX<>0 THEN 3345

3290 DISPLAY AT(23,1):"ARE YOU SURE? PRESS Y OR N":""

3300 CALL KEY(0,K,S) :: IF S=0 THEN 3300 ELSE IF K<>89 THEN SCORE=SCORE+2500 :: GOTO 2120

3310 CALL PICK(XX,YY) :: CALL GCHAR(XX,YY,QQ) :: IF QQ<>32 THEN 3345

3320 IF ZZ=128 THEN CFLAGX=XX :: CFLAGY=YY ELSE CFLAGX=-XX :: CFLAGY=-YY

3330 CALL HCHAR(XX,YY,ZZ)

3340 CALL SOUND(200,880,0,440,0) :: GOTO 2120

3345 CALL SOUND(100,110,0) :: SCORE=SCORE+2500 :: GOTO 2120

3350 IF XF<>0 THEN 3470

3360 DISPLAY AT(23,1):"ARE YOU SURE? Y OR N":" "

3370 CALL KEY(0,K,S) :: IF S=0 THEN 3370 ELSE IF K<>89 THEN SCORE=SCORE+5000 :: GOTO 2120

3380 CALL PICK(XX,YY) :: IF XX>11 OR YY>29 THEN 3470

3390 FOR QQ=EXITX TO EXITX+7 :: FOR WW=EXITY TO EXITY+3 :: CALL HCHAR(QQ,WW,32) :: CALL SOUND(20,-7,0,110,0) :: NEXT WW :: NEXT QQ

3400 FOR QQ=XX TO XX+7 :: FOR WW=YY TO YY+3

3410 CALL GCHAR(QQ,WW,ZZ)

3420 IF ZZ=35 THEN 3450

3430 IF ZZ=128 OR ZZ=120 THEN CFLAGX,CFLAGY=0

3440 CALL HCHAR(QQ,WW,40) :: CALL SOUND(20,-5,0)

3445 NEXT WW :: NEXT QQ :: EXITX=XX :: EXITY=YY :: GOTO 2120

3450 FOR VV=1 TO 30 :: IF CATX(VV)=QQ AND CATY(VV)=WW THEN CATX(VV)=-1 :: CALL SAFE :: CSAVE=CSAVE+1 :: CTOT=CTOT-1

3460 NEXT VV :: GOTO 3440

3470 CALL SOUND(100,110,0) :: CALL PAUSE :: SCORE=SCORE+5000 :: GOTO 2120

8500 FOR X=1 TO 19 :: DISPLAY AT(X,1):"" :: CALL HCHAR(X,1,32,2) :: CALL HCHAR(X,31,32,2) :: NEXT X

8510 DISPLAY AT(2,2):"WELCOME TO LEVEL";LEVEL;":"

8520 DISPLAY AT(3,2):"'";N$;"'"

8530 DISPLAY AT(5,2):"YOU MUST REACH";PGOAL;"POINTS"

8540 DISPLAY AT(6,2):"IN";CYCLES;"MOVES["

8550 DISPLAY AT(8,2):"CATS EXPLODE ON CONTACT?:" :: IF ECAT=1 THEN CALL HCHAR(8,30,89)ELSE CALL HCHAR(8,30,78)

8560 DISPLAY AT(9,2):"CATS WRAP AROUND SCRN?:" :: IF WRAP=1 THEN CALL HCHAR(9,28,89)ELSE CALL HCHAR(9,28,78)

8570 DISPLAY AT(13,2):"PRESS ANY KEY TO HERD CATS]" :: CALL ANY

8580 RETURN

8700 CALL SOUND(2000,1397,0,1480,5) :: FOR X=1 TO 19 :: DISPLAY AT(X,1):"" :: CALL HCHAR(X,1,32,2) :: CALL HCHAR(X,31,32,2) :: NEXT X

8710 DISPLAY AT(2,1):"L E V E L C O M P L E T E D" :: DISPLAY AT(23,1):"":""

8720 DISPLAY AT(5,1):"YOU STARTED WITH";CSTARTOT;"CATS[[[":"AND SAVED";CSAVE;"OF THEM["

8730 DISPLAY AT(8,1):"YOU NEEDED";PGOAL;"POINTS[[[":"YOU NOW HAVE";SCORE

8735 IF BET=0 THEN 8740

8737 IF BET>0 THEN BET=BET*(CSAVE-(CSTARTOT-CSAVE))

8738 IF BET<0 THEN BET=ABS(BET) :: BET=BET*((CSTARTOT-CSAVE)-CSAVE)

8739 DISPLAY AT(11,1):"CAT BOOKIE WINNINGS:";BET :: SCORE=SCORE+BET :: DISPLAY AT(21,1):USING 130:TIME,SCORE

8740 IF SCORE<PGOAL THEN DISPLAY AT(13,1):"YOUR LICENSE TO HERD CATS IS":" HEREBY REVOKED]]" :: LEVEL=-1

8750 IF SCORE>=PGOAL THEN DISPLAY AT(13,1):"CONGRATULATIONS\ CAT HERDER]"

8760 CALL ANY :: RETURN

9000 !

9005 X=0

9008 CALL KEY(0,K,S) :: IF K=32 THEN GOSUB 2000

9010 TIME=TIME+1 :: DISPLAY AT(21,1):USING 130:TIME,SCORE :: IF TIME=CYCLES OR CTOT=0 THEN RETURN

9020 Z=0 :: X=X+1 :: IF X=31 THEN X=1

9024 IF CATX(X)<1 THEN 9020

9025 TRY=0

9030 TRY=TRY+1 :: Y=INT(RND*8)+1 :: ON Y GOSUB 9400,9410,9420,9430,9440,9450,9460,9470

9035 IF TRY=6 THEN CALL SOUND(100,110,0) :: GOTO 9008

9040 IF Z=0 THEN 9030 ELSE Z=0

9041 IF TEMPX<CATX(X)AND ABS(CFLAGX)<TEMPX AND CFLAGX<0 THEN W=1

9042 IF TEMPX<CATX(X)AND ABS(CFLAGX)>TEMPX AND CFLAGX>0 THEN W=1

9043 IF TEMPY>CATY(X)AND ABS(CFLAGY)>TEMPY AND CFLAGY<0 THEN W=1

9044 IF TEMPY>CATY(X)AND ABS(CFLAGY)<TEMPY AND CFLAGY>0 THEN W=1

9045 IF TEMPX>CATX(X)AND ABS(CFLAGX)>TEMPX AND CFLAGX<0 THEN W=1

9046 IF TEMPX>CATX(X)AND ABS(CFLAGX)<TEMPX AND CFLAGX>0 THEN W=1

9047 IF TEMPY<CATY(X)AND ABS(CFLAGY)<TEMPY AND CFLAGY<0 THEN W=1

9048 IF TEMPY<CATY(X)AND ABS(CFLAGY)>TEMPY AND CFLAGY>0 THEN W=1

9049 IF W=1 THEN W=INT(RND*100) :: IF W<87 THEN W=0 :: GOTO 9030

9050 W=0 :: CALL GCHAR(TEMPX,TEMPY,Y)

9055 LC=X :: GOSUB 9060 :: IF WALLFLAG=1 THEN WALLFLAG=0 :: GOTO 9030 ELSE 9008

9060 IF Y=36 THEN CALL HCHAR(CATX(LC),CATY(LC),32) :: CALL FALL :: CTOT=CTOT-1 :: CATX(LC)=0 :: RETURN

9070 IF Y=40 THEN CALL HCHAR(CATX(LC),CATY(LC),32) :: CALL SAFE :: CTOT=CTOT-1 :: SCORE=SCORE+1000 :: CATX(LC)=-1 :: CSAVE=CSAVE+1 :: RETURN

9075 IF Y=32 THEN CALL HCHAR(CATX(LC),CATY(LC),32) :: CALL HCHAR(TEMPX,TEMPY,35) :: CATX(LC)=TEMPX :: CATY(LC)=TEMPY :: RETURN

9080 IF Y<>143 THEN 9090

9081 CALL HCHAR(CATX(LC),CATY(LC),32) :: AA=CATX(LC) :: BB=CATY(LC) :: CATX(LC)=TEMPX :: CATY(LC)=TEMPY

9082 FOR ZZ=880 TO 110 STEP-110 :: CALL SOUND(-100,ZZ,0) :: NEXT ZZ :: FOR ZZ=110 TO 1430 STEP 110 :: CALL SOUND(-100,ZZ,0) :: NEXT ZZ

9083 ON PULTFLAG GOSUB 10810,10830,10850,10870

9084 CALL GCHAR(TEMPX,TEMPY,Y) :: CATX(LC)=AA :: CATY(LC)=BB :: IF Y=32 OR Y=36 OR Y=40 THEN 9060 ELSE 9100

9090 IF ECAT=0 THEN CALL SOUND(50,-3,0) :: Z=0 :: WALLFLAG=1 :: RETURN

9100 CTOT=CTOT-1 :: CALL HCHAR(CATX(LC),CATY(LC),32) :: CATX(LC)=-1 :: CALL COLOR(1,7,1) :: CALL SOUND(300,-6,0) :: CALL SOUND(300,-7,10)

9105 CALL COLOR(1,2,1) :: RETURN

9110 RETURN

9400 TEMPX=CATX(X)-1 :: TEMPY=CATY(X) :: IF TEMPX=0 AND WRAP=1 THEN TEMPX=19 :: Z=1 :: GOTO 9405

9402 IF TEMPX>0 THEN Z=1

9405 RETURN

9410 TEMPX=CATX(X)-1 :: TEMPY=CATY(X)+1 :: IF TEMPX=0 AND TEMPY=33 AND WRAP=1 THEN TEMPX=19 :: TEMPY=1 :: Z=1 :: GOTO 9415

9412 IF TEMPX=0 AND WRAP=1 THEN TEMPX=19 :: Z=1 :: GOTO 9415

9413 IF TEMPY=33 AND WRAP=1 THEN TEMPY=1 :: Z=1 :: GOTO 9415

9414 IF TEMPX>0 AND TEMPY<33 THEN Z=1

9415 RETURN

9420 TEMPX=CATX(X) :: TEMPY=CATY(X)+1 :: IF TEMPY=33 AND WRAP=1 THEN TEMPY=1 :: Z=1 :: GOTO 9425

9422 IF TEMPY<33 THEN Z=1

9425 RETURN

9430 TEMPX=CATX(X)+1 :: TEMPY=CATY(X)+1 :: IF TEMPX=20 AND TEMPY=33 AND WRAP=1 THEN TEMPX,TEMPY,Z=1 :: GOTO 9435

9432 IF TEMPX=20 AND WRAP=1 THEN TEMPX,Z=1 :: GOTO 9435

9433 IF TEMPY=33 AND WRAP=1 THEN TEMPY,Z=1 :: GOTO 9435

9434 IF TEMPX<20 AND TEMPY<33 THEN Z=1

9435 RETURN

9440 TEMPX=CATX(X)+1 :: TEMPY=CATY(X) :: IF TEMPX=20 AND WRAP=1 THEN TEMPX=1 :: Z=1 :: GOTO 9445

9442 IF TEMPX<20 THEN Z=1

9445 RETURN

9450 TEMPX=CATX(X)+1 :: TEMPY=CATY(X)-1 :: IF TEMPX=20 AND TEMPY=0 AND WRAP=1 THEN TEMPX=1 :: TEMPY=32 :: Z=1 :: GOTO 9455

9452 IF TEMPX=20 AND WRAP=1 THEN TEMPX=1 :: Z=1 :: GOTO 9455

9453 IF TEMPY=0 AND WRAP=1 THEN TEMPY=32 :: Z=1 :: GOTO 9455

9454 IF TEMPX<20 AND TEMPY>0 THEN Z=1

9455 RETURN

9460 TEMPX=CATX(X) :: TEMPY=CATY(X)-1 :: IF TEMPY=0 AND WRAP=1 THEN TEMPY=32 :: Z=1 :: GOTO 9465

9462 IF TEMPY>0 THEN Z=1

9465 RETURN

9470 TEMPX=CATX(X)-1 :: TEMPY=CATY(X)-1 :: IF TEMPX=0 AND TEMPY=0 AND WRAP=1 THEN TEMPX=19 :: TEMPY=32 :: Z=1 :: GOTO 9475

9472 IF TEMPX=0 AND WRAP=1 THEN TEMPX=19 :: Z=1 :: GOTO 9475

9473 IF TEMPY=0 AND WRAP=1 THEN TEMPY=32 :: Z=1 :: GOTO 9475

9474 IF TEMPX>0 AND TEMPY>0 THEN Z=1

9475 RETURN

9500 FOR X=1 TO CTOT

9520 Y=INT(RND*19)+1 :: Z=INT(RND*28)+1 :: CALL GCHAR(Y,Z,W) :: IF W<>32 THEN 9520

9525 CALL HCHAR(Y,Z,35) :: CATX(X)=Y :: CATY(X)=Z :: NEXT X

9540 RETURN

9600 FOR X=1 TO CTOT :: READ CATX(X),CATY(X) :: CALL HCHAR(CATX(X),CATY(X),35) :: NEXT X

9610 RETURN

9710 DATA "CATNIP MAGNET","CAT REPELLENT","MOVE EXIT","EXPAND EXIT","EXPAND EXIT X2","TURN BACK TIME"

9720 DATA "BUMP TABLE","CATDOZER","CAT^A^PULT","BUILD WALL","CAT RAPTURE","CAT BOOKIE","CUT TABLE IN 2"

9730 DATA "WRECKING BALL","CAT^POCALYPSE","CONTINUE","QUIT TO MAIN"

9740 DATA 2500,2500,5000,1500,3000,500,3500,5000,4000,200,2000,50,1000,200,0,0,0,0,0,0,0,0,0,0

10000 CALL CLEAR

10010 DISPLAY AT(1,3):"H E R D I N G C A T S" :: DISPLAY AT(2,2):"VERSION 0[8 FEBRUARY 2010"

10020 DISPLAY AT(21,5):"C 2010 KEITH BERGMAN":" FOR ORPHANTECH[COM":"":"EMAIL^ EXILETOLEDO@GMAIL.COM"

10050 DISPLAY AT(11,1):"1[ START GAME":"2[ EXIT"

10060 CALL KEY(0,K,S) :: IF S=0 THEN 10060 ELSE IF K<49 OR K>51 THEN 10060

10070 ON K-48 GOTO 10080,10090,10120

10080 CALL CLEAR :: CALL CHAR(36,"FFFFFFFFFFFFFFFF") :: RETURN

10090 CALL CLEAR :: STOP

10120 CALL CLEAR :: INPUT "LEVEL?":LEVEL :: SCORE=99999 :: GOTO 10080

10700 !

10710 TEMPY=CATY(LC) :: TEMPX=INT(RND*3)+16 :: RETURN

10720 TEMPY=CATY(LC) :: TEMPX=INT(RND*3)+1 :: RETURN

10730 TEMPX=CATX(LC) :: TEMPY=INT(RND*3)+1 :: RETURN

10740 TEMPX=CATX(LC) :: TEMPY=INT(RND*3)+29 :: RETURN

10800 !

10810 TEMPY=CATY(X) :: TEMPX=CATX(X)-(INT(RND*5)+10) :: IF TEMPX<0 THEN IF WRAP=0 THEN TEMPX=1 ELSE TEMPX=TEMPX+19

10820 RETURN

10830 TEMPY=CATY(X) :: TEMPX=CATX(X)+(INT(RND*5)+10) :: IF TEMPX>19 THEN IF WRAP=0 THEN TEMPX=19 ELSE TEMPX=TEMPX-19

10840 RETURN

10850 TEMPX=CATX(X) :: TEMPY=CATY(X)+(INT(RND*8)+21) :: IF TEMPY>32 THEN IF WRAP=0 THEN TEMPY=32 ELSE TEMPY=TEMPY-32

10860 RETURN

10870 TEMPX=CATX(X) :: TEMPY=CATY(X)-INT(RND*8)+21) :: IF TEMPY<1 THEN IF WRAP=0 THEN TEMPY=1 ELSE TEMPY=TEMPY+32

10880 RETURN

11000 RESTORE 11010 :: RETURN

11010 DATA "NICE AND EASY",250,10000,0,0,0,6,15,15

11020 DATA " ","$ $"," "," %%%%%%%%"," % %"

11030 DATA " % %"," % %"," % %"," % %"

11040 DATA "$ % % $"," % %"," % %"," % %"," % %"

11050 DATA " %%%%%%%%"," "," ","$ $"," "

11060 DATA 5,8,5,15,5,17,5,19,6,14,7,19,8,14,9,19,10,14,11,19,12,14,13,19,14,14,14,16,14,18

11100 RESTORE 11110 :: RETURN

11105 REM LEVEL 4

11110 DATA "A BRIDGE TOO FAR",400,32000,0,0,0,6,27,20

11120 DATA "$$$$$$$$$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$ "," $$$$$$$$$$$$$$$$$$$$ "

11130 DATA " $$$$$$$$$$$$$$"," $$$$$$$$$$$"," $$$"," "," "

11140 DATA " $$$$"," $$$$$$$"," $$$$$$$$$$$$"," $$$$$$$$$$$$$$$$"," $$$$$$$$$$$$$$$$$$$"

11150 DATA " $$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$$$$$"

11160 DATA "$$$$$$$$$$$$$$$$$$$$$$$$$$$$"

11170 DATA 4,1,5,5,6,3,7,6,7,13,8,2,8,5,8,7,9,1,9,14

11180 DATA 10,3,10,5,10,7,11,7,12,1,12,4,13,7,14,2,16,1,14,5

11190 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

11200 RESTORE 11210 :: RETURN

11205 REM LEVEL 5

11210 DATA "WALL MANIA",750,38000,0,0,1,7,13,30

11220 DATA " % % %%% "," % % $ % $ %"," %% %%%","% %"

11230 DATA " %%%","$ % %%%%% $ %%%%","$ % % % %","$ % % %%% %"

11240 DATA "$ % $ % %"," % %% %%%%"," % % % $"," % %% % %$"

11250 DATA " %%% % % %$ % %"," %% % %$ % %"," % %%%%%%$"," % %$"

11260 DATA "$ % % $ %$ % %"," % %%%% % %"," %%% $ % %%%%"

11270 DATA 1,11,1,12,1,13,1,14,2,25,2,26,4,4,4,5,4,8,4,9

11280 DATA 7,17,8,17,9,17,7,28,7,29,9,21,9,22,11,26,11,27,14,21

11290 DATA 18,27,18,28,19,22,19,23,18,7,13,9,14,1,15,4,12,5,12,6

11300 RESTORE 11310 :: RETURN

11305 REM LEVEL 6

11310 DATA "SNAKE THE TRAP",600,42000,1,1,0,1,29,25

11320 DATA " %%%%%%%%%%%%%%%%%%%%$$$$"," % %$$$$","$ % %%%%%"," % %"

11330 DATA " % %"," % % $"," %% % % %"," % % % %"

11340 DATA " % % $ % % %"," % % % % %"," % % % % %"," % % % % %"

11350 DATA " % % % % %"," % $ % %"," $ % % $ %"," % % %"

11360 DATA " % % %"," % % %"," %%%%%%%%%%%%%%%%%%%%%%%%%"

11400 RESTORE 11410 :: RETURN

11405 REM LEVEL 7

11410 DATA "V FOR VICTORY",500,48000,0,0,0,12,15,22

11420 DATA "% %"," % %"," % %"," % %"

11430 DATA " $ % % $"," % %"," $ % % $"," $ % % $"

11440 DATA " $ $ % % $ $"," $ % % $"," $ $ % % $ $"," $ $ % % $ $"

11450 DATA " $ $ $ $ $ $"," $ $ $ $"," $ $ $ $ $ $"," $ $ $ $"

11460 DATA " $ $ $ $ $ $"," $ $ $ $"," $ $ $ $ $ $"

11470 DATA 1,4,1,29,2,5,2,28,3,6,3,27,4,7,4,26,5,8,5,25

11480 DATA 6,9,6,24,7,10,7,23,8,11,8,22,9,12,9,21,10,13,10,20

11490 DATA 11,14,11,19

12000 RESTORE 12010 :: RETURN

12010 DATA "MIND THE HOLES",400,20000,1,0,0,11,24,20

12020 DATA " %%"," %% $ $"," $ %%"," %%"

12030 DATA " $"," $"," %% %%"," %% %%"

12040 DATA " %% %%"," %% %%"," "," $"," %%"," %% $"

12050 DATA " %%"," $ %%"," $"," $"," "

12100 RESTORE 12110 :: RETURN

12110 DATA "WRONG SIDE OF TRAX",400,26000,0,0,1,6,3,15

12120 DATA " $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"

12130 DATA " $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," % $ $ $ $ $ $ $"

12140 DATA " %% $ $ $ $ $ $ $"," %%%%%% $ $ $ $ $ $ $"," %% $ $ $ $ $ $ $"," % $ $ $ $ $ $ $"

12150 DATA " $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"

12160 DATA " $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"

12170 DATA 2,10,3,5,3,13,4,8,4,12,9,12,14,9,17,4,17,13,18,7,3,19,8,30,10,22,16,20,19,29

12180 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

32000 SUB ANY

32010 CALL SOUND(-200,523,20)

32020 CALL KEY(0,K,S) :: IF S<>0 THEN SUBEXIT

32030 CALL SOUND(-200,440,20)

32040 CALL KEY(0,K,S) :: IF S<>0 THEN SUBEXIT

32050 CALL SOUND(-200,262,20)

32060 CALL KEY(0,K,S) :: IF S<>0 THEN SUBEXIT

32070 GOTO 32010

32080 SUBEND

32090 SUB FALL

32100 FOR W=880 TO 110 STEP-20

32105 CALL SOUND(-50,W,7) :: NEXT W

32110 CALL SOUND(200,-7,0) :: CALL COLOR(1,7,1) :: CALL COLOR(1,2,1)

32120 SUBEND

32125 SUB SAFE

32130 CALL SOUND(50,440,0) :: CALL SOUND(50,523,0) :: CALL SOUND(200,880,0,988,0)

32135 FOR W=1 TO 30 STEP 3 :: CALL SOUND(-40,880,W,988,W) :: NEXT W

32140 SUBEND

32150 SUB UPD

32160 DISPLAY AT(21,1):USING 130:TIME,SCORE

32170 SUBEND

32180 SUB EXP

32190 CALL SOUND(500,-7,0) :: CALL SOUND(500,-7,8) :: CALL SOUND(600,-7,20)

32200 SUBEND

32300 SUB PICK(XX,YY)

32305 XX=1 :: YY=3

32307 DISPLAY AT(23,1):"ARROWS MOVE\ ENTER SELECTS.":""

32310 CALL SPRITE(#1,41,7,((XX-1)*8)+1,((YY-1)*8)+1)

32320 CALL KEY(0,K,S) :: IF S=0 THEN 32320 ELSE IF K<8 OR K>13 THEN 32320

32330 IF K=11 THEN XX=XX-1 :: IF XX=0 THEN XX=19

32340 IF K=10 THEN XX=XX+1 :: IF XX=20 THEN XX=1

32350 IF K=8 THEN YY=YY-1 :: IF YY=0 THEN YY=32

32360 IF K=9 THEN YY=YY+1 :: IF YY=33 THEN YY=1

32370 IF K<>13 THEN 32310

32380 DISPLAY AT(23,1):"ARE YOU SURE? Y OR N":""

32390 CALL KEY(0,K,S) :: IF S=0 THEN 32390 ELSE IF K<>89 THEN 32307

32400 DISPLAY AT(23,1):"":"" :: CALL DELSPRITE(#1)

32410 SUBEND

32420 SUB MEOW

32430 CALL SOUND(100,3400,0) :: FOR AA=3200 TO 1200 STEP-200 :: CALL SOUND(-50,AA,5) :: NEXT AA

32440 SUBEND

32450 SUB PAUSE

32460 FOR AA=1 TO 400 :: NEXT AA

32470 SUBEND

Edited by InfernalKeith
  • Like 1
Link to comment
Share on other sites

Sweet, will definitely give it a go later. And the nicest way to post code is with the CODE tags. You can insert them with the button that looks like HTML angle brackets. It even does some basic syntax highlighting.

 

80 DIM CATX(30),CATY(30),TOOL$(24),TOOLCOST(24)
90 RESTORE :: RANDOMIZE :: CALL CLEAR
99 CALL CHAR(139,"00183C3C7E7EFFFF",140,"FFFF7E7E3C3C1800",141,"C0F0FCFEFEFCF0C0",142,"030F3F7F7F3F0F03")
100 CALL CHAR(143,"FFFFFFFFFFFFFFFF",35,"040303837C7C44AA",37,"AA55AA55AA55AA55",40,"FFFFFFFFFFFFFFFF")
101 CALL CHARPAT(45,X$) :: CALL CHAR(94,X$) :: CALL CHARPAT(36,X$) :: CALL CHAR(61,X$)

 

That way it works no matter what user settings are.

 

Anyway, enough of that, on with the game, and congratulations on getting it in under the wire! :thumbsup:

Link to comment
Share on other sites

THAT was it. I knew there was some way to univerally do that, but I was a sleep-deprived moron at the time.

 

Anyway, here's a zipped version of the file if you'd rather download than paste. It should run just fine on either a stock TI 99/4A or in Classic99.

 

 

 

 

 

Sweet, will definitely give it a go later. And the nicest way to post code is with the CODE tags. You can insert them with the button that looks like HTML angle brackets. It even does some basic syntax highlighting.

 

80 DIM CATX(30),CATY(30),TOOL$(24),TOOLCOST(24)
90 RESTORE :: RANDOMIZE :: CALL CLEAR
99 CALL CHAR(139,"00183C3C7E7EFFFF",140,"FFFF7E7E3C3C1800",141,"C0F0FCFEFEFCF0C0",142,"030F3F7F7F3F0F03")
100 CALL CHAR(143,"FFFFFFFFFFFFFFFF",35,"040303837C7C44AA",37,"AA55AA55AA55AA55",40,"FFFFFFFFFFFFFFFF")
101 CALL CHARPAT(45,X$) :: CALL CHAR(94,X$) :: CALL CHARPAT(36,X$) :: CALL CHAR(61,X$)

 

That way it works no matter what user settings are.

 

Anyway, enough of that, on with the game, and congratulations on getting it in under the wire! :thumbsup:

Herding Cats.zip

Link to comment
Share on other sites

I get this message in Classic99 when using the downloaded file:

 

* MEMORY FULL IN 32460

 

Do I need to adjust a setting in the emulator perhaps?

 

 

Ah, crap. Just delete line 11070. I fixed that in the listing I put up online, but then didn't save the corrected listing before exiting Classic99.

 

I should get more sleep. :)

Link to comment
Share on other sites

Check the posting above -- a few lines get truncated in the pasting process, and have to be manually fixed. I recommend pasting it into Wordpad, then copying that into Classic99. There are four lines (I think) listed above that need fixed if you go the cut-and-paste route.

 

 

 

 

 

* SUBPROGRAM NOT FOUND IN 104 :(

 

I probably screwed something up. The emulator beeped at me several times during the PASTE, so I expect I fouled something up in there.

Link to comment
Share on other sites

Completely funktamonius! Looking forward to giving this a blast.

 

Hey, hope you don't mind me pointing something out:

 

You see all those DATA statements:

 

11010 DATA "NICE AND EASY",250,10000,0,0,0,6,15,15
11020 DATA " ","$ $"," "," %%%%%%%%"," % %"
11030 DATA " % %"," % %"," % %"," % %"
11040 DATA "$ % % $"," % %"," % %"," % %"," % %"
11050 DATA " %%%%%%%%"," "," ","$ $"," "
11060 DATA 5,8,5,15,5,17,5,19,6,14,7,19,8,14,9,19,10,14,11,19,12,14,13,19,14,14,14,16,14,18
11100 RESTORE 11110 :: RETURN
11105 REM LEVEL 4
11110 DATA "A BRIDGE TOO FAR",400,32000,0,0,0,6,27,20
11120 DATA "$$$$$$$$$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$ "," $$$$$$$$$$$$$$$$$$$$ "
11130 DATA " $$$$$$$$$$$$$$"," $$$$$$$$$$$"," $$$"," "," "
11140 DATA " $$$$"," $$$$$$$"," $$$$$$$$$$$$"," $$$$$$$$$$$$$$$$"," $$$$$$$$$$$$$$$$$$$"
11150 DATA " $$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$$","$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
11160 DATA "$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
11170 DATA 4,1,5,5,6,3,7,6,7,13,8,2,8,5,8,7,9,1,9,14
11180 DATA 10,3,10,5,10,7,11,7,12,1,12,4,13,7,14,2,16,1,14,5
11190 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
11200 RESTORE 11210 :: RETURN
11205 REM LEVEL 5
11210 DATA "WALL MANIA",750,38000,0,0,1,7,13,30
11220 DATA " % % %%% "," % % $ % $ %"," %% %%%","% %"
11230 DATA " %%%","$ % %%%%% $ %%%%","$ % % % %","$ % % %%% %"
11240 DATA "$ % $ % %"," % %% %%%%"," % % % $"," % %% % %$"
11250 DATA " %%% % % %$ % %"," %% % %$ % %"," % %%%%%%$"," % %$"
11260 DATA "$ % % $ %$ % %"," % %%%% % %"," %%% $ % %%%%"
11270 DATA 1,11,1,12,1,13,1,14,2,25,2,26,4,4,4,5,4,8,4,9
11280 DATA 7,17,8,17,9,17,7,28,7,29,9,21,9,22,11,26,11,27,14,21
11290 DATA 18,27,18,28,19,22,19,23,18,7,13,9,14,1,15,4,12,5,12,6
11300 RESTORE 11310 :: RETURN
11305 REM LEVEL 6
11310 DATA "SNAKE THE TRAP",600,42000,1,1,0,1,29,25
11320 DATA " %%%%%%%%%%%%%%%%%%%%$$$$"," % %$$$$","$ % %%%%%"," % %"
11330 DATA " % %"," % % $"," %% % % %"," % % % %"
11340 DATA " % % $ % % %"," % % % % %"," % % % % %"," % % % % %"
11350 DATA " % % % % %"," % $ % %"," $ % % $ %"," % % %"
11360 DATA " % % %"," % % %"," %%%%%%%%%%%%%%%%%%%%%%%%%"
11400 RESTORE 11410 :: RETURN
11405 REM LEVEL 7
11410 DATA "V FOR VICTORY",500,48000,0,0,0,12,15,22
11420 DATA "% %"," % %"," % %"," % %"
11430 DATA " $ % % $"," % %"," $ % % $"," $ % % $"
11440 DATA " $ $ % % $ $"," $ % % $"," $ $ % % $ $"," $ $ % % $ $"
11450 DATA " $ $ $ $ $ $"," $ $ $ $"," $ $ $ $ $ $"," $ $ $ $"
11460 DATA " $ $ $ $ $ $"," $ $ $ $"," $ $ $ $ $ $"
11470 DATA 1,4,1,29,2,5,2,28,3,6,3,27,4,7,4,26,5,8,5,25
11480 DATA 6,9,6,24,7,10,7,23,8,11,8,22,9,12,9,21,10,13,10,20
11490 DATA 11,14,11,19
12000 RESTORE 12010 :: RETURN
12010 DATA "MIND THE HOLES",400,20000,1,0,0,11,24,20
12020 DATA " %%"," %% $ $"," $ %%"," %%"
12030 DATA " $"," $"," %% %%"," %% %%"
12040 DATA " %% %%"," %% %%"," "," $"," %%"," %% $"
12050 DATA " %%"," $ %%"," $"," $"," "
12100 RESTORE 12110 :: RETURN
12110 DATA "WRONG SIDE OF TRAX",400,26000,0,0,1,6,3,15
12120 DATA " $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"
12130 DATA " $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," % $ $ $ $ $ $ $"
12140 DATA " %% $ $ $ $ $ $ $"," %%%%%% $ $ $ $ $ $ $"," %% $ $ $ $ $ $ $"," % $ $ $ $ $ $ $"
12150 DATA " $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"
12160 DATA " $ $ $ $ $ $ $"," $ $ $ $ $ $ $"," $ $ $ $ $ $ $"
12170 DATA 2,10,3,5,3,13,4,8,4,12,9,12,14,9,17,4,17,13,18,7,3,19,8,30,10,22,16,20,19,29
12180 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

 

You can save a TON of memory if you make those integers strings!

 

Yeah, I know, sounds crazy, but the TI stores all integers in memory as *8* (I know!) byte floating point numbers. Sad, but alas, true.

 

If you make them strings, you save memory.

 

So, in memory:

 

DATA 0,0

Would be about 18 bytes

But DATA "0","0" would be about 6 bytes - What's that? 66% saving?

 

You can convert your data back to integers dynamically, as you read it with the READ statement:

 

READ DATA$

VALUE=VAL(DATA$)

 

Value is now an integer version of the string version. Nice.

 

Of course, you pay a speed penalty for the conversion, but since this is the level data, used to draw the levels, and not part of the game loop, you can live with that. You won't notice much slow-down anyway...

 

Hope that helps. You might be able to squeeze a couple of extra levels into the game...

 

[ Note to others: The same works with arrays. If you need an array of 200 numbers, declare it as an array of 200 strings, and store your numbers as strings in the array, and convert them when you read them out... Saves memory both at the source code level, and at run-time, the penalty being speed... There's always a penalty :cool: )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...