Rule Tables

For general discussion about Conway's Game of Life.
Post Reply
bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Rule Tables

Post by bprentice » May 17th, 2013, 7:35 am

Has anyone translated any of the C++ programs here:

http://code.google.com/p/ruletablerepos ... /trunk/src

into Java?

Brian Prentice

EricG
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: Rule Tables

Post by EricG » May 17th, 2013, 2:22 pm

Hi Brian,

Depending on what you're doing, you might find RuleTreeGen.java to be a useful Java substitution for the make-ruletable.cpp program listed at the ruletablerepository. Both programs take a little snippet of code which algorithmically describes how a CA should work, and converts it into a format Golly can use. RuleTreeGen.java, along with Pearl, C++, and Python equivalents are distributed with Golly here: Golly-2.4/Rules/TreeGenerators. Also see make-ruletree.py in the scripts folder. Sorry if this is old news, or if it is not what you were after. -- Eric

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Rule Tables

Post by bprentice » May 17th, 2013, 7:06 pm

Eric,

I should have been more specific. I would like to explore some of the interesting rules that are defined as Golly .table files using my Java software. A good example is Pteriforever's new rule aurora19. This requires the conversion of files read_ruletable.cpp and ruletable.cpp to Java. Since some members of this forum write Java programs, for example the excellent game Seeds of Destruction, I thought I would ask if this conversion had already been done before attempting to do it myself.

The program RuleTreeGen.java will be useful, thanks.

Brian

EricG
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: Rule Tables

Post by EricG » May 17th, 2013, 7:39 pm

Heh, I was wondering which direction you were converting.

Please don't laugh, but here's a half-thought-out idea: I wonder if it would be easier to first convert the tables to trees using RuleTableToTree.py. Of course the code you want is already written in C++ and you just have to rewrite it in Java. But sometimes it is a lot more fun to write code from scratch, and if I was going to write the code from scratch, I think I'd rather interpret Golly's ruletrees than Golly's ruletables, so that I didn't have to deal with variables. Just a thought!

EricG
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: Rule Tables

Post by EricG » May 17th, 2013, 8:23 pm

My previous post was about the general case. At the risk of belaboring the obvious, I just want to add my personal experience. I occasionally do the same kind of ruletable conversion you are interested in, for my own CA program, and each time, instead of writing a general converter, I've found it easier to just read through the ruletable and understand the logic, and then encode the logic by hand in a short algorithm. But it might be that I've found it easy only because I'm attracted to rules which have a pretty simple underlying logic, despite the sometimes ugly way that logic must be expressed in ruletable format.

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Rule Tables

Post by bprentice » May 18th, 2013, 7:25 am

Eric,

Thanks for the useful suggestions. Were you able to convert my Rule 005 described here:

viewtopic.php?f=11&t=967#p7290

to run on Golly?

Brian

Post Reply