How would I go about updating my electronic circuit simulator's 'electricity'?
- by liqwidice
I have made an application which allows the user to place down wires, power sources, and inverters on a virtual circuit board. All connections between tiles are automatic, as shown here:
As you can see in the last image, the updating of power throughout this grid is not yet functioning. I think I understand how to do this updating conceptually, but getting it to work in my program is appearing to be much more difficult than I first imagined. My source code can be found here.
If you have any tips as to how to I might approach this monstrous task, please let me know.
EDIT
The goal here is to simply get a working application. Getting tiles to pass on power to their neighbors is quite easy, but the tricky part is getting wires to "unpower" after the removal of a power source. The size of the grid is just 18x18, so efficiency really isn't a factor, for those wondering.