« first day (2481 days earlier)      last day (2361 days later) » 
00:00 - 17:0017:00 - 00:00

5:00 PM
@Neil One.
 
Proton: n=>"\n".join("Happy birthday "+(_-3?"to you":"dear "+n)for _:1..5)+"."
 
@Adám PowerShell, 70 bytes
 
@AdmBorkBork hey cool a tie
 
5:05 PM
@NieDzejkob missing period. Try adding a +'.'
 
@Adám Charcoal, no leading newline, 41 bytes: ≔to youηE⟦ηη⁺dear θ⁺η.⟧⁺”↓$`‖{+≧¶LωF⌀”ι
 
Proton 69 bytes, stolen from NieDzejkob: print("Happy birthday %s\n"*4%((t="to you"),t,"dear "+input(),t+".")) :P :P
 
@Adám Stacked, 56 bytes: voila
 
@HyperNeutrino Now 64 bytes
 
5:06 PM
68: t="to you"print("Happy birthday %s\n"*4%(t,t,"dear "+input(),t+"."))
 
Is there a shorter way to take a list of space-delimited integers and print the ascii-coverted phrase?
gets.split(" ").each{|x| print x.to_i.chr}
 
@AdmBorkBork 59: n=>"Happy birthday %s\n"*4%((t="to you"),t,"dear "+n,t+".")
 
@Adám can we take input with two leading newlines?
 
@MarcusAndrews I don't think so, other than the extra space (I think)
 
@HyperNeutrino Congrats, I think 64 is shortest that I can come up with
 
5:10 PM
yay
 
;-)
 
@MarcusAndrews 31 bytes
 
Now someone should do it in brain-flak :P
 
i see
is gets the quickest way to get and discard input?
 
I believe so
(keep in mind $< holds all stdin)
 
5:13 PM
$< is shorthand for ARGF
 
@DJMcMayhem is there a text generator for brain-flak?
 
@ConorO'Brien No, mostly because it would be crazy hard to make it efficient. However, there is brain-flak.github.io/integer and asciitable.com
 
that sounds like a challenge
I accept
 
Which? Doing the happy birthday challenge, or making a text generator?
 
the text generator
 
5:16 PM
@HyperNeutrino No, wait, 60 bytes
 
ooh nice
 
@DJMcMayhem 0/10 doesn't support 0.
 
Woah, you're right
I didn't know that
Then again, I didn't write it. IIRC @ASCII-only did
 
is there a way in Ruby to print the missing digit from a concatenation of 9 digits 1-9?
 
@HyperNeutrino Yuss, 59 bytes
 
5:17 PM
i.e. 3265?47198
bad example
3265?7198 output 4
 
ooh nice
impressive since proton is inherently meant to be golfier ._.
 
KC can be a strong suit in PowerShell if there's lots of repetition.
 
or is there a ruby way to take an integer n, followed by n lines, print "true" if the line is a palindrome, else "false"
right now I do
for i in' '*int(input()):w=input();print(["false","true"][w==w[::-1]])
 
to take n lines of input try n.times{gets}
 
gets.to_i.times{w=gets.chomp;p w==w.reverse}
is how I do it in ruby
any way to do it even shorter than this?
 
5:27 PM
I had gets.to_i.times{s=gets.chomp;p s==s.reverse}
lol that's exactly the same
 
If there wasn't that first line you could just use the -p flag which was built for this exact purpose. ruby -pe '$_.chop!;$_=$_==$_.reverse'
 
@HyperNeutrino @MarcusAndrews chop is shorter than chomp if you know there's a newline.
 
oh ok
 
mm looks like not always in my case
but good to know -- thanks
 
5:32 PM
@MarcusAndrews It removes the last char, if you don't know that there's a newline it doesn't work.
irb(main):019:0> "foo\n".chop
=> "foo"
irb(main):020:0> "foo".chop
=> "fo"
 
@ConorO'Brien If you're serious about doing this, one really important trick is relevant. If you wanted to print "ABC", the naive approach is to do (push_A), (push_B), (push_C). The important trick is that push_A also returns the value of A, so you could instead do ((push_A)()), to push A and B, and then (((push_A)())()) to push A, B, and C
Does that make sense?
 
how about this one:

n = count of numbers to follow
list of numbers like 45 67 3 109 etc etc

print number of increasing steps and number of decreasing steps
 
@DJMcMayhem BRB making brain-flak text generator challenge
 
e.g.
5
4 7 2 3 7
output 3 1 (because there are 3 increases and 1 decrease)
my python2 approach is 94 bytes, can anyone beat?
 
I'm thinking .
 
5:40 PM
 
@Pavel Uh, ok.
 
@DJMcMayhem yeah it does. I can do this pretty easily I think
is there code available for getting the constant?
 
I just got 100 but definitely golfable
 
5:43 PM
down to 91 on mine
 
0
A: Sandbox for Proposed Challenges

J843136028Triangle Clock Imagine a twelve-hour analogue clock (with a second hand). The hour, minute and second hands have lengths of h, m and s respectively. Given angles a and b (in degrees), what will be the time after midnight when the midpoints of the hands first form a triangle whose angles include...

 
@Adám $_="Happy birthday #{$_.empty?||!$_ ?"to you#{$_?'':?.}":$_}" with -p.
 
@ConorO'Brien Can you make it so that you can toggle whether or not it uses []? Because if you assume the stack starts empty, (or some particular size) then you can save tons of bytes. But you can't always guarantee that the input size is known/constant, so being able to toggle that off would be awesome
BTW, I'd be happy to host it on brain-flak.github.io
 
back to 100 because of incorrect thing
down to 97 again
is I/O format strict?
 
0
Q: Bobby's Booby-Trapped Safe

J843136028Bobby's booby-trapped safe requires an n-digit code to unlock it. Alex has a probe which can test combinations without typing them onto the safe. The probe responds Fail if no individual digit is correct. Otherwise it responds Close, including when all digits are correct. For example, when n=3, i...

 
5:47 PM
@DJMcMayhem does the current method use []?
 
@ConorO'Brien No because that concept doesn't work for pushing individual values, only multiple values
Or pushing an individual value with a specific stackheight
 
ah, I see
 
@Pavel s/\.empty\?/==?\n/
 
I'm thinking about encoding the deltas as the solution using the same "core" method I used for my bf generator
 
@MarcusAndrews What does your code give for 4 7 2 2 7
110 bytes now
 
5:55 PM
2 2
i don't believe you'll get two in a row that are the same
 
oh ok
but that would have been incorrect for your solution in that case but ¯\_(ツ)_/¯
 
my code just checks for what's higher
and subtracts from n
 
ok
my old solution gave 3 1 because it checked for what's lower :P
 
can I see what your solution is?
 
5:57 PM
n=input()-1
V=map(int,raw_input().split())
h=sum(V[i+1]>V[i]for i in range(n))
print h,n-h
 
ah ok
I had this
g=input()
k=map(int,raw_input().split())
s=sum(x<y for x,y in zip(k,k[1:]))
print s,g+~s
(I just golfed it down again after realizing that the print statement behaves differently than how I expected)
 
for the solution that accounts for equal adjacent numbers:
g=input()
k=map(int,raw_input().split())
c=[cmp(0,x-y)for x,y in zip(k,k[1:])].count
print c(1),c(-1)
 
Doesn't Jelly have a prefixes monad?
I could have sworn it had that, or something similar, but I can't find it
 
@DJMcMayhem It has Ƥ (a quick)
If you want plain prefixes, you could do ¹Ƥ
 
6:07 PM
Jelly, 3 bytes: ⁸ƤY
The CMC is gone, but I'm gonna answer it anyway
 
The answer is invalid nonetheless. You add elements instead of removing the first
 
Not true. It just prints them in the wrong order :P
 
@DJMcMayhem You can fix that nearly for free: ⁸ÐƤY
 
Oooooh
Suffixes
Cool
 
Proton: f=a=>a?[a]+f(a[1to]):[a]
Proton: f=a=>[a]+(a?f(a[1to]):a)
same length lol
could be -1 byte if Proton worked properly
 
6:14 PM
What would that be?
 
f=a=>[a]+(a&&f(a[1to]))
 
6:29 PM
@Adám Managed to get it down to 38 bytes: G↑⁴→²¹↓⁴”↓$2I|÷»¿%✳⁺v→↧³J”→↖.P← raedθ
 
@HyperNeutrino is && broken?
@cairdcoinheringaahing LOL, check the console after loading the page
it raises an "error" that says you have not disabled javascript
 
@Riker probably
 
Is there a shorter way to remove the most significant bit from a bunch of numbers?
e.g.
gets.to_i.times{n=gets.to_i;p n^1<<n.to_s(2).size-1}
 
@MarcusAndrews negate them?
 
6:41 PM
?
 
try using binary negation I think he means
 
Is there a shortcut for that in ruby? I don't think negation alone will do it
 
Anonymous
Are you trying to toggle the MSB or the highest set bit?
 
I'm trying to remove the highest bit set
e.g. 500 -> 244
for n numbers (hence my gets.to_i thing)
 
@MarcusAndrews Actually a very nice challenge. Will you main it?
 
6:43 PM
Dunno what that means
 
@MarcusAndrews Will you post it as a code golf challenge on PPCG?
 
oh, sure, but I don't know the formatting yet -- is there a template?
for how you're supposed to post a main
 
it's not too hard
 
all challenges look different so there's not really a template
 
just give a little explanation, then some test cases
 
6:44 PM
@MarcusAndrews I can write it up for you, and then give you my draft.
 
@MarcusAndrews How about n^1<<Math.log2(n) ?
 
if you're writing it you can probably main it rather than me passing yours off as my own
 
@MarcusAndrews It was your idea.
 
###Input###
Input explanation
###Output
Output explanation

###Test Cases###
    test -> test
    test -> test

###Other Rules
 
Anonymous
@MarcusAndrews Python: print(int(input()).bit_length()-1)
 
6:45 PM
@MarcusAndrews ^^, with a little blurb about the explanation on top
 
Is it possible to get notified of new answers on a specific challenge?
 
@NieDzejkob don't think so unless you're the owner
then it's automatitc
 
Anonymous
@Riker Automatic and sleep-disrupting :P
 
maybe something like a chatroom with just that answer's feed? Can you get notified of all messeges in a chatroom?
 
@Mego lol
@NieDzejkob all answers? yes you can
make a chat, find the question's RSS feed link, set it into feeds
 
Anonymous
6:47 PM
Oh wait that just prints the bit, I'm a doofus
 
How do you get notified of all messages in a chatroom, then?
 
@NieDzejkob what do you mean?
comments too? not possible iirc
 
@Mego x.bit_length()-1 -> len(bin(x))-3
 
how do you get notified when somebody posts a message in chat? not possible
 
click the speaker icon in the top left of the sidebar and select "all my rooms"? idk
someone post a message that doesn't ping me
 
6:49 PM
ok
 
yay it made a sound
 
looks like len(bin(n))-2 is a little shorter than n.bit_length()
aaaand Xcoder beat me to it
 
Anonymous
Yep, so 40 bytes: n=int(input());print(n^1<<len(bin(n))-3)
 
@HyperNeutrino not sound notifications, the ones like when there's an answer to your question or a chat reply and you have the room closed
 
oh ok
 
6:50 PM
@NieDzejkob that's not possible
@NieDzejkob if it's your question? automatically left in your inbox
 
that would be really annoying to get like 1000 notifications overnight but no that's not a thing
 
you can set your inbox to email you if it hasn't been read in 30 min/1h/6h/1 day/etc. iirc
@NieDzejkob yeah, it's not possible if it's not your question
 
surprised there isn't a builtin func for msb stuff
 
just searched meta
 
@HyperNeutrino not likely on the OEIS challenge
 
6:52 PM
oh I thought you were talking about chat
you might be able to do some feed magic but idk
 
well, RSS feed readers can do it, but it's not gonna work with your SE inbox
 
unless you make a thing read the RSS feed for OEIS challenge and then feed it back into chat along with an added ping to your username
 
oh true
 
0
A: Sandbox for Proposed Challenges

sergiolLines per file Can't believe it was not questioned yet. I want the shortest script you can supply to take on all files on a directory and output a list in the format file number_of_lines Every possibility should be accounted as a valid line terminator: - <CR> - <LF> - <CR><LF> - <LF><CR> ...

 
@NewSandboxedPosts dupe
 
7:00 PM
0
Q: Clearing the most significant bit from an integer

Marcus AndrewsInput The input is a single integer n Output The output isn with its most significant bit set to 0. Test Cases 1 -> 0 2 -> 0 10 -> 2 16 -> 0 100 -> 36 267 -> 11 350 -> 94 500 -> 244 For example: 350 in binary is 101011110. Setting its most significant bit (i.e. the leftmost 1 bit) to 0 tur...

yes/no/change anything?
 
CMC: Give New Main Posts a hug
 
@MarcusAndrews lol you beat NMP by like 10 seconds but nice job :) see my comment
 
@MarcusAndrews Take a list!
 
space-delimited? newline?
n first?
not sure what the usual format is
 
@MarcusAndrews Any format.
 
7:02 PM
NMP was pretty quick this time huh
also, I wonder how bad the spam would be if somebody fed all new SO questions into a chat
 
@Adám Too late to change it now ;) sorry but it would've made the Jelly solution 1 byte longer and that cannot be tolerated
;)
 
ok I made it into a list format
is it acceptable / better now?
 
I personally think it's better as the old format but that might be just me
 
Anonymous
@MarcusAndrews Don't do that.
 
no, there are answer now so you can't make significant changes anymore
especially since it doesn't add anything to the challenge, you just have to split by newline (cumbersome I/O also is bad) and then map
 
7:05 PM
what hcallenge? his?
 
Anonymous
I rolled it back
 
this is why I didn't want to post it >.>
 
yeah, no, @MarcusAndrews he meant "take the input as a list"
 
I'm not familiar with the standards here
 
you'll get used to it eventually :) also BTW I think the downvote on your question was automated, FYI
 
7:07 PM
@MarcusAndrews generally, leave your challenge the same in terms of what must be done
i.e. single integer input should stay, as it started like that
 
I just think it's weird to ask me to post a challenge, not give all the details, then say some other format would be more fun, and then flog me in the post for not adhering to said nonmentioned standards
>:O
 
you can change that if no answers have shown up but it's generally a good idea to leave it
 
i'm only half-seriously pissed at that
 
@MarcusAndrews yeah, Adam was just thinking what may be fun
:(
 
Please let me know next time
 
7:08 PM
will do
 
Anonymous
@MarcusAndrews The suggestion was for you to post the challenge to main that you had posted to chat. Adam said that a list of integers would be fun, probably because of his obsession with APL :P
 
Anonymous
That in no way means "oh I had better change the challenge drastically to meet that suggestion, existing solutions be damned"
 
@MarcusAndrews Sorry about that. As you made it clear that you were new to the game, we should all have directed you to the sandbox.
 
at any rate -- wow those codegolfs came in fast after posting it
did not expect that, lol
 
Anonymous
@MarcusAndrews That's pretty normal
 
7:13 PM
particularly for simple, if not easy challenges
 
@Mego Yup.
 
That feeling when your code is 3x as long as Python or JavaScript. Feelsbadman.
 
I should stop posting answers
yeah I'm going to stop for now lol
 
7:29 PM
believe it or not
but the challenge regarding binary XOR of rational numbers led me to this integral
wolfram alpha doesn't realize it's an exact 65/252
doing numerical integration instead
 
7:42 PM
0
A: Sandbox for Proposed Challenges

FlipTackIs my barcode valid? An EAN-8 barcode includes 7 digits of information and an 8th checksum digit. The checksum is calculated by multiplying the digits by 3 and 1 alternately, adding the results, and subtracting from the next multiple of 10. For example, given the digits 2103498: Digit: ...

 
for the first time ever I'm at the top of some kind of leaderboard...
then again, it's only tuesday.
 
8:02 PM
@NewSandboxedPosts Hey, I called dibs on that! :P
 
how does the leaderboard work
I'm in #87 at +10 week rep but I've gotten +80 today ಠ_ಠ
 
@HyperNeutrino I have gotten +120 +130 today but +55 shows on the leaderboard ಠ_ಠ
 
ಠ_ಠ Yes we should!
Poll: How much should I wait until I award Leaky the bounty? I wanted to attract attention on it, but it didn't receive any vote today
 
8:12 PM
award it at the end of the bounty period
 
@Mr.Xcoder Wait til the bounty period
ninja'd :/
 
also, question for the Clear MSB challenge: if I do it in minecraft, how should I do I/O? taking it as binary representation through levers seems like cheating considering it's about binary stuff... :P
 
ok, agreed (by the way, I might have delayed replies because my wifi sucks)!
And although Erik has already done this a couple of weeks ago, I sent another mail to shinh asking them to add Jelly to Anagol
 
@Mr.Xcoder I doubt that they will, given that it's for golfing :P
 
huh?
 
8:16 PM
Doesn't anarchy golf only (currently) do "proper" languages, such as Python and Ruby?
 
@cairdcoinheringaahing pff, no, it has Hexagony, GS2, Fish (><>)
 
@Mr.Xcoder In that case, definitely get Jelly there :P
 
(not to mention Labyrinth and Aheui)
 
fish is not really much of a golfing language IMO
 
No but it's not practical either
 
8:18 PM
true
 
and hexagony is definitely not...
 
We should get 05AB1E there too :p /joke
 
What about brain-flak? I've thought about getting that on anagolf for a while
 
some kind of integration with TIO to allow any language on there would be neat...
 
@DJMcMayhem the whole day?
 
8:32 PM
@DJMcMayhem o/ Happy birthday!
 
long live DrMcMoylex :P
 
how about this challenge: given two words of equal length, change one into the other one letter at a time iteratively from left to right
(no duplicates)
 
@FlipTack Who's DrMcMoylex?
 
this minecraft thing is harder than I thought ._.
 
@cairdcoinheringaahing An old joke from the string interleaving challenge, trichoplax + DJMcMayhem = DrMcMoylex
he then changed his name to that for a few months
 
8:35 PM
@MarcusAndrews what do you mean by "no duplicates"?
 
e.g. inputs abcd race

output:
abcd
rbcd
racd
race
 
@Poke At least the first 17 hours of it
 
if you simply changed iteratively without eliminating duplicates you'd have racd twice since you're changing c to c
(not needed)
 
@DJMcMayhem Well now don't be too greedy. Share some day with the rest of us.
 
@MarcusAndrews oh ok makes sense
 
8:36 PM
haha there we go, he's back to McMoylex
 
@cairdcoinheringaahing Tis I
 
@DrMcMoylex Your avatar looks exactly the same as DJMcMayhem's :p
 
Just a coincidence
 
I'm at 113 python3
 
@DrMcMoylex Are you one of DJMcMayhem's socks?
 
8:39 PM
@cairdcoinheringaahing I'm his left sock
 
@DrMcMoylex So is DrGreenEggsAndHam (I think) his right one?
 
It's actually DrGreenEggsAndHamDJ XD
 
The evil DOCTOR MCMOYLEX has arrisen!
 
@MarcusAndrews I've got 82 in PowerShell, taking input as a char-array
 
8:40 PM
I have no socks D;
 
Most people change their age on their birthday, DJ changes his name :P
 
108 python3
 
@DrMcMoylex what happened to DrHamJam
 
8:50 PM
@cairdcoinheringaahing holy crap, I just looked at your profile, you're spewing out languages like there's no tomorrow
 
@ConorO'Brien I changed my name I guess
On Arqade, I'm still @geoham
 
@DrMcMoylex happy birthday
 
Thanks! :)
 
I posted a challenge that may have "practical" purposes in certain situations :D (just kidding, it's not really practical, but probably the most "practical" I've posted so far :P)
 
8:59 PM
0
Q: Minecraft Inventory Management

HyperNeutrinoMinecraft inventory management is hard. You have 17 diamonds, but you need 7 to craft an enchantment table, a pickaxe, and a sword. Do you pick them up and right click 7 times? Or do you left click once and right click twice and take the 7 left? It's so confusing! for those of you who are now co...

 
@DrMcMoylex wut, you're back to moylex?
oh, sock
 
@Riker If it was a sock, why am I still RO?
 
oh, not a sock?
I scrolled really far and found
25 mins ago, by DrMcMoylex
@cairdcoinheringaahing I'm his left sock
 
9:06 PM
@MarcusAndrews SOGL, 11 bytes: {⁴;ēI1ž_}⁰║
 
@Riker That's satire. Has to be, given some of the other articles (SpaceX Lands Man on the Sun, etc.) and their About page.
 
@AdmBorkBork Well of course it is
 
Given the prevalence of "online journalism" one can never be too sure.
 
@FlipTack Only 6 of them are usable/on TIO though :P
Well, one is usable, but not on TIO
 
@AdmBorkBork -1 for being language specific.
 
I'll tag it so that it's okay to be language specific :p
 
-1
Q: Soldiers, Mages & Calvary!

xakepp35Here is logic-math puzzle, i wrecked my brain on solving it :) Consider simple game: Soldiers beat calvary; mages beat soldiers; calvary beat mages; We scouted out enemy and now know enemy number of each kind of troops: Es, Em, Ec; We have limited amount of each troop type: Ps, Pm, Pc; We ha...

 
9:46 PM
@DrMcMoylex I got 244 bytes HW here through the generator. I haven't implemented any coring but rather I am trivially adding/subtracting
 
@ConorO'Brien Coring?
 
shorter way to output the first n terms of an arithmetic sequence given common difference r? (where r >= 0) ?
current approach:

n,r=gets.split.map(&:to_i)
s=""
n.times{|i|s+=(i*r).to_s+" "}
puts s.strip()
 
Thought this title was a typo, but did some research and found that in the US it's actually normal to write travelling with one L
TIL I guess
 
@MarcusAndrews The arithmetic sequence starts at 0?
 
9:57 PM
yes
5 2 -> 0 2 4 6 8, 3 0 -> 0 0 0
 
@DrMcMoylex sorry, my own name lol. no idea if it will work in brainflak, but basically I separate the text into identifiable clusters (e.g. uppercase and lowercase) and modify characters respective from those cores. I feel like for brain-flak's case, I'll only be able to use two cores (one for each stack) but I'll have to review the language
 
shorter:
n,r=gets.split.map(&:to_i)
puts n.times.map{|i|i*r}*" "
(55 bytes)
 
n,r=gets.split.mape(&:to_i)
(0..n).each{|i|$><<"#{i*r} "}
 
@ConorO'Brien Huh. Could you give an example? What would using that technique give for something like... uhm idk how about "AbcD"?
 
@AdmBorkBork well yeah, it's pretty clear satire
funny though
 
10:00 PM
That's actually a bit longer
 
> You will die alone, unmourned, and unloved, but because you do it on live television, you’ll still manage to be considered a success.
 
54 if I remove the ()
n,r=gets.split.map &:to_i
puts n.times.map{|i|i*r}*" "
 
10:16 PM
@MarcusAndrews can you remove the spaces around &:?
 
@HyperNeutrino Sure, but then it doesn't matter whether you grab items efficiently or not if you're gonna die either way
 
well if you stored them in a chest you keep them :P
> You tend to think of yourself as a big, neurotic mess, but don’t sell yourself short. You’re also a big, psychotic mess on top of it all.
hey look a horoscope that's actually correct
 
> Don’t worry: You’re more than just a collection of annoying, loosely bundled neuroses. There are some tightly wound and dangerous psychoses in there, too.
sensing a theme here
 
Yeah I believe so
oh, spaces, no
just the parens
so i save a char
 
@HyperNeutrino No because then it gets parsed as the bitwise AND operator
 
10:22 PM
oh rip
 
10:33 PM
@MarcusAndrews sounds like a code golf poem.
 
11:25 PM
is there a skip-if-error thing in ruby at all?
i have another challenge, iterating over radixes 2-16 and outputting a number in that base if it can be converted as such (printing both the radix and the converted number)
x=input()
for i in range(2,17):
 try:k=int(x,i);print(i,k)
 except:1
shorter:
x=input()
for i in range(2,17):
 try:print(i,int(x,i))
 except:1
 
11:45 PM
what was that shortcut for n+1 again?
-~n?
is there a quicker way to do triangle number n*(n+1)/2 other than n*-~n/2?
 
00:00 - 17:0017:00 - 00:00

« first day (2481 days earlier)      last day (2361 days later) »