12:15 AM
0

Are these the same time? code-golf time decision-problem Context When asked about the time (i.e. hours and minutes), people naturally reply with any one of a given set of fairly common sentences: (A) it is M past H (B) it is M to H (C) it is H minus M Where M above refers to some amount of ...

0

Mom-rounding the time code-golf time code-challenge Context Growing up with my mother, whenever she looked at a clock to check the time, should would always say "shoot, it's already X!" and then I would look at the clock and realize she was just rounding the time in a really weird way. Task G...

5 hours later…
5:36 AM
4

Is it a Happy Number? code-golf decision-problem A repost of this challenge (if I got the policy right). Given a single positive integer (which can also be taken as a list of digits or a string), output whether the number terminates at 1 . Truthy/falsy follows the language's convention, or you ...

^ Any further feedback for this?

0

Multiplayer Rock-Paper-Scissors Objective Given a nonempty multiset of Rock, Paper, and Scissors, output the winning figure according to the special rule. Background For a multiplayer RPS, if all three figures come out, usually it's considered a draw. But by that rule, the probability to draw...

1 hour later…
6:59 AM
As an Australian having experienced the first day of April already, I can officially say that nothing bad has happened yet.
Yet.
High emphasis on the yet.

1 hour later…
8:15 AM
Anyone wanna host a fastest code version of this challenge?

8:47 AM
0

\$\Theta(N\cdot\sqrt N)\$ sort code-golf restricted-complexity array-manipulation The challenge is to implement an algorithm that sorts an array of distinct positive integers in ascending order. You may input the array and output the result using the default IO methods. However, the worst-case ...

2 hours later…
10:36 AM
hi all
I was hoping this room would be much busier during the lockdown!
@Bubbler I like the idea but can't do it, sadly

10:48 AM
@Bubbler I do!
High emplasis on the sadly.
@Anush The logo for MarkDown is M↓. So, the logo for LockDown should be L↓!

:)

:)Down :↓
Nope. That wouldn't make a good challenge either.
Test case #3: I made this challenge to -> Challenge. Emphasis on challenge.

CMC Write linear time code that determines if two strings have edit distance 1 from each other

@Anush Edit distance 1 means one character different or missing in one?

Exactly.
@Anush 05AB1E, 6 bytes In 05AB1E 1 is truthy, everything else is falsy.
An alternative, øεË_}O
Waiting for other answers for porting...

11:05 AM
@petStorm Explain?

@Adám Interleave; (Each: All-Equal; Logical-NOT); Sum

@petStorm How does that handle Hello vs Helo?

@Adám Haven't thought of that...
@Adám Wait, it outputs 1
I don't have the faintest idea why it works.

@petStorm Hella and Helo also gives 1 though

And so does Hellooo and Helo

11:09 AM
So, the problem was that empty zip results aren't kept here.
It should be quite easy to fix.

@Adám it means that either you made one substitution, one delete or one insertion to get from string 1 to string 2
no correct answer yet

@Anush that test-case is correct though?

@dzaima yes but it is wrong for lots of other test cases
ED(ahahahha , hahahha) = 1

@Anush :|

it gives distance 6
ED(aha, ha) = 1 but it gives 2

11:16 AM
@Anush APL (Dyalog Unicode), 46 bytes {(1=+/≠⌿↑⍵)∨(1∘↓∊(⍳∘≢{⍵/⍨~@⍺=⍨⍵}¨⊂)∘⊃)⍵[⍒≢¨⍵]} TIO

@Adám why do you have 0 as two of the outputs?

@Adám f 'heLo ' 'helo'

@dzaima Ah, right. ⍨
@Anush 0 means not ED=1

ah 1 == True, 0 == False

Looks like Levenshtein difference challenges are too hard for me...

11:19 AM
@petStorm never give up!

@Anush I hope that's a valid output format :-)

@Anush I mean, in a golfing language.

@Adám also, i'm pretty sure that's not O(n)

@dzaima Why?

maybe I should pose this on main

11:20 AM

@Adám {⎕←⍺⍵⋄⍵/⍨~@⍺=⍨⍵}¨ is called with n=≢⍵ n times, and does an O(n) operation → O(n^2)

@dzaima Good point.

CMC: Given a sentence made of only lowercase alphabetic characters and with a separator of a space, remove all insignificant words (i.e. words that have a length of <= 3) and output the last word in the following template:
x. Emphasis on x. (where x is the last word. The former x needs to be capitalized.)
E.g. nothing bad has happened yet-> Yet. Emphasis on Yet.

@petStorm Isn't "yet" insignificant?

length of <= 3 length of < 3

11:42 AM
@petStorm APL (Dyalog Extended), 48 bytes {w,' Emphasis on ',w←'.',⍨1(⌈⍤⊃,↓)⊃⌽⍵/⍨3≤≢¨⍵}≠⊆⊢ TIO

@Anush dzaima/APL, 63. It probably fails some case but i haven't found it ¯\_(ツ)_/¯

12:15 PM
@dzaima If I had any way of reading the code I am sure I would be impressed :)

@Anush it does the basic "count of not equal == 1" for equal lengths, and for lengths of difference 1 it finds the length of the matching prefix & suffix, sums them & tests if that's greater than or equal to the length of the shortest input

that sounds plausible :)
maybe I should move to edit distance 2 now...
does it compute the length of the matching prefix by starting from the left and the matching suffix by starting from the right?

@Anush i think a similar idea could be applicable to do any edit distance in O(n) time (really, it'd be O(n × edit distance)) but edit distance is constant :p) - find matching prefix, chop that off, repeat edit distance times, you should be left with nothing if it's correct

I think that sounds right.

@Anush it takes the 1st & last item on separate copies off of the longest, reverses the one with the 1st taken off, and computes prefix to both

12:22 PM
well actually.. O(n × edit distance)) would be nice for a non-dynamic programming based method
so maybe that is slightly surprising

@dzaima hm, that should be wrong, because you don't need O(n) time to find a prefix, and O(n) time for levenshtein distance is definitely wrong

O(n) time for levenshtein is ok if the edit distance you are looking for is a constant

@dzaima right, that doesn't deal at all with the difference between substitution & removal & insertion, definitely wrong

looking like a better challenge all the time :)

12:47 PM
0

TL;DR: In what circumstances is it ok (by CGCC and politeness standards) to edit directly a post (be it challenge, answer, sandbox question, etc), assuming the edit is done in good faith? I know people can rollback edits and further edit a post, but in the meantime that goes from the unwanted ed...

1:09 PM
Any advice on running a KotH without going mad?
https://codegolf.meta.stackexchange.com/questions/18755/considerations-for-a-low-maintenance-koth

1:23 PM
does anyone here understand the split operation in an avl tree?
if so, could you please explain it to me?

1

I'm working on a King of the Hill challenge for some point in the next couple of months. (Sneak Peek) The problem I have is that last time I ran one it was pretty ambitious, and it became a heavy time-sink while the challenge was active. I've got a job and a family, and pressures of maintaining ...

@AJFaraday imo you've done enough. i'd expect a koth runner to check on new answers regardless of whether or not that's done automatically by the challenge runner, and restarting the tournament is a pretty trivial task (which would probably be better off done manually anyway, or on a time interval, not based on answer updates)
only thing i'd suggest from seeing outcomes of previous koths, more on the sandbox side, - set time limits (if possible, enforced) to prevent a bot brute-forcing for a second, slowing the game down immensely (or even worse - infinite looping!)

0

Word Grid Puzzle Iterator I commonly see an advert for a word-based game, where by removing a word the remaining letters "collapse", horizontally and vertically, leading to further words being findable. The challenge is to take in a grid and a word as an input, and output the collapsed grid aft...

1:40 PM
@dzaima That's a good point, I'm measuring time in 'ticks' (a call to the update method), and keeping the game from then.
Infinite looping would probably break my importer, come to think of it. It wouldn't get in, but it would prevent anything else getting in.

@AJFaraday infinite loops may indeed be hard to get around (proper web worker magic would probably work, but even this thing doesn't allow a game to continue with an infinite loop submission)

Sorry, I've just realised what you mean, time limits on a bot's actions. I'll look into that, not sure how I'd go about it in JS

@AJFaraday it's probably more reasonable to just calculate the average taken time & manually disqualify bots that obviously exceed the required limit

I hadn't considered manually excluding bots, it wouldn't work with my current uploader. I'll have to work in a black list.

in my experience checkboxes are enough, though those don't quite.. work in a CLI environment

1:54 PM
Well, it'd be staightforward enough, just have an array of jerks and don't import entries with the contents as a title or, if someone decides to be a jerk, username.

also, how about adding custom entries to the browser version of the controller?

Fortunately, I haven't had anyone try to wreck the challenge on any of my KotH just yet.
@dzaima Do you mean including them in the menu? That's already implemented.
The bot named 'Imported' is from this answer: codegolf.meta.stackexchange.com/a/18633/16824
Sorry, that's probably not clear from today's question

1 hour later…
3:16 PM
0

Given a compressed string \$s\$ made of printable ASCII characters (32 to 126), your task is to print or return the original text by applying this simple decompression algorithm: Start with \$k=0\$ Look for the first occurrence of \$k\$ in \$s\$ and the sub-string \$s'\$ consisting of the \$2\$...

2 hours later…
5:11 PM
2

Task A date can be compactly represented in a 6-character string in the format ddmmyy where the first two characters (dd) represent a day, the 3rd and 4th characters (mm) represent a month and the last two characters (yy) represent a 20XX year. Given a string with 6 characters in [0-9] determine...

2

In this challenge, submissions will be programs or function which, when given an emoticon such as :-), :(, or :D, will rate their happiness from 0 to 3. An emoticon will be one of the following: :(: 0 :|: 1 :): 2 :D: 3 Emoticons may also have noses (a - after the :). Test cases: :( -> 0 :...

3 hours later…
8:20 PM
0

Inspired by I reverse the source code, ... Your task, if you wish to accept it, is to reverse text and mirror select characters. Yes, yes, I know. Very surprising. Input A string, stdin, an array of characters, or any other source of text. Output The reversed text with some characters mirror...

8:31 PM
0

Check As input you will receive An integer \$a\$ A list of integers that is infinite and strictly-monotonic Your program should check (in finite time) if \$a\$ appears the list. You should output one of two disctinct values. One if \$a\$ appears in the list and the other if \$a\$ does not....