Lights Out...with project red

steve g

New Member
Jul 29, 2019
445
0
0
I took a break from my cpu build and was toying around my redstone map, and wondered hmmm...lights out with project red...challenge accepted ;)

TfZvDdqYorDJtaaZvF7ybALqQbxfa8B0VX1sEtnFza-JPY8WLGSk9dDi3BUvc1XXRAgxtXVGH00gGqcugTuuTVAQDz1zUA3eHE8ycp_aBvXp274RSihNzC8RWmGI7s22AX47QnV0PaUdWQBhzk11OQ_4yqh8IsJgkQaSAUApH3vdzpO-t4jXtsdvXurhRPvhu2BHVV0aZL3JNVqFjZNo0Llrv8DK3_NF8CRIiFtJme76o8pL8lWULmuP8-7iBTzb8YBoY9oJ6nN4mf3uAwNviADrPP6xNtOtZX3eP69iYX_CRlUWTtQdtdC9_1xEnS7T68shJIOu2wNEd9M7NWodf-u8TU9KjmNOGP7wsn_J43bupY5YfHGn7Z92XZQ4lNLPUr97G9woOuH6jYOSr03JxnKUcZAW1lKjNOJBYygs-E4cCO1Bqg7HSJYNG1Ji6ea0EMf9s9ehTM1AfpNLAg8j8W2eQzKfTusgC52q8c4KfvjggLGCG2GlviqabSToiCoNeR0IVULaMk6CCVeEVPbTff7yGl48_1T18ZKcv_rROGQlZXolQpPJTwZtp7F_y3-0gkC2wcE-Y9T1g46WVtb60wEfJVk9ErrtXOYOdTZXB0EcMbH-xSIjx4QoS1nsKYSRC8gtixKLWsoXQHjfKEILHJmFMfjXDiKY3Ro=w1500-h800-no

fBvuL8ZKLHTzPBy0bspOvDQrIK5O-8Bz0ZF9z6cRxLycwKrhDK2ZtJ__irULJcxxtWSjZGkEF-G9jACl4ikv9MCeqac3ATVMikqy3NwDnRW_Rz6oT9dUKtnKTDQQShPYgiud-1HE0fSG0yC8a__uva1sp85mvC9Te5bTp5RBRnXUYnj1yenW7wqSmKvrKCcDGVwk4P2ggNuHDlNyBfXsC0wAHMvMRMsx01xBoQZbT0VnlAMjo3xMw3MrWLJLo2LUcpoVPA6Q2TZXPnBv99k5xIADszLvI8v2x_cTb8ss0Xt1MrnYj3HBah2YLscVvGgPilUt-dyO6FpD2VUS93YgzNOvbxFVwQ3is8M4V1PfrfqAiBgI-56CR74Mn8rXEHWtB08FtgM960YiKPE6fbLGc2LCSqvsq12mWr5GZeMOryvevC7JTc-OLrYVi-Pz-e8t7ZH02-83T5PFWFxAH-LJ7glsVpXEuiKboV7fzakeVYjipKMoJeRLV5kOypGErkVBcE8ioVDgGdn9ODGaqKR5vYdHUx8OHLMHlGEojN3RdkJS0VuyCTCniu3cp0lrmCRcoLz-d5NRKo-mKOpD6506jAr5msDGeri8C-eiXtUsNGRTyY2XXm_x7M6bNe08LM9tNG7SnsqFF13wqFhxDx-I9p53xAZw11waeOA=w1500-h800-no

Axt0W_9DnrG4V2Ngc-KRQ1lGXuR5pAQ6ua-Mg_9omSEwRTmmRvZxtcFRBALzVdtKG36gNpw4g14qu9k9GwiOoHH05yG-iKHIJWaypmIl1SXPavNpSaxEucfAAcaHd4Sef2dhVvLRNxnSdf-KlKLmxZiAKyua6_a8UH4n_8wENvCALrQBX8hT31_DoOqBils9Uu_Ky_3poeRF_IngNNAuOcwE_f3N4NQu_Fy6o5eu2SH35szKPlBgUXpja6wT129EB4YVTAb6EoPlqNTOjvdfAdE5raHYTUPtnZuHWh2cibZKtMoDVkCg7z4TG7XUKhOI-k1gWt6_jBJPx8L8qsffqESfrt3S9Hx1AzsWbcrEYCzzi2vruPJhNEImNMyIqN9BnupOEefk3fe3eaxOJnYMEnDYMJ3yN202SSAohMG4_8FyewCYHYsY2x0HrjssTnHWctAjDnsqWoFGkIMBw7GZ1-DdeRtqWwSn7SY2nw9NLTIVxu7Wl3exEA6cp8t--Nli0AJZrCMr3dpEzgbdx9GbRDcjdMtSPN9OPgMSBeRtVhlOToz0QQCbU6nOJf-MabQqwpa0p7YJH5mlfuDQSJGI3lZtf7p8QNuRRsrIvEmpqjcYCOp8_3TaL45lvn9Kkpvuz67-MHF-Vb4gNABOni_JvREuEiMgU2IemHE=w1500-h800-no

this is based on bennycube's design (which you see here in the purple wool version)

the logic is exactly the same...the pressure plate sends a signal to its neighbors and to its own cell's t flip flop (a toggle latch). the blue line is the board reset signal. whats not visible in the shots is there's also an AND gate on the other side of the block holding the toggle latch...the output goes into the red wire going back to the toggle, that's the reset logic. im thinking *maybe* it can be shrunk down a bit more...but for now, it works.
 
Last edited:

steve g

New Member
Jul 29, 2019
445
0
0
heh so i had to come back to this. I figured out a way to make the circuit *much* smaller
9Mkd_88GaEC1-BE1fBzBSjaRcAwq-VHKfG13DnLL0e3i64HvxcFal9ho_a-cVZ3Q4siCeqtAHK8ylXGhEtMauXNH1myQDfevWkm8w-2s-6ZSeGPuPLxNHFqw3pXH9_HS7g6rQKPWWT49d6BJLhTKrF53X4vbInqnMEl7xGbtTmVJmClp4-EPhcRkY7u5dvY_povzZ88nnSKV26BzS_tgBLOfZseC2iFEN86a0UculA-murlq-Hiz-urgJ6HgGPO2VJlulM4HHjS7z0p25GzzDLrukE3bEYrTJmd4X7aTesaUr9egsfHP_RI3BipXpWOby1isQmiPJwAOxg7m5xYS-ay9dzjhpuZkuP9l_Ga1fYcYljX49va8j3EFuOlKamP4lVuC26uZVu3pK9Xah7pawvGjgSDdinUvx-Mjyj8GyrUV_taY8wUz5ZXgWHXVbKGiaKlzDPD9WfUNq-Z991nExRe5YcXhQfJzkNLEjH53WDPoteT-OjDCZCnnliEuvtHU_bhCGiEXnglXUSY--h9-vMllyHjCtPad6GN-v5GbMSrd0zwUUMTbPguco7F0-nP7oT6EVFYzJ9QO245dGZUmn1JnU29h0G3SMI_YqDLxHVMo9zAgMMxsSqh8pYjUGHRiaSQiJPuyKEr3ZgWqSiwK1rM9_i6FGoG5TkA=w1500-h800-no

the 2 boards are identical...the one on top is the one i did in the last post. left is bennycubes version..right is mine

EJMOUa7l9g7tUAQFv54vSMN-_NtWd7T3Ml7MFxFT_foQZynYOmMmBTlAfH67v-UyjUYo_T2z1--h0dOB_re2AmfaNExWjaJXTcCo-k6OGcRarcsBnI_CUZOCQH20iquIa86IN3302le2-oCplLYA90PT-sJPwLwvipkEvUbYH7PI6j7KMpv3dtwyRyFWHY5oypXrA0zVvshtH_JnpPKXFtTU-kw8KERa61_V6v_bf9mdPS7Oi4wzhZsdOQ5h7z_q0Q8pvD9M04hpMnNJoGynFYwGVpQZniHB7H9yVzO_DA2nCsF9yxtFzMnVNFLYILrI8ARWqbt1wRgoxfbSRNAFu-Md6zibhjPCLoHyuviIdJllLJUjvhOLA5Jodfx9IqoVRRILijB-weDZ6R1YMpHmEkkjqpSKq0Sy_SY8zutYmXD9Hzi6PAQaGTGfnDfprpTTFeaypLl2TJz76DJsplOhnMBDInL-K1Q55zwf6biCGnPwBdmtMHcULKzbpNPHHLBE48mdJud47hVF6OT7AVhaJGHn-THjbQE_AHq4muYMXzGXtlbVjr9T5opRPOlbrcaSm9pqXRscpQW-QXXY1Pl8JhIN-p-M9xa1vmJ2ANDP5aUCfwe-8fz9bUJXCYG2eEj109NwXM8hsxC5ve70tq_ilSVkGdENwm_pYWY=w1500-h800-no

-vxFASbb4uvyuD3VeN8lKWpxRezJbYeXY-qRS5F8gps3QcD-4Nd3IAGdMffQWPUfrF8M-YLf8PpYmeei42baWWgq58UPgcucHEAMK4C_T-mJL6rSaGALaSgRB96a-Esg3kA6lDOX9Cbg6lFKKTpPhX51EQWUhI-4kgBg4PCNp0R1soASyFMm1cMhWWElPV1DCVuCViSNCgGJN5NDXp_wcXD7VyZsdECJSd4a3OC5vEzuczTfZ5rnisLPDMlJL9TAuRiG3Y8oBKClqnEQYG2fyFOy3Du0mcZbGAdAjXCKoVloe6VA9LMPiQp6Wq2Y9rD70_IbvPHvZvrSY8gJtjLwbRB8EbUgn2ZIDYTySlmky6IrrtN1QzaGWjohvlz41JzZSPfmuN2iqxgmjrjqX-KeVGJjBckquvdwv4u6ekVf23S0BvX_wXiLzzD8NoKT22csln2oNQJcfvbEbXJt0grHQz3snyBsfxzC4IkcjL-TXme9yC9C24lR91M1oObDufKX9WwZK2XD1uMt4Xikj3OOITvAi0xSsYBaZe-fNq3y8ZJmtVe3Qzz8BrVuQYKAzSZpwFd1zXzOyMAiAIfpuHpVqKPuCcyPOWXdicEs0ssgUb691tmR7rE7S7YktFUWkHzsL-ajI7aO0lGTW3kTk0Scbeg6ik_Dccj1D7Q=w1500-h800-no
and look at the difference! mine is only 3 blocks high, including the light board. I managed to pull this off with some IC trickery.
4fpF89nxFHczFwB_J4BjZkM92zPeO8V5BCaS-5sS_z-YJhO-kmq518XpIFZHojOwFWqkTfW26N9zkoA5vV86mP7e6IIK9Pl-j8XLi0o8Zf-58KJfnof8dEVb-fbHAfpjXX4pHs4TVDz22JjZBSahdtV0I5Pi4E3wR61e7x_jIh0EXGoBKWRYkozn-9fbHiLTj4ld4BwtmYH7VPTF71n3rE5RTsy129zVLQoQj82fgxWedo1h3kAw6dIjeT8z-Sp6KMDqpp8HIzTUZtOjIVkENnY0lRPS4s788NXmNxeLIey1YlNUA5kdWqmoGifP-lWI2Vl-FNxotTbPdRvyu0rq53iVeI3SnemYNRElCqIyQzGDYxfAG7lz-WopScYU9-9cUN3JCADwjbC2EWlgm3HxhmGwacpFJZ5geem4V0QNnWdJoYaBPRKoruz8JYOsD0gL3U0nLcnX906DzLeTrIS43psi3Mr-gwtbB7FSBJ3UbBglhV-dxzhjK-CyVEPwDuj7IRBEBILFcstGKTAGAGDHr5h7jP438YxMXFVRqziVvbyPr3Erlca60rE25XnTQvKED_P6mbYZ79s7YBoxauEVDX09IM1UOhcYk2c6OwmK_q4LijWhwKANt7TWIC31_KL1yJLsTUdC3O2uxrhMygcTkjycPF8s2H-Q-8E=w1500-h800-no
the circuit itself is very simple. white lines are inputs from surrounding cells, orange is output to neighbors. green is the signal from the pressure plate. pink is the toggle output which goes to the lights and blue is the reset signal. now you might be thinking...the input/output channels cant reverse roles between neighbors, seeing how they are linked via bus wires. the way the schematic is shown you are correct. so make *2* versions of this same chip, and flip the channel colors for input/output. use both chips, in a checkerboard pattern, and it works perfectly. and it works fast too. the toggling of the neighbors is instant now, making this probably the fastest, and (hopefully) most compact, version of lights out for MC ;)
 

steve g

New Member
Jul 29, 2019
445
0
0
i bet you guys are getting tired of me and all this project red nonsense...but never the less...i actually managed to make it even smaller ;)

2MVxyUuFOzFkcEdYaQZeF-bD5kWSlB3Wnz-q1F-ZelXVDt0PGE2Er8OGm4qaE0LkNBv7LZCVcikDCVVBJWBS-_cdbxWT7ojIduxHq7ZdFD4ZwP6mQkRXR3GQr7DjHvKakVxiV4vW0A5KaqtCwYqvtazPvbXIV_sp7-d8vnLBSRHLaFX8t5Vds5ZMRHz_n53JBUIMUBk2Z3YOkqPl-B6c5YkBXOupEC6P76jwlNa7CH2VDeEBhodyH2wfS3G6gzr_dRpd6cjvG6VwiZQMECSJgF-_ItnqlN5c8kjk0ecWEChnDYNfi-KTUt0Fsz3mPsFwCHKXT_E-RvFDbeCG4lcIQnvdbyaMvWOa-eFBA6OGJHL6iY-aR7I6JPKF7X3uSdnLYv4-XqZX6beeqx4dUdScf5C_qJjJDuR_p3SeN_JnsNpTWyi3NhHlWWF4U7suWH3_qn5hWX7sDA5m2c8TkhJ69dlupTxcnA8IRKrX16Jn1M2SqRGeYxmLrZ9OWDkRX1QuH7kIYIrwHVugoyJWGg2yJVm1P7Zd4L08_9pguGSv153bsLvgjXfLcCM7W_xTwkR1mj-rPsOgz8Lt_u2LoBinEeBQyT_bw9fuWG-Y7p9ne3o4nDzhP913Nqda997LgeZrK85uBjmoqK_hZ9-Al68Blm2kL3nMwsn0ljk=w1500-h800-no

bw6ibSbX-EMM-O4o7MfH6j5KaKBOOoQtlIkC-ED1OHouG7mgPEk6k7sYqlFpfjx5WrvGcL89EVgjmZFnApoM2053oCefA654FZ-MsTDBcLuNRk1-gyX3uPbuBTEJ-cmUP2hWc4ghKe-MCz0xGhIT1HJFJ9wIplOnp-r5epqkEcmVvUEJXnVWwh5f-1DkgBV1D3sKZXj3KIRdTRJwAgfFxy1BL91ZJ0ZDlnACQCaMnIKpbiPgvJ6pe7iaxEEz6xevTFfmYo6jXx6GpK0d50UOlz1KLqqXu6lN1lCN5JwOdWU2Du6dc-_oKQ9bXt_xd3T0X5Xca6HWmEmcIkm2-73QfVanpqHB7v1w26ueqOIRpkjhhTot5K0x85t-zSgrBlVfw_vumy1sgEQ1YYFDr_Ik9_OLEShBTh5VUGFLI34MswPOaUcbTmDXux00CMQVPtPzxWN8krVUeIygubxSvcl4ZwKNL4FASw-nt9c2WDuWlWtEtD0B74g9FtkbBeuDqWdPZvF1BXwcW6LINXtTpIwYceDAToojIc85i2qcMWqqv1MVXWRnij5xHPvBeH5v2IL-Mxf4HPO9DiLmjG-CZkSaAHB92iZvEMgFh32VwI5FYfopW4SYmsghG0HLIgBy0QvfJfDyE-BNFyYgz8Z_ADSq16So-yXxxK-o2lQ=w1500-h800-no
2x2 wide/high, and 5 deep (for the reset signal grid you see on the back). this runs exactly the same as the 2nd version, using the same ic chips in a checkerboard pattern. only difference is I did a wall instead of the disco floor, and had to get really creative with cover strips and covers to block the bus wires from connecting to the wrong sides and somehow managing to get both input from and output to the same lamp.
 

steve g

New Member
Jul 29, 2019
445
0
0
all these lights out builds I've seen were always missing something: a way to initialize the board with a random pattern to solve. I might be wrong tho, i've seen some pretty crazy builds on redstone servers before, but here's my take on it

hJKfIYwe1gKl733gjEBJXybvnwM1mOEAWiJOcLRx8k5MoTsjLPBv0nkuUCSk0tWEXHhdlI-LDnEIqfbNeUeheJJ5cLs-z_JLFCkCq9bXcpEjvo4SAyNGOgAay7BBseBABvtmjG8_Gxb-3sJ-FsPouH_kDyGKnctWds84elmVRbzzfrswCyvBIhULob-7BXklxfTvWtWCZlk7Q3VW3zjs9lzssMXBPHjChyl3hUmxZAfQsE429pfZVdXpy2efzQS5bAWnb6epgU0gOkOQqpTv4agkBZcZ-wEh2xX1_e4lVGMB11RU6jP5d9qMdlhr3IcJqysbHCwSoyMC01gi3QM_H3sVm0drgZ3BlLozpYaqVYsWnwhu-UWOkL6h49kuXw_ODI4Gi-0RYeJOx7I9pIvJ05FcqTLvaFeJvaIEVPMBm29EJFkefzHdqZDcSJxZCwI7mLuRDfGvraQf3iihnlIw-66XpUF6Bslc7hiBjgAB_2hKEKfOvbNE4orHOznftAZLi3AWW4rGgSJI905qgyXKIK2I3uQ4dGgU0kXOOT0lgHzJrxR4A-85bF6KsE-AJl3Prks-qSXF7WKTAWT21eL6S5uV7_NCIesBDXrFLjfL4_up87ZujgWbgvfj6MWKVfXC5a_6lCqgwnVqUwCrY2PJKtPKs9jPL2m7pQQ=w1500-h800-no

0J3yf8_Wa3s-szv86bkxqhayxixrURSIieD0kv8KMN9hFU1D71P8mnLCl9WTsBqeeqIV8zMwIWcIreiH_WBOXufvEmCvcd2ytDW62KnOibO_GJG7dIN0x7vDxX9xPmCUSBXppjRqA8G9PIXfB9Y7i3E2BhEY6aYKG9Hdqcg9PtT4HA_pHu6EAFFDPfvX-FXyeSpHXJ2dW9-U18ydP3XL6PiMRM5a-a-e4wsPnHp0qqcYIDfHpXF-7oxj-AIjU-jK7PjBjpemehF-cdVjo3YytXHTjCjfMkutw3iOlYb_xI8HBYnSMi8mtnlwA84CIUv_bw8xtdlgBYvvZ_Hf5sUlAE1RrFyl14J68-AH4DWfyY2tplS45hkqmlB2QwXS5QR-L6hHwHPZGTQhg4EG8HKHZCvjWf_6aOBiEc8u8pNhECcf2pX2bKYQy5lqpFXVVJ4FL5uPkPSOuTYR8lXNTgbOzdNv1KCGK5lxwoA4KTzbglLbjrG2QP8HijJsc2_2s10mI1LTzqUzlrRLB8UbM_qwQ2P7OJqCjOr0AJbrVY18acD5N_TXe_VImTkWlKPqj1WZgg8zOS5f9OGgOVHR1DbtCfHVzj0-PNqDzT2X2d4Dcht9xMBd5thJehuUfD78yozh1Z3oT8IWCBoGx2S3QMrKgx4sKmCapKpoGPM=w1500-h800-no

Whats going on here is there's a group of dec randomizers sending signals to the bus above it. The randomizer on the left controls which of the 3 groups gets to go through to the bus above. This was done so only one of the 9 lines will go active at any time. on top are 2 groups of outputs with latches that control which wires on the back of the board go active. the left side controls the wires going across, the right bus controls the vertical wires. the difference is the right bus has pulse formers, the left does not. this basically 'clocks' a cell when the right bus sends a pulse. the bottom right is the clock circuit that controls the latches on both sides.

I tried doing this first with an IC gate...but that was an epic fail because with IC gates, the pulse to a latch is too long (even a single tick!), and allows more than one line to go active. I tried repeaters, but that did nothing to stop the latches from getting multiple values clocked in. the dec randomizers are designed to have only 1 output enabled, but in an ic, they run VERY fast. Fast enough to get a couple values in while the pulse to the latches does its thing. IC's are great for combinatorial logic, but not sequential or clocked circuits. So I had to do it in the open. It works great like this, and the puzzles generated are solvable too. You just need to let it run for a minute or 2 to set up the board.
 

steve g

New Member
Jul 29, 2019
445
0
0
i couldnt leave it alone..i dont like having big circuits like that flying about when it could be done in an ic...and so I have a new IC that does the random board setup i had going in previous post

Qb0X2qW_IrbX3oYBBM_WGg8aj3o6fliy6PoXI-8ANCN9gtro-eQ3JnWpsPkw8wqjCYJeeji2danVA7tpo-bVUrnaxDZw7boGkeweOJHkqR8izaz0FGMYC3mxz4_ZeeRgZ_ezonXil_HvOOxMXdqT84XsLEBD0ttyQkAYpu0JwKJEv1lUaMAg7Vep67sy4-cdj9Y9NuhVJv0DLV5TwtrvZC9MV4S5LiLZRXmgdbfGY4HfArD0gd2skm5qS60LTig5jQlNLXkmsfZEguYaqnOrw5ZyGDb64XMik6ZP5-1nz8m8KWnvD1Sl2pns9MQEGn29o5vFtyTHwrSiIe7Mv7jxTDSoQ2ay2X1Q--3_0trntGVcnDRw-2JD1sIscDSGnQ2HqrRRVjH2fHSADbOE6d481iXj1okosa4rxYZBwr1e5V3g3u3C93Du5q0D9Klzv9wYFkh2n-yN8xdx61jNmb31GTy2jqnwKFpPaenkccShIiFQABeO93cm-tSXAxxyRsrGa8mkIBQGm09IjugeBEyyHGeEJHvZmHeuxUWHUdth1lsytLCIPO0Ze4rxCAzpqIIsW6Qyu746lXxeswN6DImyIY9foZ6UdLa_JJct8YBgoIwMiF29QIUthuo1-IfoK_VEJkO5NKNTPLOZq9_8HSONqf0wpLzt0bm-XCE=w410-h396-no
so i changed up the random generation so it generates a 4 bit number. feed that 4 bit number into a 4-16 decoder (all those buffer/inverter cells). the outputs work the same as the last circuit..left side holds a horizontal line active while the right output sends a pulse over the selected vertical line, 'clocking' a cell to toggle its state.

now the clever bit is that timing circuit. here goes:
gKXbMIyrcBDq1IltVBls3v9ygFWvaZisgg0MG2JljRUxddPB_xupaCQxh_6duoNCIOR4zeQs6uaYjPXkfq9-0ppQJhu2bQWalmABFK2UUyfxdAKxkk-gwdzYT97kiMTfsntRBWujn-jCUqH4CYk4pM2I3HFlPwr4fScm_k_SdK_hOk6WoJM3Z89gVn4c6kwuZZuCIY2_RCNJdpORUcgpodyN7thxF1BlFSXZ2gVaZGkBxzcPygluEO_SrqiH7gbt_myjM8uHFMLqIDYrVJu4lfKd-EgKDNWcPEvizwQ_K8o7J18VsvR7IUE7G-XeoAWWLoRA7LaHm5daUqpR6c0gxloVpuXdNOh0Z9ugQNfq2s52rX-lAM2WMQlA5Sh9KF1zAvNQGj9nm3rO3HbMwh_gkjoZPBWtX393jWcXYOXEwHUN6s62L7BuXnY-PQbAYzntEGvvtdZhT1M-VrcB66e5P-Ni1UfjYuwe7kdlZmGjaeuqAC7KyFZDE99xOeFYjOSLzgNIomjqZ7FwPjBV4qLPHAWQYwJuIEu8RV3YAHHeUQz5Ra_T9spEFSUHjcaKcdRLu7Uru1kBTY3KGqNisPiWAWb7bzpx_LrB4g8hc2ufxQ5UgJ_fqDVpu7kZEy0FPU0X9_wotv9_4Z38Lp7tXJOu4vp-CFJEVkMJ-Pk=w488-h306-no
the blue line on the left is the input telling the chip to start the process. this goes into an and gate, which goes into a toggle latch. the white wire connecting the 2 makes sure that once the circuit is active and running...no further input will cause any changes on that toggle. Anti spam control.

after the toggle, the blue wire goes active, sending a pulse to start up the timing circuit on the top right. the and gate just left of the first state cell is there to allow the signal to keep looping as long as that blue line is still active. from there its a sequence of state cells:
1) send a pulse to the random number generator
2) send a pulse to the left output latches
3) send another pulse to the random number generator
4) send a pulse to the right output latches and go back to start of timing loop.

on every iteration, a counter gets incremented (follow the blue wire down, youll see the counter with the +/- symbols on it). the counter is set to min 0/max 50. this is also hooked up to an rs latch. When the counter hits its max value, the plus side goes active and does 2 things: toggle the input toggle latch, and toggle the rs latch. when that rs latch gets a signal from the cyan wire, the magenta line goes low, activating that timer on the left...this is used to decrement the counter back down to 0. once it hits 0, the counter's minus side goes active, toggling the rs latch and disabling the timer doing the countdown. all this is a reset circuit to get the chip ready for the next run.

having hooked it up...all works well now, and still fairly compact given how much its doing
 
  • Like
Reactions: Kel_Co

steve g

New Member
Jul 29, 2019
445
0
0
This is honestly really impressive. How did you learn to do all this?

years of redstone and trying to understand basic logic, timing, digital logic circuits..i've been playing this mod, and its predecessors all the way back to FTB ultimate, with the original RedPower mod that started it all (Eloraam...we really need you back :( ). Also helps to know how to throw around a few hundred lines of code in your programming language of choice ;)

and about that code...i came up with something...evil. And smaller.
X6qk7PWJpbXTZ3ycrx1Maq2lTXP-pJX5JZOivpQQSEirnWcGSxTiJ74sHGAwiUJMQ2FgHOqgt-989uqX-raQFiaR5QQmVW4KgCVXw2e3SWBYee2X5axMzvyaMUIVCjcA8a1zw12wr2k4OEm7m5XCSvLKYNelYtiJ7rJrpnzy81HuBVtAXrj-B4TKSHg1uK2zEgpih67UUuKyApf1cVvEbgvpu2r539a-yIL1wrHkmvlm9emQ7b84bI2GBlTx0ptxmLwIvhjhAFeSZ5CgaATiyGl4sOti4w2-911TjiHTcl3148yCuXtf7qBMIkLMcwkd3Sm1ZganLVu6x47JPunxGxh0s9y4nq_-AE5sqzmudRE0aBaFt0T1ysKEHNKWZYUncP7B2ZIkQpXd2wqD7vWUTDQlBnvjALEodplntmoDHE7hFRWSNihfRsex6TwwQMXXx6YU4vdBcCr6C8-P4qOivX13WZQ4P8pEjc99VdWj2E77qrPEIzDp-j_1ezk5kjOJI6LE2ch1MHxO7mR1q1uaiDCIk6FpkJGJtKo9xgPgXT17OMLPZKLTza2WMUYcOME8p9Iu1iz4UcZsbhVIppK-2HPoaWUbveZEWq3-ngy7BZnSV8kv42-0DuY_0TXzdyxpI-vo2a90yba0FgtStoxCPncRIWEkevw5dPs=w1500-h800-no

az8YiE-Odaj0-ZjoEgC-LP53wU1w_NlVor70jyj_e1aVmELYgHH43YN99iIg76Kf8JtBE98Am2sMGgXnRXJIdaays5YQfIrp2ej5tRcDoF4B_MYspaWcvAnYnS48JLNxCarD5lJ0b6xsQMHHPwYpR6AWOEv2g1lI7orMrZqk1nQWqjYG4MjeHResk4zcVYJ8lOtLjbPazrdIOanHO82-nVD0mnFoyBNyaG-nWJTEW-EvykQ97dMaLjBBoLjYMbpolqj0Q2h4iLnQwNRYupUPdY0rkOkVI-ZkjFxqZegGEz52qoXN8JxxbCDDHXApqL64tHv7wpcmJZfpvCPut7veQpPDyEEhBOkA4MUggSaocvzXIbURuDbScJXLnhRP5iBiuIILFF2iuFmPdJG__99ExHwhMCjZ9h5lt6quFzZjo971dt91TwLTERtqLwrQu9eCDjRlt5G6d5FGbp4qGyI5MWxXrGmmEAkcqp0RwAHXWrstvWbyI3I8l3WRqu2qhMi5YX_STbmvLDqa9Nmy0YUZTknjgDT8cNRAjipfrGJyRzA8mRvjGq7zcV5Nbses-KLqcqk_KZtCuGrhRczdhE5gpgJqFL4jI57fdJ8aDmpHmLk8Ys9Ym8mzdNxodVfFrDMb0B9QRbQrUzTFPX0dvDc91VfegRF2qEDy5mE=w1500-h800-no

This is as good as it gets, without getting into command blocks or creating a custom mod (i almost did that, woulda been kinda cool, but a hack). Computercraft mining turtles are running this board.
I was inspired by the command block version you see on youtube...i dont have the link on me..but it uses command blocks to swap out the wool blocks you toggle. And this one is very evil indeed...because now there are *4* states for each light...black, orange, magenta, lime. in that order. I can only find one reference to this calling the game Colors Out...and it is annoyingly hard to solve the board ;)

the code running the turtles is pretty simple (all the turtles are labeled 'lights out')
Code:
turtle.select(1)
local state = 1
local myTimer = 0

local function toggle()
    state = state + 1
    if state > 4 then state = 1 end
    turtle.dig()
    turtle.select(state)
    turtle.place()
end

local function setNeighbors(v)
    rs.setOutput("top", v)
    rs.setOutput("bottom", v)
    rs.setOutput("left", v)
    rs.setOutput("right", v)
end

while true do
    local event, id = os.pullEvent()
    if event == "redstone" then
        if rs.getInput("front") then
            setNeighbors(true)
            myTimer = os.startTimer(0.2)
        end

        if rs.getInput("top") then
            toggle()
        end

        if rs.getInput("bottom") then
            toggle()
        end

        if rs.getInput("top") then
            toggle()
        end

        if rs.getInput("left") then
            toggle()
        end

        if rs.getInput("right") then
            toggle()
        end
    end

    if event == "timer" and id == myTimer then
        setNeighbors(false)
        toggle()
    end
end

i'm using os events to poll for redstone signals. a front signal means that block was toggled by user, so it will send a rs signal to its neighbors and starts that timer. you need that to let the game process the redstone update. the timer event hits, trigger the blocks own toggle function and disabling rs signals to neighbors. the cool bit is the toggle function itself..all it does is increment state (or resets to 1 if overflowed), digs the current block in front of the turtle, selects a slot in inventory, and places that block in front of turtle.

assuming you start with a black board, all the turtles start with an empty slot 1 (and all selected to slot 1), orange wool in slot 2, magenta wool in slot 3, lime wool in slot 4. now you see how the toggles work...dig block (and retrieve it to previous state), set inventory slot to current state, place block.

its a slow update doing it this way tho. for a moment you can see the turtles before the new blocks get placed...cc must have some steep timing penalties for digging/placing blocks.

the trick now is the input..use a wood button, place it where you want to toggle and press it. the turtles handle the rest. the button will pop off, so it can be reused.

as evil as this is, you can see there's room for more. I'm only using 4 slots on the turtles. hmm.. 16 colors, shall we? not hard to do, just change one line of code, and set up the turtles accordingly, reload the map (you dont want to go rebooting all those turtles by hand...trust me on this ;)

file to play with the turtle version: https://drive.google.com/open?id=0B2ucBrdZgWgnbVRuenVuLU82c1E
make sure your running a pack for 1.7.10 with computercraft to load that map.
 
Last edited:

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,799
248
question, wouldn't it be easier to replace
Code:
if event == "redstone" then
     if rs.getInput("front") then
         setNeighbors(true)
         myTimer = os.startTimer(0.2)
     end

     if rs.getInput("top") then
         toggle()
     end

    if rs.getInput("bottom") then
        toggle()
    end

    if rs.getInput("top") then
        toggle()
    end

    if rs.getInput("left") then
        toggle()
    end

    if rs.getInput("right") then
        toggle()
    end
end
with
Code:
if event == "redstone" then
     if rs.getInput("front") then
         setNeighbors(true)
         myTimer = os.startTimer(0.2)
     else
         toggle()
     end
end
Also, you have top listed twice, not sure if that is intentional...
Nice work anyway :)
 

steve g

New Member
Jul 29, 2019
445
0
0
yep my bad, goofy typos.

you have to realize the redstone event happens 2x on every incoming rs change...once when signal goes up, then when it goes low. the redstone event doesnt distinguish which side or state. just that it happened. and luckily it doesnt trigger on the rs.setOutput calls..that would've sucked bad. would have been nice if the event did include side/state...

without those rs.getInput calls..your code would be toggling the cell twice on every incoming neighbors events.

actually this is a bit less verbose:
Code:
turtle.select(1)
local state = 1
local myTimer = 0

local function toggle()
    state = state + 1
    if state > 4 then state = 1 end
    turtle.dig()
    turtle.select(state)
    turtle.place()
end

local function reset()
    turtle.dig()
    state = 1
    turtle.select(state)
    turtle.place()
end

local function setNeighbors(v)
    rs.setOutput("top", v)
    rs.setOutput("bottom", v)
    rs.setOutput("left", v)
    rs.setOutput("right", v)
end

local function toggleNeighbors()
    setNeighbors(true)
    myTimer = os.startTimer(0.2)
end

local signals = {
    ["top"] = toggle,
    ["bottom"] = toggle,
    ["left"] = toggle,
    ["right"] = toggle,
    ["back"] = reset,
    ["front"] = toggleNeighbors
}

while true do
    local side, action
    local event, id = os.pullEvent()
    if event == "redstone" then
        for side,action in pairs(signals) do
            if rs.getInput(side) then action() end
        end
    end

    if event == "timer" and id == myTimer then
        setNeighbors(false)
        toggle()
    end
end

i added a reset function...run a framed red alloy line (or something that links all the back sides of those turtles) and put a button on it
 
Last edited: