home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / fish / 911-930 / ff916 / wbrain / wbrain.doc < prev    next >
Text File  |  1994-05-04  |  14KB  |  295 lines

  1. *****************************************************************************
  2.  
  3.                                  WBrain v1.0
  4.                                  
  5.                                  02 AUG 1993
  6.  
  7. *****************************************************************************
  8.  
  9.                                  Index
  10.  
  11.             0 - General intro  
  12.             1 -   Game idea    
  13.             2 -  Installation   System requirements
  14.             3 -      Rules      Playing the game (Rules)
  15.             4 -   Legal crap   
  16.             5 -  Source code    About the source code
  17.             6 -    Bug list    
  18.             7 -     History     and future
  19.  
  20. *****************************************************************************
  21.  
  22.  0 - General intro
  23.  
  24.    Brain for the WorkBench.
  25.    This program is based on Brain, by Andre Wichmann.
  26.    WBrain takes no code from Brain, and is written entirely in Amiga_E.
  27.  
  28.    Amiga_E is a programming language by Wouter van Oortmerssen which
  29.    produces very small, fast code, and is designed to simplify the
  30.    creation of user interfaces.
  31.    
  32.    Brain v1.01 can be obtained from the Fred Fish PD disk #652.
  33.    Amiga_E v2.1b can be found on Fred Fish #848, or you can contact
  34.    Wouter by mail:
  35.       Wouter van Oortmerssen
  36.       Levendaal 87
  37.       2311 JG leiden
  38.       HOLLAND
  39.    or by EMail:
  40.       Wouter@alf.let.uva.nl
  41.       Wouter@mars.let.uva.nl
  42.       Oortmers@gene.fwi.uva.nl
  43.    
  44.    You can contact me only through snailmail:
  45.       Sean Russell
  46.       Claude-Lorrain-Str 31
  47.       81543 Mnchen
  48.       GERMANY
  49.  
  50.    See the Bug list, if nothing else (nothing disasterous)!!!
  51.  
  52. *****************************************************************************
  53.  
  54.  
  55.  1 - Game idea
  56.  
  57.    WBrain is short for Workbench Brain.  Brian is a game in which the player
  58. is given a randomly generated pattern which SHe must reproduce by choosing
  59. a correct order of moves.  WBrain is implemented in a WorkBench environment;
  60. this means that it opens a window which can be resized to determine the size
  61. of the playing field.  Moves are made by clicking on squares.
  62.  
  63.    The game is fairly simple after learning the general pattern rules; it is
  64. very low-stress but still requires some thought to complete.  Personally, I
  65. like the game because I can always solve it (if I think enough) without
  66. becoming too frustrated.  At the same time, the game is not so mindless that
  67. it becomes boring; there is always a little challange.
  68.  
  69.    Since the computer does not have to play against you, this program
  70. requires very little CPU time, and also very little memory.  As the author
  71. of the original Brain said, it is a good game for when you're doing
  72. something like compiling with a slow compiler or with a big program, or
  73. while generating fractals, or while ray tracing...
  74.  
  75. *****************************************************************************
  76.  
  77.  2 - Installation & system requrements
  78.  
  79.    WBrain requires the reqtools and gadtools libraries, of version 37 or
  80. greater.  I've also made the game unuable on OS<2.0x as a safety measure, 
  81. since I don't know if it would run on anything less.  Sorry.  I won't tell
  82. you that you should buy OS2.0 since you probably already know that by now;
  83. half the PD stuff out there these days won't run on 1.3 or 1.2 anymore.  If
  84. you don't have 2.0 yet, I can only assume that you either don't have enough
  85. money or motivation to upgrade; in the first case I can't help you, and in
  86. the second case that's your own problem.  If you are the unfortunate
  87. possessor of an A1000 (for which you require more than $400 to upgrade to
  88. 2.0), buy an A600 instead: it's cheaper than upgrading.  Or better yet, buy
  89. an A1200, which is also an unreasonably good deal.
  90.  
  91.    I've wandered from the topic of this section.  To install, simply copy
  92. reqtools and gadtools into libs: (if they aren't already there).  This
  93. program uses topaz 8 as it's font, so that must also be in the fonts:
  94. directory.  Unless you've deleted it, it should be there as it comes with
  95. all versions of WorkBench.  You need to have a 3 bitplane screen going; this
  96. is 8 colors.  I imagine you could launch this onto about any public screen
  97. if you wanted to, but I wrote it with the WorkBench in mind.  Double click
  98. on the WBrain icon to start the program and you're off.  Or if you're a
  99. fanatical icon hater, launch it from a CLI; I couldn't care less.
  100.    You can also install this by double-clicking on the InstallMe! icon.  This
  101. launches the Commodore "Installer" program, which comes with WB2.0 or
  102. greater.  I've included that program in the package as well, but it will
  103. have been deleted if it's not freely distributable.
  104.  
  105.    The programs included in this release are:
  106.       WBrain         (The program)
  107.       InstallMe!     (The installation script)
  108.       WBrain.guide   (The AmigaGuide format documentation)
  109.       WBrain.doc     (The text format documentation)
  110.       installer      (hopefully; the Commodore install program)
  111.       WBrain.e       (The Amiga_E sourcecode)
  112.       libs
  113.          gadtoolsbox.library
  114.          reqtools.library
  115.    The total space for these files is 375 blocks.
  116.  
  117. *****************************************************************************
  118.  
  119.  3 - Playing the game (Rules)
  120.  
  121.    Start the game (by double clicking on the icon, or from a shell).
  122.    The rules are simple: your goal is to make the left hand grid look like
  123. the right hand grid.  There are three game level, which determine the
  124. difficulty of play.
  125.    Level 0: When you click on an empty square, a 1 appears there.
  126. If there are any numbers in neighboring squares (these are the 4 squares up,
  127. down, right, and left of the target square), 1 is added to the number in that
  128. square.  If a square is 4 and one is added to it, it becomes a 1 again.
  129.    Level 1: Same as level 0, only all eight neighbors are effected by adding
  130. a new box.
  131.    Level 2: Same as level 0, but now neighbors two square away in the four
  132. primary directions are affected.
  133.    Level 3: Same as level 1, but now all neighbors in a range of 2 squares in
  134. all directions are affected.
  135.  
  136.    The window contains (in addition to the two grids) three buttons, one
  137. slider, and three text boxes, which have the following functions:
  138.  
  139.    Undo - Take back the last move.  The Undo function remembers all of your
  140.           moves, which means you could back up to the beginning from the end
  141.           if you wanted to.
  142.    Retry - Start over with the same goal grid from the beginning.  This is
  143.            the same as Undo-ing back to the beginning.
  144.    New - Make a new goal
  145.    Slider - Changes the game level
  146.    Rows : - Number of rows in each grid
  147.    Colms: - Number of columns in each grid
  148.    Level: - The current game level
  149.  
  150.    In addition are the standard zip, close, and back gadgets, and the size
  151. gadget.  WBrain will produce the largest grids it can in the window you have
  152. sized.  The starting dimensions are 8x8; I suggest the first time you play
  153. you reduce this to 5x5 or less.  The largest size is 10x10, the smallest is
  154. 2x4.  Every time you resize the window, a new goal will be produced.  There
  155. are also two boxes under the gadgets telling you what the dimensions of the
  156. grids are, in columns and rows.
  157.  
  158.    When the right grid has the same configuration as the left, a window will
  159. appear telling you that you have won the game.  If you fill all the square
  160. and no such window appears, check your grid, because somewhere you've made a
  161. mistake.
  162.  
  163.    The menu contains two sections, Project and Game.  The project menu
  164. contains the usual Info and Quit options, and the game menu contains copies
  165. of the window buttons Undo, Retry, and New.  These can be chosen by hot-key
  166. (RAmiga-u, RA-r, and RA-n, respectively).  The game can be quit over the
  167. menu, the hotkey RAmiga-q, or by sending a Ctrl-C break to the program
  168. (for example, through ARTM or similar program, or if you started the
  169. program from a shell).
  170.  
  171. *****************************************************************************
  172.  
  173.  4 - Legal crap
  174.  
  175.    This program is Selfish-Ware: you can do anything with it you like, but
  176. you can't make any money from it, aside from a reasonable duplication fee.
  177. By "reasonable" I mean up to two US dollars.  This mostly applies to those
  178. immoral characters who like to take advantage of us generally selfless
  179. programmers and market other people's software without providing due
  180. compensation.  PD collections, such as Fred Fish and SAAR-AG-PD are hereby
  181. granted permission to do whatever they want with WBrain; this includes
  182. distribution and the making of money thereof (to support their endeavors).
  183.  
  184.    Use and abuse the sourcecode as much as you want, but if you add a
  185. virus to it, you'll earn an eternity of bad-karma.  I'd also appreciate
  186. it if you  mention me somewhere (in small print) in the Info block of your
  187. modified program.
  188.  
  189.    If you really want to do a good deed, or just want to do me a
  190. favor for providing you with something you like, then subscribe to the Fred
  191. Fish collection.  You'll be doing yourself a favor as well.  SAAR-AG-PD is
  192. also a good collection, but I think it's a reasonable choice only if you
  193. live in Germany.
  194.  
  195.    The mandatory disclaimer: I make no claims that this program won't bomb
  196. your system, burn out your roms, start World War III, or do any other nasty
  197. things.  I also take no resposnibility if you use this program to crack into
  198. the NSA databanks or give Bill Clinton a bad credit rating.  On the other
  199. hand, if any of this stuff happens, drop me a letter so that I can brag about
  200. it in the next version.
  201.  
  202.    An aside note:  What I've really become sour to lately is people who
  203. expect you to send them money for their shareware package while at the same
  204. time not guaranteeing that it wont reformat your harddrive when you're not
  205. looking.  Requests for money, suggestions of food gifts, and desperate pleas
  206. for contact are one thing, but "crippled"-until-you-pay-but-no-guarantees
  207. software is revolting.  Yea, programmers deserve a little compensation for
  208. what they provide us with, but like I've always said:
  209.  
  210.       *Real* programmers code for the love of programming.
  211.       Anything else is prostitution
  212.  
  213. (Don't let that stop you from sending me your recent inheritance in
  214. gratitude =-)
  215.  
  216.    "This little thingy is ofcourse FreeWare, but if you REALLY like it,
  217.     you can send me your sister as payment."
  218.                                 -Arthur Hagen
  219.  
  220. *****************************************************************************
  221.  
  222.  5 - About the source code
  223.  
  224.    If you want to change this code, I suggest the first thing you start with
  225. are the variable names.  In my personal programs, I tend to make local
  226. variable  names rather short and ambiguous, since my routines are usually
  227. pretty short and it's not that hard to remember what the variables stand for.
  228. On the other hand, that practice is considered "bad programming," ranking up
  229. there with using 'goto's.  Don't do it if you want to pass your CIS class.
  230.  
  231.    I don't know how much this conforms to the Commodore guides, but since
  232. it's such a small program, I couldn't have strayed too far.  It's fairly
  233. multi-tasking friendly, with a WaitTOF in the main loop, and it doesn't do
  234. too much more than wait for input anyway.
  235.  
  236.    I didn't program this in C, for two reasons:
  237.    1) I did more work trying to install GCC and getting it to run correctly
  238.       than I did programming.  One of these days I'll buy a commercial
  239.       version...
  240.    2) It would have been overkill.  The game consists mostly of GUI and other
  241.       graphics stuff; these functions are usually the only ones that need
  242.       to be changed in porting.  Also, I'm a firm believer in the dogma that
  243.       the best tool to use is the easiest one that gets the job done.
  244.       Amiga_E is not only the easiest for interfaces for the Amiga, it also
  245.       produces very compact, fast code.
  246.    Enough said.
  247.  
  248.    One of the bad things about Amiga_E v2.1 (or perhaps I just missed
  249. something somewhere) is the inability to easily define (and manipulate)
  250. multi-dimensional arrays.  You'll notice this if you look at the code.  I
  251. had to make an array of pointers to an array.  Normally, this wouldn't be
  252. so bad, but to access this array we can't simply say k:=t[5].h[6]; we have
  253. to say g:=t[5].h and then k:=g[6].  Ah well.  Aside from that, programming
  254. in E is a dream.
  255.  
  256. *****************************************************************************
  257.  
  258.  6 - Bug list
  259.  
  260.    None that I know of.
  261.    Er, uh... due to the way the Amiga_E Rnd() routine works, every time you
  262. start the program, you will get the same series of random numbers.  Although
  263. this is inconvenient, resizing the window a couple of times and pressing
  264. the New button a few times more will ensure that you get a somewhat original
  265. Goal grid.  In the next release I'll bind this routine to the time and date,
  266. and get a real random number.  Sorry, but I was just too lazy to do it for
  267. this version.
  268.  
  269. *****************************************************************************
  270.  
  271.  7 - History & future
  272.  
  273.    Rather short history, I'm afraid...
  274.  
  275.    Version 0.0 - Not released.  Window resizing was inconvenient and GURUed
  276.                  my machine routinely.
  277.  
  278.    Version 1.0 - ° Resizing revamped
  279.                  ° Grid size displayer added
  280.                  ° Buttons moved to the left of the goal grid
  281.                  ° Made multitasking friendly.
  282.    Version 1.2 - ° Levels 1-3 added.
  283.  
  284.    Future:
  285.           ° Add a timer and scores.  This will be disablable to maintain a
  286.             lowest possible CPU usage rating.
  287.           ° Add locale support for other languages (As I'm an American
  288.             living in Germany it's appropriate that this is high on my
  289.             list. =-)
  290.           ° Make font sensitive (not likely)
  291.           ° Fix the random routine (I'll probably do that tomorrow)
  292.  
  293. *****************************************************************************
  294.  
  295.