« first day (2477 days earlier)      last day (2373 days later) » 
00:00 - 16:0016:00 - 00:00

4:01 PM
Yes, it can do multi-dimensional arrays
Unless you mean something else
 
@user202729 congrats on Fanatic badge! (a little late but ¯\_(ツ)_/¯)
 
Yes I meant array.
 
CMC: Double a number using only ASCII characters. In addition, it has to be input-safe i.e. no matter how many inputs it's given it returns the correct answer for the first input (to prevent answers such as + in Jelly)
 
@cairdcoinheringaahing I'm not sure what you mean. Extra inputs are ignored?
Should the extra inputs be printed or not?
Either (({}){}) or (({}){}<>) depending on whether or not to print extra inputs
 
@cairdcoinheringaahing (*:2) cheddar
 
4:11 PM
@DJMcMayhem Extra inputs ignored
 
@Mr.Xcoder APL, 12 bytes {∧/⍵∊1,2×⍳4}. 1 for truthy, 0 for falsy.
 
@cairdcoinheringaahing But should they be printed? (In languages that print all input by default)
Cause in brain flak, ignoring input means printing it
 
@cairdcoinheringaahing I think this is literally impossible in APL rofl
 
@cairdcoinheringaahing PowerShell, $args[0][0]*2 (so long as you're given numbers as input and not strings or something)
 
4:24 PM
Shorter way to do this in Ruby?
puts gets.to_i%4>0?"Ok":"A"*10+"!!!"
if input is divisible by 4 print AAAAAAAAAA!!! otherwise just Ok
 
@DJMcMayhem You may do what you want with the extra inputs
 
@MarcusAndrews should be able to remove the >0, ik ruby too well tho
are non-zero values truthy?
 
I did, but it didn't seem to work for whatever reason
 
and/or can you use truthy values in comparisons?
hm ok
 
4:40 PM
how about, you are given a line of digits from 1-9 in any order
but one of the digits is replaced with ?
output that missing digit
input 73?492851 output 6
 
@MarcusAndrews Can you replace puts with p?
 
@cairdcoinheringaahing unfortunately no, but i found a shorter perl anyhow that worked
since you can get an int with <>
 
@MarcusAndrews PowerShell, 30 bytes
 
@MarcusAndrews Just curious, what is this all for?
 
learning codegolfing in various languages mainly, using problems from codingame
 
4:44 PM
Ah ok
The thing is that functions are usually shorter and they’re accepted on PPCG; if you want to compete well here, you might want to try to use those too sometimes
 
in python I have it down to print(45-sum(map(int,input().replace("?",""))))
is there a quicker way to ditch the ? or skip over it when adding ints from it?
 
@MarcusAndrews You can do print(45-sum(map(int,input().replace(*"?0")))) for -1 byte (Python 3 only)
 
we've had a a question for this already
 
probably some shorter ruby exists though
 
I think the accepted algorithm is 9-int(input().replace("?",""))%9
 
4:55 PM
Note that you can create inline code blocks with backticks. `<code>`
@MarcusAndrews Much shorter, 38 bytes print([*{*"123456789"}-{*input()}][0])
 
@MarcusAndrews APL, 12 bytes: {45-+/⍵~'?'}
 
@Mr.Xcoder How about print(*({*'123456789'}-set(input()))) ?
 
@MarcusAndrews Better yet: print(*{*'123456789'}-{*input()}) (33 bytes)
 
wow
impressive haha
 
It would be so much longer in Python 2 xD
 
5:05 PM
If we can output with surrounding brackets, lambda a:{*"123456789"}-{*a}
 
Nope, full program required
 
ಠ_ಠ Why?
 
Because they actually submit this code somewhere I think
 
all of the answers are under 100 bytes and then there's just this one that's 552 bytes lol
 
@HyperNeutrino Almost all are under 50 :P
 
5:07 PM
yes :P
 
And rolf is a good golfer in general... strange
Oh no rofl actually solves the problem. The others are abusing the test cases.
That makes complete sense
 
@Mr.Xcoder How do you know?
 
I am pretty sure on my judgement, that's all :D
 
darn I probably should've added all the test cases in existence
 
Oh it's yours
 
just add all 4096 test cases
@Mr.Xcoder yeah :P
 
Do you solve too or just post challenges?
 
@cairdcoinheringaahing how is that weird
@Mr.Xcoder well I have so far posted 1 challenge and solved 0
 
@HyperNeutrino It makes sense to me, but the mathematical notation abuse is weird
 
5:10 PM
@cairdcoinheringaahing ah ok :P
 
I posted one flawed challenge (test cases) and a "good" one, but solved some more
 
What about this? Finding the max element of a grid that has 4 strictly-lower neighbors, if none exists, output -666
e.g.
3 3
1 2 2
1 3 1
2 2 1

output 3
my current attempt
R,C=map(int,input().split())
g=[list(map(int,input().split())) for i in ' '*R]
s=-666
for r in range(1,R-1):
 for c in range(1,C-1):
  if all(g[r+i][c+j] < g[r][c] for i,j in [(0,1),(0,-1),(1,0),(-1,0)]):s=max(s,g[r][c])
print(s)
 
wrapping or not?
 
no wrapping
 
ok
you have spaces that can be removed
 
5:13 PM
values on edges/corners don't count either since they lack 4 neighbors
 
You can remove those spaces. Ninja'd
 
the values can range from -100 to 100
so I don't believe I can remove them
 
Oh boy you can
 
you have at least 6 extra spaces
 
R,C=map(int,input().split())
g=[list(map(int,input().split()))for i in' '*R]
s=-666
for r in range(1,R-1):
 for c in range(1,C-1):
  if all(g[r+i][c+j]<g[r][c]for i,j in[(0,1),(0,-1),(1,0),(-1,0)]):s=max(s,g[r][c])
print(s)
sorry I thought you meant in the grid itself
 
5:15 PM
@MarcusAndrews Also list(....) is equivalent to [*...]
 
ah right
forgot that
 
I am finally prepared to solve Pyth Practice 2 yay :D
 
-1 byte by doing if all(g[r+i][c+j]<g[r][c]>g[r-i][c-j]for i,j in[(0,1),(1,0)]):s=max(s,g[r][c])
 
@Mr.Xcoder I might try that in Jelly (no posting) :P
 
@cairdcoinheringaahing Sure how about solving all those in JHT rn?
 
5:19 PM
@Mr.Xcoder Given me 10 minutes or so to finish revision, then sure
 
R,C=map(int,input().split())
g=[[*map(int,input().split())]for i in' '*R]
s=-666
for r in range(1,R-1):
 for c in range(1,C-1):
  if all(g[r+i][c+j]<g[r][c]>g[r-i][c-j]for i,j in[(0,1),(1,0)]):s=max(s,g[r][c])
print(s)
ooh we should ask owner to add jelly to anagolf
 
@HyperNeutrino Yes but how shall we contact shinh?
 
good question ¯\_(ツ)_/¯
 
@Mr.Xcoder Contact: shinichiro.hamaji _at_ gmail.com . If you found some bugs or you have some requests (fix problem you submitted, add language XXX, and etc.), please email me.
 
Oh facedesk right
 
5:33 PM
@J.Sallé I contacted him recently and still no reply
 
@EriktheOutgolfer I didn't even know that site existed until a few minutes ago, I just assumed there was some contact information somewhere in there and looked for it :p
 
0
A: Determinant of an Integer Matrix

Leaky NunJelly, 16 bytes LŒ!ðŒcIṠP;ị"Pð€S Try it online!

I'll give a cookie to whomever that can figure out how my code works, and more importantly, why my code works
 
I'm going to go with "magic" and "magic." Do I get a cookie? ;-)
 
@LeakyNun How: Magic. Why: Dennis.
 
0
A: Determinant of an Integer Matrix

Leaky NunJelly, 15 bytes LŒ!ðŒcIṠ;ị"Pð€S Try it online!

I outgolfed Dennis now
 
5:42 PM
Nice
 
@LeakyNun You have my upvote :-)
 
5:52 PM
So LŒ! or equivalently JŒ! gets all permutations of the indices I think
and then ðŒcIṠ;ị"Pð is applied to each of these permutation and summed
 
6:52 PM
Is this a valid C quine?
Or are there rules against compiler flags, even if I add them to the byte count?
 
@MDXF flags allowed, yes they add to byte count. However, the -D flag specifically is not allowed for quines.
 
7
A: Determinant of an Integer Matrix

Leaky NunJelly, 15 bytes LŒ!ðŒcIṠ;ị"Pð€S Try it online! How it works LŒ!ðŒcIṠ;ị"Pð€S input L length Œ! all_permutations ð ð€ for each permutation: Œc take all unordered pairs I calculate the difference between ...

added explanation
I got 7 upvotes before adding any explanation lol
 
@Pavel :(
I'm just rather disappointed that this is still proving ungolfable, despite countless hours of thinking about it
 
@MDXF -Da=main(){puts("a");} and then your code is just a. It's for good reason.
 
That's true.
 
7:17 PM
@HyperNeutrino You haven't been to the Enlist chat for so long that you cannot even be pinged there lol :D
 
0
A: Sandbox for Proposed Challenges

MD XFSANDBOX NOTE I'm serious. This is no less interesting of a challenge than 99 Bottles, or Hello World, or any other simple kolmogorov-complexity challenge. Return the n-th prime code-golf kolmogorov-complexity Write a function that, given a number n, returns the n-th prime. Inspiration. You...

 
161
Q: Is this number a prime?

DennisBelieve it or not, we do not yet have a code golf challenge for a simple primality test. While it may not be the most interesting challenge, particularly for "usual" languages, it can be nontrivial in many languages. Rosetta code features lists by language of idiomatic approaches to primality te...

4
 
@H.PWiz Wow your Hexagony answer to ^ is impressive!
 
I had a nearly identical 32 byte one a couple of weeks ago. And just came back with a fresh mind. :)
 
I want to air my idea for a new language
Its native form is a bunch of arithmetic code tables, and the language automatically and repeatedly does lookups using its current table, stopping once it is told to
A stack is available for computation if needed, and tables can be switched and pished extremely concisely
*pushed
Basically, it is a tring complete compression format disguised as a golfing language
*turing
 
8:00 PM
lol, golfed a byte off my answer for 2spooky4me ... over two years after originally posting it.
thanks @MDXF
 
Anyone here know perl?
Not sure why I can't do this simple thing:
x=<>
print x
nvm, derp
 
8:20 PM
TIL you can search issues sorted by reactions over all GitHub repos. E.g.: github.com/…
 
^ 404
 
Not really
Oh wait, now I get it, too ...
 
Very weird indeed. Anyway, the search query is is:open is:issue sort:reactions-heart-desc
 
Time bomb 404
 
8:25 PM
It has some 45 million results, so it's probably overloaded right now.
 
Don't you just love it when you go through old code of yours and you find a bunch of garbage placeholder strings that you threw in there for testing and then forgot to remove?
property var text: parent.valueList[index] !== undefined ? parent.valueList[index] : "blah blah blah"
 
I once left 'Blah' as a bullet point in the slides for an investor pitch.
 
@mınxomaτ Read your notifications REEEEEEEEE
 
@Fatalize huh
what is REEEEEEEEE
 
A dank cry of anger
 
8:29 PM
@Fatalize I wouldn't have to do that if the damn notification would appear in my damn feed, instead of who starred what and stuff.
 
@mınxomaτ I should just do a whole folder recursive search for anything matching foo|bar|spam|blah|quux
 
@mınxomaτ I audibly gasped reading that lmao
what ended up happening?
 
They didn't see it. It was drowned in buzzwords.
 
lucky you
 
8:31 PM
People on investor roadshows have like 1 to 5 % information retention ...
 
@Fatalize triggered
@MarcusAndrews you're missing sigils in your Perl snippet
 
@ThomasWard Any other distros you like other than Ubuntu?
 
0
A: Sandbox for Proposed Challenges

stellatedHexahedronThe Quantum Drunkard's Walk code-golfascii-artgrid It is well known that a person on a grid under the influence of alcohol has an equal chance of going in any available directions. However, this common-sense statement does not hold in the realm of very small drunkards, whose behavior is very mu...

 
8:55 PM
I believe I have achieved a new record. An entire 45 minutes after clicking the word icon on my taskbar, MS Word finally opened.
 
Do the same test with an Android emulator now
 
@Pavel you weren't even loading a file?
 
Report before the end of 2020
 
@Poke No
 
yikes
 
8:56 PM
the android emulator works fine on my end as long as you have the RAM for it
otherwise it just doesn't even want to open sometimes
 
I tried using an Android emulator once.
The same day I bought a used android for $40.
The two events may or may not have been related.
(Nowadays I have my own Pixel that I can use for testing)
 
what kind of apps have you made?
 
@MarcusAndrews Simple games, mostly.
 
@Pavel Don't use a potato for a computer? lol ;-)
 
@AdmBorkBork My laptop isn't great but this is totally Word's fault. I got VS open in like 45 seconds.
 
9:04 PM
Oh, hah
 
(I opened VS by accident, but not the point)
I should take my own advice and uninstall it really
 
I hear VS is great if your code base is millions of lines, but I've never personally used it.
Unrelated:
> Every software problem is solved through another layer of indirection. Every later of indirection creates a new software problem.
 
@AdmBorkBork Not anymore. We're currently switching devs over to Rider (for a many million lines C# project). VS performance has been degrading since 13 Ultimate
VS remains for Windows driver development. For now.
 
Huh.
 
@AdmBorkBork Reminds me of the Hilbert's Hotel problem
 
9:18 PM
Why has this question suddenly gained so much attention? Its about as old as the site and its definitely not very good.
 
Wow cool question I'm gonna answer it, thanks for the link!
 
@WheatWizard This challenge was marked as active yesterday - one answer/edit and many will follow
 
:p
 
yeah what does active mean though?
 
9:22 PM
And where are these people coming from? After half an hour it should be pushed of the active page
Its quite bizarre
 
@AdmBorkBork Yep. Rider is like the best thing ever.
 
@WheatWizard at the bottom of the 1st page the last active question is 23 hours ago, and I wouldn't be surprised if people looked at further pages
 
Hm things are a lot less active than they used to be
 
@mınxomaτ Just out of curiousity, does Rider support dotnet framework yet, or is your project using Core/Mono?
 
It supports all .NET implementations (core 1, core 2, DotNET any version and Mono)
 
9:29 PM
@WheatWizard It was linked from the Alphabet Staircase challenge somehow
 
Ah I guess that might have an effect
wait thats a new challenge
are we back to this now
 
@mınxomaτ Nice. I've been using Rider for a long time, and it used to only allow Core and Mono. I'm glad that it supports Framework now, but as of late I've found that I can make Core projects for everything.
 
My team and me are basically full stack TypeScript now. Looking forward going native again with hobby projects, but in Go - not C#.
Gogland has been nice.
 
@WheatWizard Alphabet challenges? I hope not.
 
@AdmBorkBork Because Powershell hates the alphabet? xD
 
9:50 PM
@WheatWizard The quine challenge is older than that :P
 
> This is Javascript. The standards have contained confusing and unpredictable edge-case behavior since the language was invented. Changing that now would be ridiculous.
Sounds right :P
 
ffs I got tricked again by SO's review queue red dot
 
@cairdcoinheringaahing I hope that's satire >_>
 
@MagicOctopusUrn Sounds legit to me :P
 
10:20 PM
Hello
Any academics here? I assumed codegolf would have some?
 
@MagicOctopusUrn It is, the website's great.
 
Hi Pavel
 
@Ponponhollamon Do Ph.D.students count?
 
Dennis and Luis Mendo are professors at universities
 
10:22 PM
O.O
 
Maybe Peter Taylor too I don't remember
@Ponponhollamon Why do you ask?
 
So say there is an exam (taken out of 100) and the maximum on it is 79, the average is 48. Say someone curves the grade, then how would the grade distributions be?
Say the class is made of ~~30-35 people
 
Not sure I understand what you mean
 
@Ponponhollamon The average was 48 lol? The max was 79? I mean, what did you get? I used to be a TA, my professor would curve that to be a plus 21.
 
"Someone curves the grade" = ?
 
10:26 PM
Um, I think this guy wins PPCG :P
 
@Ponponhollamon It REALLY depends on the professor though.
 
Ya it was a crazy test. I'm not sure about curving the grade myself, just heard the prof talk about it and I got interested
I've never heard of it myself, so I thought I'd ask
@MagicOctopusUrn Please elaborate
 
wtf is curving the grade supposed to mean!?
 
@Ponponhollamon One of my professors would do a +21 flat to all grades, making the max 100, the rest literally +21 to the score. Usually when tests are that low... I mean, it's the teachers fault.
 
@cairdcoinheringaahing Dennis already won PPCG years ago
 
10:29 PM
@Ponponhollamon The other option is this (more common): calcunation.com/calculator/bell%20curve.PNG
 
So the person with the highest grade wins, right?
 
The teacher gives the "average" grade a C, and if you're above the average/below the average you go up and down accordingly.
@Ponponhollamon Lol yes, essentially.
@Ponponhollamon If you were the 79, you got an A+ for sure.
 
I hate the guy who got the 79 right now
Are there any other techniques to curve the grade?
 
@Ponponhollamon A 48 is still a C, most likely. The ~37 area is when you start getting into D's.
This gives me an idea for a good challenge.
 
How many people do you think would have to get grades lower than 48 to get and average like this?
Is this sort of average a result of many people doing averagely or at least some people doing below average?
 
10:42 PM
@StewieGriffin Yes, picking them was fun :-D There are 11 currently
 
CMP: What is the most hideous regex you've ever written?
 
wat
and how did you find it that fast
 
Because I wrote it fairly recently
 
Is :%s a variant on the substitute command
 
10:47 PM
Yeah, it makes the command run on every line
 
@cairdcoinheringaahing Not sure if hideous, but definitely a monster. It wook me quite a while: github.com/lmendo/MATL/blob/…
 
@LuisMendo Is that string matching for MATL?
 
Yes, the MATL parser has quite a few regex's
 
@LuisMendo How can MATL strings have such a complicated regex and still not support multiline strings in any reasonable manner
 
10:50 PM
IIRC, V's interpreter only uses one regex, and it's not too bad: github.com/DJMcMayhem/V/blob/master/utf8.py#L15
 
@Pavel :-D That's a regex for parsing strings. The parser is complicated
 
ಠ_ಠ TFW your regex for checking if a string is a number doesn't recognise 10 or 1.3
 
@LuisMendo Why not do what normal languages do and \n.
 
Speaking of monstruous regex's...
531
A: Regex that only matches itself

jimmy23013PCRE flavor, 261 289 210 184 127 109 71 53 51 44 40 bytes Yes, it is possible! <^<()(?R){2}>\z|\1\Q^<()(?R){2}>\z|\1\Q> Try it here. (But / is shown to be the delimiter on Regex101.) Please refrain from making unnecessary edits (updates) on the Regex101 page. If your edit doesn't actually in...

 
10:54 PM
@LuisMendo Haha, I tested it and switched to Python flavour. It threw 6 errors then quit :P
 
:-)
@Pavel ¯\_(ツ)_/¯
 
11:24 PM
I found a possibly interesting koth game
 
11:46 PM
sooo ... anyone remember me? Can someone answer this: chat.stackexchange.com/transcript/message/41080541#41080541 please
I think Magic Octopus was going to answer this but then he got inspired and went off to write a code challenge
 
is there a shorter way in Ruby or Python to sum up the alphabet indices of each letter of a word?
s=input()
print(sum(map(ord,s.upper()))-64*len(s))
e.g. Math -> math -> 13 + 1 + 20 + 8 = 42
 
print(sum(map(lambda c:ord(c)-64,input().upper()))) is close, but one byte longer
 
ruby or bash perhaps
 
But if it's for code-golf, you could do lambda s:sum(map(ord,s.upper()))-64*len(s)
 
nah have to count reading/printing
 
11:55 PM
@MarcusAndrews $><<gets.upcase.map(&:ord).reduce(0,:+)-64*$_.length
 
says "undefined method `map' "
*undefined method `map' for "MATH":String (NoMethodError)
 
Sorry, I meant gets.upcase.chars.map
 
someone did 25 in ruby at any rate
no idea how
 
Hmm
 
@MarcusAndrews print(sum(ord(k.upper())-64for k in s))
(1 byte shorter)
 
11:57 PM
Nice
 
print(sum(ord(k.upper())-64for k in input()))
46
 
I've sometimes seen map outgolfing list comprehension, but here it's the other way around :-)
 
somehow possible to cut this in half
 
@MarcusAndrews ?
 
@MarcusAndrews Specifically in python?
 
11:59 PM
ruby
 
00:00 - 16:0016:00 - 00:00

« first day (2477 days earlier)      last day (2373 days later) »