Hacker Newsnew | past | comments | ask | show | jobs | submit | pleion's commentslogin

I designed a system of cellular automata based around this idea of colliding lines. You can play with it at http://sciencevsmagic.net/logicgrid

The XOR Sierpinksi's triangle is at http://sciencevsmagic.net/logicgrid/#282800 but there are other ways make it too. For example XNOR makes an inverse http://sciencevsmagic.net/logicgrid/#828200

If you keep hitting random you'll find plenty of surprising analogues to Sierpinksi's.


It actually has to be one of the first circles you can draw (a point on the edge and a point on the radius). Not just the same radius.


Good spot! I think I've fixed it now.


I've added the esc and space to deselect, and shift+redo. Thanks, once you get used to your own hotkeys it gets hard to imagine what other people might want.

As for the hash, the original reason why I went with hash= was to preserve back and forward, but I guess that might not be so necessary considering I have undo and redo.

I know that my clutter can be a bit obnoxious, but just changing it to window.replace(hash) breaks a few other things, so it's left the way it is for now.

There is probably some HTML5 history API way to do it that lets me have back and forward without saving every history entry, I'll look into it.


>There is probably some HTML5 history API way to do it that lets me have back and forward without saving every history entry, I'll look into it.

Do you mean the Back & Forward buttons in the browser?

If you can go back/forward to different states, why wouldn't those show up as history entries? I don't think you can decouple the displayed "history" drop-down list from the behavior of the back/forward buttons (for reasons that are probably obvious).

http://html5doctor.com/history-api/


Perhaps map key codes to object properties with, you know, real names so comparisons to e.keyCode mean something in the future.

  var appKeys = { "Esc": 27 };

  else if (e.keyCode === appKeys.Esc) {
Some JS libs do this for you and there are some nice libs that make key handling convenient and powerful as well.


Great tip. But I generally only use each reference once, so I'm not sure it would have been worth it in my case.

There are lots of libraries that could have made things more convenient. But a big part of this project was to learn as much as I could about coding, and the browser as an environment, so early on I committed to writing everything myself.

I'd be interested in hearing whether or not other people think this is a good strategy for self teaching.


+1 on doing everything yourself the first time for self-teaching. But I'm sure people are on the far end of both sides -- do it all yourself, or use libraries for everything.


You can actually press reset and then redo, redo, redo to replay construction without having to undo first.


I've rewritten the custom cursor CSS for the grab hand, hopefully it works now.


It actually must be a circle with its centre one of the original two points AND the other point on it's edge (so it's one of the two possible first circles you can draw). Sorry that that wasn't clear enough.


Thanks for the update! I've replaced one confusion with another... b^)


Well Done! As with most elegant solutions, yours is so simple that I can't believe I didn't see it earlier!

The minimum scores are from the simplest solutions I came up with during development, I was waiting for someone to best me.


Hi, developer here. I'm not sure why it would give you a single pixel cursor. It should use the pointer (when you are over a point) and a grab hand (for when you are over the background).

I've probably done something a stupid way somewhere and it's not working in certain cases. What browser/os are you using?

EDIT: My chrome is okay (windows 7) but I'll check out a few others. Does the cursor always come out tiny or only in place of one of the pointer/grab hand?


My chrome is OK too (Mac OS), pointer/hand seems to work. Cool bit of work!


Not ok for me (Arch Linux), in fact, not even a single pixel, no cursor at all!


Hmm. Sorry about that. I didn't see it at all during development. I'll do some testing on my Linux Machine when I get home, and can hopefully get it fixed soon.


And Wikimedia is a not for profit organization. Giving to a for profit is always going to be different.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: