From: tinywanda@aol.com (TinyWanda)
Newsgroups: comp.sys.hp48
Subject: Evolve This...!
Lines: 165
NNTP-Posting-Host: ladder07.news.aol.com
X-Admin: news@aol.com
Date: 19 May 1999 07:16:58 GMT
Organization: AOL http://www.aol.com
Message-ID: <19990519031658.11102.00002474@ng-fr1.aol.com>
Xref: republic.btigate.com comp.sys.hp48:24972

Evolve This!

An HP48 Program by The BabyNous Cult      May 17th  1999

i've had this idea for a long time of creating a program that would somehow
emulate the process of evolution...???

The idea in it's various conceptual forms was to allow a computer to create a
picture while humanimal(s), Acting as the force of nature...or the statistical
chance of survival, Would determine which elements of the picture would survive
and which would die off.

Then--A psychological facet would become active...As the humanimal controller
picks surviving elements over and over again, Working with psuedo-random
forces, The picture would begin to resemble graphical iconography that the
controller subliminally projects onto the evolutionary image. (?)

Well...that's what i was thinking...
Regretfully, The resolution on the 48 may be the restrictive factor that makes
the subliminal image all the harder to pick out...??? (!)

Anyways--
This is how the program works:

The Directory consists of 4 Objects

Start   The Evolutionary Program
Save    Saves PICT
Dot     Returns a graphical morsel
PPAR    Plot Parameters

'Start' may take either the GROB from Save, which was automatically saved when
you quit your last session with Evolv, or nothing on the stack, in which case,
a new PICT template is created.

---------------:: <
As a technical note:
This bit of programming requires a small amount of cleverness, As the program
is asking 3 questions;
1) Is there anything on the Stack?
2) If there is something on the Stack, what is it?
3) If there isn't anything on the Stack, what should i do?
Included in question (2) is the additional question, Is it the kind of thing
that i'm looking for & is that it...?
The solution i used was this:
DEPTH << DUP TYPE >> 99 IFTE 11 ==  << Yes >> << No >> IFTE
Since i was looking for a GROB ( TYPE 11 ), 
The routine first asks if there is anything on the Stack, 
If there is, Then it TYPEs it, 
If there isn't anything on the Stack, 
Then it returns a 99--as a generic solution...
Since there are no Type 99's...
Thus, No matter what i'm checking for, It would be equivalent with it not being
there...!
Then it continues with the program solution for a GROB or NoGROB.
---------------:: <

Once the program starts, It delineates two pictorial regions, And adds a
graphical element to each, You then pick one or the other, Or neither.
If you pick neither, Another graphical element will be added to both.
If you pick one over the other, Then the selected picture will be copied over
to the other side, And the process begins over again.

Once it gets going you hit either the first 3 White Keys; A, B or C, to select
the image on the left side, 
Or the latter 3 White Keys; D, E or F, to select the image on the right side.
How you choose which image is entirely up to you. 
Choose it for it's aesthetic balance, or because it looks like something...?
If you hit any key other than the White Keys...
Except for the DEL, BACK or ON Keys, Which will terminate the program,
...All the other Keys will add graphical elements to both sides of the
Evolutionary palettes without killing one side off.

After allow several hundred generations to be born, struggle and die...
You might want to allow your therapist to see the results.


Directory Name:    Evolv
Checksum:        # F818h
Size:               1178
 
%%HP: T(3)A(D)F(.);
DIR
  Start
    \<< DEPTH
      \<< DUP TYPE
      \>> 99 IFTE 11
==
      \<< PICT STO
      \>>
      \<< ERASE {
# 0d # 0d } { # 64d
# 63d } BOX { # 66d
# 0d } { # 130d
# 63d } BOX
      \>> IFTE { # 0d
# 0d } PVIEW
      DO { # 0d
# 0d } { # 66d # 0d
} 0 1
        START Dot \->
\183 \pi
          \<< RAND
RAND 2 \->LIST { 64
64 } \pi B\->R - * CEIL
R\->B ADD PICT SWAP \183
{ GXOR GOR } RAND 2
* CEIL GET EVAL
          \>>
        NEXT
        DO
        UNTIL KEY
        END \-> \162
        \<< { 0 54 55
} \162 POS
          \<< PICT
RCL 'Save' STO 1
          \>>
          \<< { 1 2 3
4 5 6 } \162 10 - POS
            \<< PICT
{ { { # 0d # 0d } {
# 64d # 63d } } { {
# 66d # 0d } {
# 130d # 63d } } }
\162 10 - 3 / CEIL GET
EVAL SUB PICT {
# 0d # 0d } 3 PICK
REPL PICT { # 66d
# 0d } ROT REPL 0
            \>> 0
IFTE
          \>> IFTE
        \>>
      UNTIL
      END
    \>>
  Save 0
  Dot
    \<< {
GROB 7 7 C1E3F7F7F7E3C1
GROB 7 7 F7F7F7F7F7F7F7
GROB 23 23
00F7000CFF100EFF308FFFF08FFFF0CF1CF1E700F3E300E3F300E7F100C7F100C7F100C7F1
00C7F100C7F300E7E300E3E700F3CF1CF18FFFF08FFFF00EFF300CFF1000F700
GROB 15 15 0E308FF0CFF1EFF3EFF3FFF7FFF7FFF7FFF7FFF7EFF3EFF3CFF18FF00E30
} RAND OVER SIZE *
CEIL GET DUP SIZE 2
\->LIST
    \>>
  PPAR {
(-6.5,-3.1)
(6.5,3.2) X 0 (0,0)
FUNCTION Y }
END





----------- :: o
.---..-..-..-..-..-..-.  .  .-. .-.  .-..-..-..   .-.  
`| |'| || .` | >  /  \ \/ \/ / /   \ | .` || | ) /   \ 
 `-' `-'`-'`-' `-'    `. ^ .' `--^--'`-'`-'`-'' `--^--'
 The Essence Of Life Is Being Aware That We Are Robots.