PARTY.BAS DMS Science Fair, May 1988. June 1997 by Marc Kummel aka Treebeard. Contact mkummel@rain.org, http://www.rain.org/~mkummel/ So you're planning a party? Treebeard's PARTY PLANNER will help! This program is a party simulator. A group of guests with well-defined likes and dislikes is invited and allowed to interact. The party is held in a room which measures 36x20 units. There is a refreshment table of munchies, as well as other objects of your choosing. Each guest starts at a certain place in the room and then mixes with the other party-goers. The assumption of this simulation is that there is an IDEAL SOCIAL DISTANCE that each guest would like to be from each other guest and from objects like the food table. Of course the ideals of the other guests may be quite different! As strict Utilitarians-but contrary to Jeremy Bentham-our guests choose to minimize unhappiness: consider all possible moves to adjacent positions and select the move that is least unpleasant. The complex dynamics of many party-goers all following the same principle are fascinating! To hold a party, you must provide: a list of guests (and optional occupations or stereotypes); a list of objects such as the refreshment table; a list of the ideal distances that each guest wants to be from each other guest and object; and the starting position in the room for each guest and object. Default data is provided. Planning an interesting party is a lot of work! ---------------------------------------------------------------------------- This is ancient code from the Vault circa 1987-8, inspired by A.K. Dewdney's Computer Recreations column in Scientific American, September 1987 (and reprinted in _The Magic Machine_ p.151). Dewdney credits the original idea to Richard Goldstein aka Rick Gold. I originally wrote this in QuickBasic 3.0 for a Hercules monochrome display. I've updated the colors, but tried to keep most of the code as was. I couldn't resist a few changes. (I added the Graph and Optimize options.) I'd do it differently today. This is real spaghetti code since it's all GOSUBs not procedures, and variables are all shared and not explicitly typed. There are too many variables, and there seems to be lots of duplicated code since it's easier to do it again than to figure out the interactions in what's already there. *Sigh* But it's still a pretty cool program, and I like the snappy way the menus work! It runs fine in QBasic. The program is easy to navigate. Options appear in menus or on the bottom line. Use the cursor keys to select and press , or just press the first letter of the command. Each party goer and object must have a name with a unique first letter. Selecting Random Party from the Main Menu is like inviting a group of strangers off the street and putting them in a strange room to mix. It's a good way to explore the dynamics. Interesting parties can be saved and loaded as *.PTY files. It would be interesting to map the party dynamics to MIDI sound. This program illustrates how complex dynamics can arise from simple rules. Like the classic Prisoner's Dilemma, it also shows how elusive happiness can be when we act on utilitarian principles. The files: PARTY.EXE DOS executable PARTY.PIF run PARTY windowed in Win3.1 PARTY.ICO a Win31 icon (swiped from ICOLIB) *.PTY a few sample party files README.TXT this file TBVAULT.TXT about Treebeard's Basic Vault ------------ PARTY5.BAS source code MAKE.BAT batch file to compile and link from DOS prompt This program and source code are yours to use and modify as you will, but they are offered as freeware with no warranty whatsoever. Give me credit, but do not distribute any changes under my name, or attribute such changes to me in any way. You're on your own! Send comments and fixes to: Marc Kummel aka Treebeard mkummel@rain.org http://www.rain.org/~mkummel/ For more interesting Basic software with source code, check out Treebeard's Basic Vault at http://www.rain.org/~mkummel/basic/