[Self-interest] programs (was: goals for Self)

Jecel Assumpcao Jr jecel at merlintec.com
Wed Aug 11 15:14:50 UTC 2021


Steve Dekorte wrote on Sat, 7 Aug 2021 18:25:04 -0700
> Thanks Jecel. Here?s an english version (via Google translate).
> 
> [Guidelines for a New Digital Design Methodology.pdf]

Wow, thanks! It looks very readable. You do need the original for the
figures, but the current automatic translation is better than previous
efforts I had seen.

When we started getting translated books on programming in Brazil in the
early 1980s I would always check whether they also translated the
program listings as well. This would frustrate any readers who tried to
type in the programs.

I remembered two more trivial Self programs I wrote and which might
still exist in my Sun Ultra 5's disk. The first was a very simple
presentation like what Russell did in his talk. The difference was that
in mine you would spread your slides throughout Kansas and tag their
location with a small modified CircleMorph (so it was Prezi-like and
more like Russell's "stations"). The right arrow would take you to the
next slide and the left arrow to the previous one with Kansas providing
the animation. You could reorder the slides and give each one a
duration. As you presented the color of the circles would indicated if
you were going too fast or too slow.

This was for a talk I gave at SelFest 2000. Back then my town had a
month long series of events called OktoberTech (in contrast with the
German based Oktoberfest celebrated in towns further south in Brazil):

http://www.merlintec.com/selfest/e_index.html

It was harder to get the word out in those days so only three people
showed up. It was very hard to get video projects, so I took my Ultra 5
connected to my Linux computer running X11 which had an ATI video card
with NTSC output and connected that to a 29 inch TV set.

Another program was a response to a guy who insisted that I only was
using Self in my children's computer project because I didn't know
Prolog. Instead of an abstract discussion I just wrote the same program
twice (in Prolog and in Self) to show him the difference. They solved
the Peg Solitaire puzzle.

https://en.wikipedia.org/wiki/Peg_solitaire

The Prolog version took be about one minute to write, but I didn't test
it since I didn't have an implementation of that language in any of my
machines. I doubt there were any serious bugs in it, but using the
standard Prolog evaluation algorithm it is quite possible that it would
take millions of years to print out the solution as the search space is
pretty large. I defined the relation peg(Board, Remaining, Moves) and
given peg(initialBoard, 32, []) and some simple transformation rules you
could ask for peg(WinningBoard, 1, WinningMoves). I am probably
remembering the capitalization of things wrong.

For the Self version I started with a nice big gray Morph and added 33
redish CircleMorphs to it creating a visual representation of the board.
Then I changed the circle so that clicking on them would draw (or hide)
a smaller yellow circle inside of it and the game could now be manually
played. Then I changed it to know what the valid moves are and a way to
play automatically at random.

I created a little bezeled rectangle to represent a particular game with
a label showing how many pegs would be left at the end. Dropping the
game on the board would allow you to step through an animation of that
game. Finally I created a genetic algorithm to evolve an initial
population of games into one with at least one winning combination.
After seeing that it was going to take a very long time to finish I
changed the algorithm to mix the "genes" from pairs of games (I added
sex) and this second attempt gave results in about six hours on the
Ultra 5 (21986 generatiions):

http://www.merlintec.com/download/pegs.gif

The Self version took me about 12 minutes to write in constrast to just
one minute for Prolog, but which one would children find the more
interesting one?

-- Jecel


More information about the Self-interest mailing list