Cycles seem to invoke undefined behavior instead of being outright disallowed.
For these sorts of things I tend to go to the circuit simulator[0].
Also, for a game that teaches about this stuff while still being incredibly fun, I highly recommend Turing Complete[1].
[0] http://www.falstad.com/circuit/circuitjs.html
[1] https://store.steampowered.com/app/1444480/Turing_Complete/