Task similar to this one. Take a string of ASCII characters and convert it to base-3 equivalents separated by a space.
For example:
Hello, world!
Should be converted to
02200 10202 11000 11000 11010 01122 01012 11102 11010 11020 11000 10201 01020
That's all. The shortest solution wins.
I wish high rep users could edit stuff and then choose not to have it bumped. I've had to hold myself back from fixing a little grammar mistake too many times (or I've made some minor edit before realizing it pointlessly bumped my post)
@emanresuA maybe minor edits could always go into the review queue, to ensure that they really are minor? Hmm, wait, that's potentially self-defeating...
@emanresuA do you mean for infinite lazy lists of finite lists, for a list of infinite lazy lists, for an infinite lazy list of infinite lazy lists, or for all of the above?
@Adám I still haven't received the packet in my inbox yet - I also checked my spam and promtional inbox and it wasn't there either.
Was it sent to lyxalcgcc {at} gmail {dot} com?
Because I know there's been issues with sending it to my Vivaldi email previously (which I don't use anymore because of the fact it was bouncing emails)
> When you think your challenge is ready for the public, go ahead and post it, and replace the post here with a link to the challenge and delete the sandbox post.
Well, back from the YT comment section with more fun stories
So, there were the normal onlyfans spam bots in replies, and someone was reminding everyone to report them and not click the links, saying it could lead to your account being stolen. Someone else replied saying they were a professional web dev, and clarified that clicking the link wasn't the issue, it was phishing attacks, and gave a brief warning about entering your password on an untrusted site. (1/2)
Then someone replied something along the lines of "wow, this 'professional web dev' (whatever that means) seriously doesn't know clicking on links will steal your account?"
I just love the quotes around "professional web dev", as that's some made up career that nobody's ever heard of
Or is it like, an implication that web development is inherently unprofessional :p
I really think the majority of attempts to teach people about basic online security go about it all wrong. Instead of simple rules like "don't click links in emails", "don't use passwords with just letters", etc., concepts like what a browser does sandboxing-wise and how phishing, password brute forcing, and so on actually work would do a lot better of a job at teaching people what to actually be careful of
yeah, I think the oversimplification is an issue cuz people don't really understand what the primary issues are and just remember some key "bad actions" (which are hard to remember with zero understanding anyway, on top of not being extendable to other things meaning the phisher will always be one step ahead with every new scam)
It's like how a bad teacher just tells you what to do to pass the test, while a good one gives you an understanding of why it works and that sort of thing
def dyadic_vectorise(fn, x, y, rfull=True, lfull=True):
dx = depth(x)
dy = depth(y)
if rfull and lfull:
if dx == dy:
if dx != 0:
return [dyadic_vectorise(fn, a, b) for a, b in zip(x, y)]
else:
return fn(x, y)
else:
if dx < dy:
return [dyadic_vectorise(fn, x, b) for b in y]
else:
return [dyadic_vectorise(fn, a, y) for a in x]
elif (not rfull) and lfull:
def reshape(x, y):
x = it.cycle(flatten(x))
y = flatten(iterable(y))
if len(y) == 1:
return [next(x) for _ in range(y[0])]
else:
return [reshape(x, y[1:]) for _ in range(y[0])]
n Push the context variable n, 1 in global scope
>< Push an empty compressed integer = 0
?( Input times...
Example with stack = [2, 3]
: Duplicate [2, 3, 3]
} Rotate stack right [3, 2, 3]
+ Add [3, 5]
And the next pair is now on the stack
The last one is implicitly output
def reshape(x, y):
x = flatten(iterable(x))
y = flatten(iterable(y))
if len(y) == 1:
return [(x := x[1:] + [x[0]]) and x[-1] for _ in range(y[0])]
else:
return [reshape(x, y[1:]) for _ in range(y[0])]
@emanresuA I'm disappointed in myself, because I thought of spoiler after guess #2, but I thought it was too uncommon to be the real answer, so I guessed spoiler for my 3rd. If I'd remembered @lyxal's joke from yesterday I would have got it immediately :/
Halfwit -A, 15 bytes
>JM?M;J*?f?*M[?JN;k+Jkk;$<5b
Try It Online!
Halfwit is an experimental golfing language that fits most commands in half a byte. It only uses lists and integers, so the -A flag allows it to output characters.
This approach is pretty simple. The bit between > and < is a compre...
I was solving the problem on Leetcode given here. I noticed everyone is solving it in one particular way i.e.,
Traverse the vector and double all the odd vector elements. This nullifies the requirement for the 2nd operation.
Now, decrease the largest vector element while it’s even.
To store th...
i being the square root of -1, a base-(i - 1) binary number N with n binary digits from d(0) to d(n - 1) satisfies the following equation.
$$N = d(n - 1) (i - 1) ^ {n - 1} + d(n - 2) (i - 1) ^ {n - 2} + ... + d(1) (i - 1) + d(0)$$
For example, a decimal number 15 is 100011101 in base-(i - 1) sinc...
Knight mover
Your task is to move a chess knight between the points B and E.
A chess knight moves in an L shaped pattern, like so:
.X.X.
X...X
..B..
X...X
.X.X.
The Xs mark where the knight in position B can move.
There may be other chess pieces on the board, blocking the knight's movement, but ...
Zhiwei Sun Squares
Given a positive integer n, find the number of ordered tuples (a, b, c, d, e) over non-negative integers for which a² + b² + c² + d² = n and b + 3c + 5d = e².
Note: A conjecture by 孙智伟 (Sūn, Zhìwěi) states that this count is always at least 1.
For example, if n is 9, there are ...
The travelling sales man problem
The travelling salesman problem (TSP) asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?"
In this puzzle not nec...
the only time i can remember ever using space in jelly was with converting UDLR or whatever to complex numbers and there was absolutely no reason i couldn't have used ¹ instead
the space was just an aesthetic choice because you almost never can use it
The Balanced Centrifuge Problem
A Centrifuge is a piece of equipment that puts multiple test tubes in rotation at very high speeds. It consists of a cylindrical rotor with holes situated evenly along the circumference of the rotor. Because the device is operating at high speeds, the center of mas...
Is it a tower permutation?
A tower is made out of layers, each one being one unit shorter than the one below it. Every layer is completely on top of the previous layer. For example, here is a tower along with it's height map:
#
##
###
####
#####
14532
Because the lengths of the layers are t...
I am using WSL for the first time. It is cool but grep is confusing me. If I want to find lines in a text file with names in them I would normally do grep ^[[:upper:]][[:lower:]]*$ but that doesn't work in WSL. Anyone know what the WSL equivalent is?