Reasoning Realm

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
Posts: 290
Joined: April 9th, 2016, 7:22 pm

Reasoning Realm

Post by blah » August 1st, 2016, 6:50 pm

(Edit: What follows is an old post. To use reasoning realm, go here. (thanks to Jack Eisenmann for the hosting))

This is my html5 CA program I've been developing for a while that I use for Logic Land, though it can also run lifelike and generations rules.

It is nowhere near as optimised as something like LifeViewer, of course, but it has some optimisations. Like an algorithm I came up with (I'm sure others have come up with it as well) which only computes the cells that are changing, and ignores stationary things like empty space.

It originated as an attempt to make my own Logic Land implementation, because I thought Jack Eisenmann's one was kind of gay. That's really what it still is, though it runs other rules too as I mentioned.
I guess I can't rename it now?
I guess I can't rename it now?
thefuckingprogram.png (33.12 KiB) Viewed 8299 times
It consists of a canvas, which can be moved around by the user, and various html/css interfaces. It was originally going to be purely a canvas but I realised that's not really a good idea.

I declare that it's free software or whatever. The source code is the program itself; it is a single .html file. And that single .html file is 57 KB, so I'll put it here.

To run the program, copy that paste into a .html file and run it.

Feel free to look through the source code and comment on bad decisions I've made. Also don't always trust the comments, I just realised plenty of them are wrong, like line 138. I think.

Sorry, I should've slept an hour ago.
Last edited by blah on May 27th, 2018, 6:28 pm, edited 6 times in total.

User avatar
Posts: 504
Joined: September 17th, 2014, 12:21 am
Location: California, USA

Re: Reasoning Realm

Post by biggiemac » August 1st, 2016, 9:11 pm

Line 1292 though..

I honestly only clicked because you mentioned "bad decisions you've made" and I'm always curious to see others' coding styles. Now I'm some parts amused and frightened.
Physics: sophistication from simplicity.

User avatar
Posts: 1664
Joined: December 3rd, 2015, 4:11 pm
Location: creating useless things in OCA

Re: Reasoning Realm

Post by drc » August 1st, 2016, 10:22 pm

Last edited by drc on August 2nd, 2016, 2:20 pm, edited 1 time in total.

User avatar
Posts: 290
Joined: April 9th, 2016, 7:22 pm

Re: Reasoning Realm

Post by blah » August 2nd, 2016, 6:19 am

About line 1292, that's actually a valid thing to point out. Reasoning Realm was developed with a userbase of 2 people, me and my friend. We both liked the incredibly profane error message, but as a program that's supposed to be publically available it makes sense to change it, which I will.

I should've mentioned in the OP that the reason I'm actually posting this is because of Logic Land; the ruleloader imeplementation just doesn't, and can't really, work. But I'll talk about that in the Logic Land thread.

If anyone actually runs the program, I should also say that it has two savecode boxes with their own 'set' and 'get' buttons. Logic Land savecodes, and RLE savecodes. Use the RLEs; Logic Land savecodes are the weird savecode system Jack Eisenmann came up with, included for compatibility. I don't really need it anymore but some of my old saves still use that format.

User avatar
Posts: 290
Joined: April 9th, 2016, 7:22 pm

Re: Reasoning Realm

Post by blah » July 2nd, 2017, 4:23 pm

Somebody asked for it, so here's Reasoning Realm version 0.3.0, the last version I made before basically giving up on it.

Here's the changelogs I wrote for the versions since v0.2.0, the last version I posted:

  • Added Wireworld rule
  • Now it says "Gullible" if you enter the konami code. Try it!
  • Added Rychládrát, an experimental rule which has instant wire.
  • Removed some profanity
  • Key presses are now properly captured by textboxes.
  • Fixed bug where changing the rule to one with n states caused errors which halt the program if there is a cell with state x>n
  • Rotate tool now works as it should. It's still weird, though, because there is no axis of rotation; the top left corner never moves.
  • Moved Logic Land savecodes to the interrobang menu.
  • Rychládrát has been changed slightly, an optimisation: gate outputs only create instant rays around them when their state changes. This means brute force and ignore non-changing cells behave the same now, hopefully.
  • Element selection menu changed again: Tools can now be selected seperately from elements.
  • Added Colour Picker and Drag Camera tools
  • Note: The splash screen of this version was made in part by Dan. Thanks Dan. We're so proud of you, Dan. ;)
  • I completed this version long before 2016-09-30. I just never bothered to declare it done until now. :(
  • *Fixed bug where changing the rule while using the sparse algorithm didn't update the sparse array (resulting in innacurate simulation)
  • *Fixed bug where rotate selection could rotate the selection out of the world; it and paste now move the selection as far into the world as they need to be, instead of the opposite corner
  • *drawType no longer gets set to 0 when loading RLEs unless necessary
  • ~Modified "BLAH (ME)". It's now only big when you mouse over it, and behaves more bodaciously
  • ~Rewrote lead paragraph in the interrobang menu. It's much shorter now, though it leaves out some (unimportant) details
  • ~The cursor now acts normally in the interrobang menu, as opposed to being default even when the mouse is over text
  • ~Interrobang button moved to top right, and that area has been made terser
  • +Added rule to info area, and made setRule() autocorrect mis-capitalisations. For example, if you enter "rychladrat" it sets the rulestring to "Rychládrát"
This sucks.
  • +Support for lifelike and generations rules with JvN and Hexagonal neighbourhoods like "B13/S13V", "/1234/3V", and "B2/S234H".
  • +Random fill with hotkey `
  • +Support for LifeHistory
  • +Get selection button
  • +Support for cyclic cellular automata (with JvN neighbourhoods), with the syntax "cyclic(numofstates)". For example, cyclic12 has 12 states.
  • ~Flipped colours of refractory states in Generations rules
  • *Fixed bug where clicking outside the canvas with the selection tool caused selection to break (I actually only discovered and fixed this while working on the get selection button. It was hard to find, though easy to fix)
  • *Rewrote getRLE(). As a result, a bug involving runs reaching the right edge being mis-encoded was fixed, I made it encode 2-state rules using the standard b and o, and the function is probably faster and definitely more readable and shorter.
By the way, the cyclic rules in v0.3.0 don't always use JvN neighbourhoods. They just use the neighbourhood of whatever rule was used before them, because I forgot to make them change the neighbourhood to anything.

User avatar
Posts: 290
Joined: April 9th, 2016, 7:22 pm

Re: Reasoning Realm

Post by blah » April 26th, 2018, 9:01 pm

I finished version 0.3.1, which supports these rules, so maybe some people might be interested in playing with that?

To use the program, copy this into an .html file and run it.
  • +A snake.
  • +Generalised Wire Automata. "WireWorld" and "Bliptile" are interpreted as their equivalent CA in this rulespace; Wire12 and Wire1v, respectively. Sadly, Bliptile used state numbers differently, so Bliptile patterns don't work directly.
  • +*-There is now only one set rule button; it automatically detects which of the two supported formats you're using.
  • +*Cyclic cellular automata now perceive neighbourhoods correctly. cyclic16 uses the moore neighbourhood, cyclic16v, the von neumann, and cyclic16h, the hexagonal. Does that make grammatical sense? Whatever.
  • *Fixed bug where getRLE() would register amount of empty lines above the pattern as one less than it should be.
  • *Apparently fixed bug where generations rules with hexagonal neighbourhoods would produce innacurate behaviour while using the sparse algorithm. I never experienced it but I guess it existed.
(The sparse algorithm being 'ignore non-changing cells')
Edit: Also, the splash screen is a pattern in Rychládrát. I don't think I've ever actually posted any patterns in Rychládrát before, other than the picture of my computer.

User avatar
Posts: 290
Joined: April 9th, 2016, 7:22 pm

Re: Reasoning Realm

Post by blah » May 28th, 2018, 7:16 pm

Jack Eisenmann is now hosting Reasoning Realm on his website:

Post Reply