So I was looking for cool things to do with regex and display modules.
Here's one really cool thing i've found so far.
A counter,
It takes 2 steps to do it, but still, really awesome:
[REPLACEALL]\b([0-9]+)\b[WITH]0$1~01234567890
[REPLACEALL]\b0(?!9*~)|([0-9])(?=9*~[0-9]*?\1([0-9]))|~[0-9]*[WITH]$2
Then just put a number to be incremented in another display block, and run these 2 display-block replacements. I connected 1 button to the next button to do the steps simultaneously. And now I can make any sort of counter I want.
Want logic to activate every 2000 seconds? Just put a sensor compare, and reset the number . Want to log how many times a logic-door got opened? EzPz
Really not sure what else do with it- so far i've just used it as long delays, and just a general ship-uptime clock
Anyone have other cool uses for this? Let me know!
- If you're having trouble using this, I could upload some examples or explain more detail.
Cheers!
Credit to the Regex source:
Is it possible to increment numbers using regex substitution?
Here's one really cool thing i've found so far.
A counter,
It takes 2 steps to do it, but still, really awesome:
[REPLACEALL]\b([0-9]+)\b[WITH]0$1~01234567890
[REPLACEALL]\b0(?!9*~)|([0-9])(?=9*~[0-9]*?\1([0-9]))|~[0-9]*[WITH]$2
Then just put a number to be incremented in another display block, and run these 2 display-block replacements. I connected 1 button to the next button to do the steps simultaneously. And now I can make any sort of counter I want.
Want logic to activate every 2000 seconds? Just put a sensor compare, and reset the number . Want to log how many times a logic-door got opened? EzPz
Really not sure what else do with it- so far i've just used it as long delays, and just a general ship-uptime clock
Anyone have other cool uses for this? Let me know!
- If you're having trouble using this, I could upload some examples or explain more detail.
Cheers!
Credit to the Regex source:
Is it possible to increment numbers using regex substitution?