Has anyone translated any of the C++ programs here:
http://code.google.com/p/ruletablerepos ... /trunk/src
into Java?
Brian Prentice
Rule Tables
Re: Rule Tables
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
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
Re: Rule Tables
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
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
Re: Rule Tables
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!
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!
Re: Rule Tables
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.
Re: Rule Tables
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
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