HTML/JS HELP NEEDED: Isotropic non-totalistic rulestring generator
Posted: 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.
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.