A 2-bit ripple counter, built using WadC. Based on the design of Fraggle's binary ripple counter from 2006. The code can generate counters of arbitrary bit-depth. I originally thought to upload a demo of an 8-bit counter (to be different to Fraggle's example) but there's already a built-by-hand 8-bit counter (8-bitadd). So instead I downgraded it to 2 bit and added a surprise for when the counter overflows.|
Hopefully the surprise demonstrates how this construction might be used in a real map: perhaps you need to reach a certain "score" to open a door / complete the map, and you have a choice as to which tasks you complete to get to that score.
The WadC code is included in a WADCSRC lump. Requires WadC 2.1 or newer to build.
Simon Howard for the original binary ripple counter https://www.doomworld.com/idgames/levels/doom2/Ports/a-c/counter|
From scratch, referencing counter.wad|