HTML/JS HELP NEEDED: Isotropic non-totalistic rulestring generator

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
muzik
Posts: 5614
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

HTML/JS HELP NEEDED: Isotropic non-totalistic rulestring generator

Post by muzik » April 23rd, 2021, 5:14 am

Since I've decided it's probably time to start giving back to the community rather than constantly demanding from it, here's a disgustingly rudimentary rulestring generator for the common INT rulespace:

https://muzikbike.github.io/projects/ca ... moore.html

This was mainly done as a proof of concept and a super basic learning experience for javascript, as the output is clearly nowhere near usable without far too much manipulation (removing newlines, etc.) and doesn't support the common - negation. Not to mention that the javascript used is a complete mess - you programmers are probably all laughing your asses off at my painfully recursive generation method. I plan to eventually have it output the resulting string into a text box, and also have that text box be an input box which changes the checkboxes accordingly, but I have absolutely no idea as to where to start on that, so any pointing in the right direction would be appreciated.

My main priorities/questions are as follows:

- Are there any optimisations that can be made to the current javascript?
- How would I implement the - negation? How can I detect when there are too many transitions, and then only use the ones that specifically aren't selected?
- How exactly would I go about reading info from the checkboxes, and then how would I go about having the output be placed into a text box? This would probably require the press of a button rather than having the text box be dynamically updated.
- Then how would making that text box work as an input work? How would I, after validating it, read the rulestring and set each box to checked or unchecked accordingly?
- Is there any way I can include a LifeViewer embed (always of the latest version) at the bottom, which would use the generated rule?

Anyway, I consider this thing to at least be a start.
Last edited by muzik on April 23rd, 2021, 9:17 am, edited 1 time in total.

User avatar
muzik
Posts: 5614
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: HTML/JS HELP NEEDED: Isotropic non-totalistic rulestring generator

Post by muzik » April 23rd, 2021, 8:41 am

I've updated this to v0.0.3 and rulestrings are now added to a text box rather than displayed directly on the page horribly. The code to do it is still a mess, though, and I welcome advice from anyone who actually knows what they're doing.

User avatar
yujh
Posts: 3066
Joined: February 27th, 2020, 11:23 pm
Location: I'm not sure where I am, so please tell me if you know
Contact:

Re: HTML/JS HELP NEEDED: Isotropic non-totalistic rulestring generator

Post by yujh » April 23rd, 2021, 9:27 am

Probably a place to input rulestring (or directly put a lifeviwer out there?)
Rule modifier

B34kz5e7c8/S23-a4ityz5k
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
B3-kq4z5e7c8/S2-ci3-a4ciq5ek6eik7

Bored of Conway's Game of Life? Try Pedestrian Life -- not pedestrian at all!

User avatar
muzik
Posts: 5614
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: HTML/JS HELP NEEDED: Isotropic non-totalistic rulestring generator

Post by muzik » April 23rd, 2021, 1:20 pm

v0.0.11 is now live:
- rulestring generation should now always produce the canonical form
- a link to Catagolue is also generated alongside the rulestring
- detection of the presence of transitions is now more efficient

Again, don't think I've implemented any of this optimally. Keep in mind that this project is entirely open source, so if you know how to make my laughably bad code better, go ahead.

Reading and decoding input rulestrings is up next.

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

Re: HTML/JS HELP NEEDED: Isotropic non-totalistic rulestring generator

Post by bprentice » April 23rd, 2021, 2:01 pm

Square Cell uses the following dialog to display and modify the Non Totalistic rule family parameters:

D.png
D.png (198.56 KiB) Viewed 1656 times

Brian Prentice

Post Reply