tag:support.nodebox.net,2012-11-01:/discussions/show-your-work/484-binary-clock-dec_to_bin-nodeNodeBox: Discussion 2022-03-09T20:57:12Ztag:support.nodebox.net,2012-11-01:Comment/505597522022-03-09T01:21:44Z2022-03-09T01:21:44ZBinary Clock - dec_to_bin Node<div><p>Attached is a quick, simple binary clock face. Years ago I used to sell this design as a working analog clock. I still have one hanging in my living room.</p>
<p>I actually made it to demo my latest node: <strong>dec_to_bin</strong>. Dec_to_bin turns a base 10 number into a binary number (up to 32 binary digits). I already have a general purpose base converting node in my Cartan Node Library (convert_base), but it requires an external code library. Dec_to_bin functions entirely within Nodebox - no batteries required.</p>
<p>Converting to binary is surprisingly hard to do in Nodebox because it basically requires recursion - which Nodebox does not do. I got around this by constructing a chain of identical subnetworks that feed into each other, one for each possible digit required. That's why there's a limit of 32 digits: my chain is 32 nodes long. But if you need more just copy paste that chain to double its length: Voila! 64 digits (or as many as you need). I think for most uses, though, 32 will be plenty.</p>
<p>Binary numbers are surprisingly useful. They are quite beautiful converted to colored squares or circles (or in this case wedges) and can be used for many purposes in combinatorics, etc.</p>
<p>The yin yang symbol, by the way, is the solution to my earlier Yin Yang challenge: a yin yang symbol made from scratch with only seven nodes.</p>
<p>Dec_to_bin will be included in the next version of my Cartan Node Library, COMING SOON!</p>
<p>Enjoy!</p>
<p>John</p></div>johntag:support.nodebox.net,2012-11-01:Comment/505597522022-03-09T15:05:35Z2022-03-09T15:05:35ZBinary Clock - dec_to_bin Node<div><p>Cool. I don't have any uses for this currently, but I'll keep it in mind. I've been busy, but this is my notice that I'm still here!</p></div>joe.s.claytag:support.nodebox.net,2012-11-01:Comment/505597522022-03-09T20:57:09Z2022-03-09T20:57:09ZBinary Clock - dec_to_bin Node<div><p>Thanks, Joe. MUCH appreciated!</p></div>john