« first day (2711 days earlier)      last day (2134 days later) » 

6:00 PM
That's what I thought but it doesn't work
Is that supposed to work?
 
Which synonym are you trying to vote on?
 
Well at this point any one I haven't proposed.
Initially I just wanted to vote on
The entire synonym interface is absurdly obtuse.
OH, you have to go to the master tag not the synonym
Man that's dumb
This is so awful.
 
When you suggest a synonym a vote box shows up on that page, which implies that you vote on the synonym page, however if you navigate away and back it's not there because you need to go to the master page instead.
 
@Adám If the falsey output is allowed to be different for different input lists, then Pip, 3 bytes: MNg (gives nil instead of 0 when the list is empty). Otherwise, MNg|0
 
6:16 PM
@Adám C#: l=>!l.Contains(false)
 
@Pavel What does that return for an empty list?
 
Oh nvm
@Adám F#: let rec f=function|[b]->b|true::t->f t|_->false
Probably not optimally golfed, at all.
AKA: If the input list has one element, return that element. If the first element is true, check if the rest of the list is true recursively. Otherwise (empty list or first element is false), return false.
Could be a bit shorter if you substitute true/false for 1/0.
 
@Adám Python: lambda l:all(l) and bool(l)
Probably not optimal but I can't think of a way to do it in just one check
 
@Adám F#, better golfed: fun i->(Seq.all id i)&not<|Seq.isEmpty i
 
@Theo s/bool/len saves you 1 byte
 
6:29 PM
If you don't mind getting 0 for false, that is.
 
actually, it should be lambda l:len(l)and all(l)
 
@EriktheOutgolfer Yeah ofc no idea what I was thinking
 
or even lambda l:len(l)*all(l)>0
 
Ooh that one's good
 
@EriktheOutgolfer Ooh, nice. That looks like a QBasic trick right there. ;)
 
6:32 PM
or: lambda l:min(l+[0])
(might return 0 instead of False)
 
Won't that give 0 all the time?
 
oh right
 
(I already thought of that myself. :P)
 
you want max, right? I'm dumb
 
lambda l:min(l or[0])
 
6:33 PM
Yeah
 
no I don't want max
 
Then it would give True if there was any true
 
max(0,0,1,0,1)==1
nindja
 
This one's longer, but I like it anyway: lambda l:sum(l)==len(l)>0
 
and invalid too
sum([])==len([])
 
6:35 PM
Which is why the >0 is there.
 
I don;'t think operators right associate, do they?
 
Python's comparison operators are confusing >_>
 
s/confusing/awesome
 
Oh. Guess it does
 
6:36 PM
a<w>e<s>o>m>e
 
I have a 34 byte brain-flak answer, anyone wanna try to beat me?
(inb4 cat-wizard)
 
I love posting my wildly sub-par answers here and just watching literally everyone destroy me
 
@Theo Python's comparison operators work just like they do in math: a > b > c means "a is greater than b, which is greater than c." So sum(l)==len(l)>0 means "sum of l is equal to length of l, which is greater than 0."
 
just like they do in math?
(sum(l)==len(l))>0
I don't think so
 
Yeah
It's evaluating the len(l)>0 first, no?
 
6:39 PM
@EriktheOutgolfer That's not math, that's C.
 
@DJMcMayhem What's the CMC?
 
a > b > c compares the b > c first I'm pretty sure
 
beat drop
 
9 hours ago, by Adám
CMC: Given a Boolean list, return whether it is all true AND length>0. E.g. [true,false]false. [true,true]true. [true]true. []false.
 
Are we assuming that true is 1?
or non-zero
 
6:41 PM
I have no idea
I didn't assume either
 
usually it's whatever it is for your language
(note: that's subjective)
 
@DJMcMayhem What does that mean?
 
for example, all non-zero values are truthy in Brain-Flak (that is, unless negative ones are falsy and I've forgot stuff)
 
@CatWizard Sorry, I mean I didn't think about it, but mine will work for non-zero
 
6:42 PM
@Theo Nope. Python docs: "Unlike C, expressions like a < b < c have the interpretation that is conventional in mathematics... Comparisons can be chained arbitrarily, e.g., x < y <= z is equivalent to x < y and y <= z"
 
btw the bottom of the stack is an infinite pool of zeroes in Brain-Flak heh
 
I don't know why other languages don't have chained comparisons
 
Yes, but there is also a stack-height operator, so there are explicit and implicit 0's
 
Oh so essentially you're doing sum(l) == len(l) and len(l) > 0
 
So annoying
 
6:43 PM
I'm just dumb
 
@DJMcMayhem I mean, below an empty stack are zeroes
 
2
Q: Eating fish, growing in size

ScathYou are fish in a pond that needs to survive by eating other fish. You can only eat fish that are the same size or smaller than yourself. You must create a program that takes a shoal of fish as an input string. From this you must work out how many fish you can eat and ultimately the size you will...

 
Yeah. I'm just pointing out that those zeroes are different than real zeroes on the bottom of the stack
 
@quartata I agree! They're a little harder to implement, but not THAT hard. Pip has them.
 
@DJMcMayhem 30
 
6:45 PM
it's really just chained-comparison ::= expression rel-operator [expression | chained-comparison]
 
@CatWizard Hmm. That's almost the exact same solution as mine. Why does yours have <{}> where the wiki has (<{}>)?
 
@DJMcMayhem 22
@DJMcMayhem The stack only has one thing so when I pop, there is guarenteed to be a zero.
 
@CatWizard ([]<{}>[[]]<>) is really clever
 
6:48 PM
@Zacharý Think we're gonna get past 200 on this one too?
 
Don't need to zero because it can only ever be zero.
 
@DJMcMayhem wait...
 
Yes?
 
I mean, wait until he, uh, finishes first...
 
It's still clever
 
6:49 PM
@Adám JS, 17
 
Ok I don't think 20 can be beat.
 
@Theo Maybe: but we don't have a Stasoid/chance war there.
 
now do it in Brain-Flak Classic :P (jk no way one can do that)
 
@Zacharý I say we forbid them from answering until there's an accepted answer, then let them have at it
 
Clever. That should be possible in a few languages. Edit: Actually, nvm, 'cause JS.
 
6:50 PM
btw the 30 has got a star but there's also a 20
 
Fixed :P
 
@EriktheOutgolfer Sorry I'm slow on my stars
 
wow, that does remind me of Contact
 
@Theo No. Let's just try not to summon them until we're stuck.
 
@Zacharý Sounds like a good plan
 
6:55 PM
CMC (That might be moved to main): Write the longest program such that the program errors, however removing any continuous substring of the program causes it to run without errors.
 
you wat D:
 
@CatWizard That eliminates any languages where any sort of 1-character program will crash
 
@Zacharý 2 answers in like an hour, on a roll
 
6:57 PM
@Theo Not certainly, as long as the first and last characters of your program run fine it may be possible.
 
True. Sorry I was just kinda thinking out loud
 
HOLY HASKELL.
 
No problem.
I spent the last half an hour trying to come up with a python program of length > 1. And failed.
 
Of length > 1?
 
yes?
 
7:00 PM
print'Hello, World!'
 
Doesn't pretty much every valid python program have length > 1?
 
Sorry a python answer to the CMC of length > 1
 
Ah. Gotcha
 
@Theo Digit, space(?), newline, comment, tab(?).
 
space and tab both work
 
7:01 PM
semicolon
Oh no it doesn't
interesting.
 
Nope
Otherwise something like ;0 mighta worked
 
@CatWizard QBasic, 41 bytes: 9999999999999999999999999999999999999999
 
I thought there might be something like that.
@DLosc Can you add a byte by using 1s instead?
 
@CatWizard APL, ⎕←
 
No, I tried. It seems valid line numbers can have up to 40 digits.
 
7:03 PM
Integeresting.
 
Same length restriction applies to labels, incidentally.
And variable names.
 
@dzaima How does that work? I don't know APL.
 
@CatWizard takes no args. By itself it returns an input line evaluated. is set a variable. ⎕← has no right arg for it, but by itself () it evaluates to the function of itself
 
←← should also work
 
@CatWizard Dyalog APL, 6146 bytes: Try it online!
 
7:10 PM
Hahaha... QB64, 42 bytes: 99999999999999999999999999999999999999999
 
It seems like there is a prevailing strategy
 
ngn
@Adám ngn/k: {7!&/x} (or in some future version: 7!&/), note that maxlong mod 7 is 0
 
@CatWizard It makes sense. The best way to make sure that deleting any character removes the error, is to make all the characters contribute to the same error.
 
Yeah. I'm thinking of requiring there be no reapeating characters
But that challenge would be brutally difficult. I've yet to see a score better than 2.
 
Then all the answers would be 1234567890 :P
Oh, I guess that wouldn't error.
Nvm
 
7:15 PM
would something like this 1<==0 in python spark any ideas for anyone?
 
more likely 9876543210
 
It works if any of the operators are removed, but not either of the numbers
 
@Theo Ewauls are hard, because you basically can never start or end a program with = unless there is a comment.
 
CMC: What's the longest English word of length N, where you can make a chain of N English words where each word can be formed by removing one letter from the previous word?
For example, fine works because fine -> fin -> in -> I are all words, but the does not work because the -> he -> ?? has length 2 instead of 3
 
@CatWizard But then you need to find a language where that is out of boudns
 
7:19 PM
@DJMcMayhem Hm. Puzzling.SE has done stuff like this, but I think they allowed anagramming at each step. The max length was something like 18. Without anagrams, it'll be rather shorter, of course.
 
I think we've done this too in chat before.
 
Is the -> he invalid, or is it just a chain of length 2?
 
It's a chain of length 2, but the goal is to find a word length n with chain length n.
So it's invalid for the CMC because it's too short (even though it's a valid chain)
 
7 letters: PLANETS -> PLANET -> PLANE -> PANE -> PAN -> AN -> A
 
@CatWizard I've done a very similar CMC, but that was for words where every prefix is also a word
 
7:21 PM
spinned -> pinned -> pined -> pine -> pin -> in -> I
sliders -> slider -> slide -> slid -> lid -> id -> I
 
spineda -> spined -> spine -> sine -> sin -> in -> I
 
What is spineda? it's not in my dictionary
 
Oh looks like it's a place. Probably invalid. It showed up on thefreedictionary.com which has a useful tool for this
 
supines -> supine -> spine -> pine -> pin -> in -> I
 
Looks like 7 is the one to beat
satangs -> stangs -> tangs -> tang -> tan -> an -> a
 
7:33 PM
hi all
 
@Theo Apparently satsang is a word, so satsangs -> satsang -> satang -> stang -> tang -> tan -> an -> a
New record :)
 
Wow can't believe I missed that
Well done
Wonder how hard this would be to code up
 
how about this slightly tricky question. Given two sets of integers X and Y of sizes m and n and m<n, find a bipartite matching (missing out n-m integers in Y of course) that minimizes the sum of the absolute differences of the pairs of integers. The tricky part is to make it run in O(m^2 + n) time
 
snowing -> sowing -> swing -> sing or wing -> sin or win -> in -> I
 
complexity challenges are no fun imo
4
 
7:36 PM
atheists -> atheist -> theist -> heist -> hist -> hit -> hi -> I
 
@Riker :(
 
I mean I just do'nt find htem interesting
@CatWizard nice
 
@Riker understood.. this one may be a bad challenge
but some are fun
 
def isFine(word):
    if not isWord(word):
        return False

    if len(word) == 1:
        return True

    return any(isFine(word[:i] + word[i+1:]) for i in range(len(word)))
@Theo ^
Just need to hook up isWord
 
7:39 PM
are you on mobile still
 
@DJMcMayhem I'll do that real quick, won't be super efficient tho
 
@DJMcMayhem startling -> starting -> staring -> string -> sting -> sing -> sin -> in -> I
2
 
@Neil Well done
 
@Theo No, but I don't think it get's exponentially slow until 15+ letter words or so
 
@DJMcMayhem Yeah, but it won't be great for actually finding them
 
7:43 PM
@Theo True... How about this?
fineWords = {}

def isFine(word):
    global fineWords

    if not isWord(word):
        return False

    if len(word) == 1:
        return True

    return any((word[:i] + word[i+1:]) in fineWords for i in range(len(word)))

for word in sorted(wordList):
    if isFine(word):
        fineWords.add(word)
Trades time inefficiency for memory inefficiency :P
 
That's my kind of tradeoff
I was thinking it might be more efficient to work from the bottom up, considering that you can for example only start with i or a, then only go to an, at, as, ah etc.
 
This sorta does that
 
Except that you're essentially checking for each word
There's a lot of words in the english language to check
 
strimmers -> strimmer -> trimmer -> trimer -> timer -> time -> tie -> ti -> I
 
You missed a step between time and ti
 
7:47 PM
Fixed, thanks
 
Oh shit that's 9
 
I believe there already was 9
 
no only 8
 
startling is 9
 
.oO(What's a strimmer)
 
7:48 PM
It's a variety of lawnmower. It might be a trademark.
 
Turns out not only can I not code, I also can't count
 
@Pavel weed eater
 
string trimmer
 
Someone should write a script that operates on /usr/share/dict/words
 
already running DJ's on it
at 'r' so far, gimme another 60 sec
 
7:50 PM
You could do this really efficiently with a suffix automata I think
Hmm
 
10: branchiate
 
Rod
[wheatley -> wheatly -> wheaty -> wheat -> heat -> hat -> at -> a] wizard
 
according ot the program
 
What's the breakdown?
 
7:53 PM
not sure checking
 
brachiate is a word is branchiate?
 
I think so
 
@CatWizard It means having gills
 
Well brachiate is probably the next step then
 
hold up I think I did it wrong
 
7:55 PM
D:
 
Hello Code Golf people!
 
I can't tell yet I accidentally crashed my text editor
 
ngn
@Rod why not add an -s? if Wheatley is a surname, the Wheatleys are the family bearing it
 
@TheMattbat999 Hello!
 
hey @TheMattbat999
 
7:56 PM
@DJMcMayhem hello. I have a very simple question. What is Code Golf?
 
It's a competition to write the shortest code to achieve a particular task
 
Rod
is programming, but useless fun
 
Rod
@Riker nice pic
 
Oh ok. I was confused. I seen the site, and read a few questions, but had no idea what the purpose was. Thanks!
 
7:58 PM
Useless until someone writes the fastest implementation of the Pi function ever: codegolf.stackexchange.com/questions/74269/…
 
@Rod my laser cat? huh ok
thanks lol
I think wheat made it actually
 
Man the starboard has kindof been ruined.
But I guess that's ok.
 
yep
 
Rod
@Riker that makes more sense now lol
 
@CatWizard Hopefully that's a bit better now
 

« first day (2711 days earlier)      last day (2134 days later) »