@mathcat good point. The bot will store the poster's user ID along wth the rest of the data in the cache, and use that to check. I've actually already implemented part of this.
CMC: Given a 5-element list L and a number N, replicate the middle element of L so there are N copies of it. E.g.: L=[3,1,4,1,5];N=3 → [3,1,4,4,4,1,5] and L=[2,7,1,8,1];N=0 → [2,7,8,1]
@GingerIndustries Your bot stores the username instead of the user id in wordCache. Not a huge issue, but it could be annoying if multiple users have the same name and the queue tells you you made a request when someone else with the same username did. Could you also store the user id?
Convert decimal to unary in fewest regex codes code-challengeregular-expression
Your task is to Convert decimal to undary in fewest regex codes
Every regex code is substitution mode.
A example
^2, |11
^3, |111
^4, |1111
...
\|, <empty>
This scores infinity, But don't try this.
Rules
Your score ...
@cairdcoinheringaahing That's nice, but I can do 6 in APL — and no, I did not (consciously) design the challenge for this. It came to me in a dream last night.
@user Oh yeah, everyone thinks Jelly's * power builtin means exponentiation, but it really generates electricity, and exponentiates numbers as a side effect
@cairdcoinheringaahing Reminds me of a time someone in my science class was sitting at a lab table, which had a (GFCI) outlet in the side of it (to plug in hot plates and stuff). He had his computer charger plugged in, but not all the way. Well, a piece of mechanical pencil lead rolled off the table, and managed to land across the pins. There were lots of sparks, and the charger had two little notches burned into the top of its blades.
And, due to the magic of having zero care in the world about safety, the design of US plugs would let you do that same thing with your finger instead of pencil lead
Am I missing something? Consider the number of 4-letter words of a 3-letter alphabet which do not contain the pattern XX (so 1221 fails, 1212 succeeds). How many are there? I get 24 (1212 1213 1231 1232 1312 1313 1321 1323 2121 2123 2131 2132 2312 2313 2321 2323 3121 3123 3131 3132 3212 3213 3231 3232), but OEIS reports 18
1. Plastic on the live and neutral pins to keep you from touching them 2. Mandatory ground pin, ensuring polarization 3. Mandatory ground pin, meaning plugs can have shutters that close, keeping you from sticking a screwdriver in
(The ground pin is just plastic whenever no grounding is required)
The sockets for live and neutral have shutters over them so you can't stick a fork in or whatever. The shutters open when the earth pin goes in, and since the earth pin is longer than all the others, it always connects first
There are some US plugs, typically on extensions cords, that are meant to be flush to the wall, where you literally have no way to grip them. If you try to wrap your fingers around it, you'll touch the live, exposed hot pin.
And I just love how the 240 volt plugs in the US keep the extraordinarily dangerous design of the 120 volt ones, but with the clunky form factor of the british plugs.
Well, the dryer/range/higher amperage 240 volt plugs. There are weird ones that are identical to 120 volt ones, but with one pin turned sideways.