« first day (1695 days earlier)      last day (3163 days later) » 

6:00 AM
You could always just append empty strings to make them equal
 
But in Python, the iterables just drop extra elements. So we can make it work
My psuedocode doesn't work though
Ahhahahaha
 
Are you simply trying to split a string in half?
 
Yes
I can't figure out how to do so without an integer counter...
Ah I got it now!
For c_pair in zip(s1, S):
   push the char from S to s
That's the first half of the string :-)
Now for the second half....
 
I think I found a way
One second
 
I have a way to get the second half as well.
If we reverse S, zip that with s2, and then reverse it again, we can enumerate over it to get the second half (this psuedocode is in the style of python)
Okay it's possible!
This is hilarious, however
 
6:05 AM
Technically a boolean is an integer :P
0/1
 
Not in many languages
In python, it is
 
Yeah
 
In Java, it isn't
But I think you can be lax on allowing booleans ;)
I hope this works with the complexity. Hmm
I can't see how the complexity isn't O(n log n)
Which is supposed to be too small
I'm pretty sure the time complexity remains O(n^log_2 3)
 
Ok so
How did you get the first half of the string?
 
But this is only if the algorithm analysis for regular Karatsuba uses O(n) for splitting the digits into two. If every operation it was composed of was O(1), then I just made a O(n * n^1.585) algorithm, which is really slow.
Here let me write some python code
 
6:14 AM
Alright
 
You might want to allow specific constant digits for indexing purposes...
 
I was thinking that myself
unsigned integers need to be allowed
 
No, because that breaks the rest of the requirements.
 
Which ones?
 
But if you, say, allowed the numbers 0 through 9, it becomes much easier (a good thing). If you allow 0 and 1, it works.
It breaks the no-numbers rule
def first_half(s):
	flag = True
	half_of_length = ""
	for char in s:
		if flag:
			half_of_length += "x" # Assumes this is constant
		flag = not flag
	result = ""
	for pair in zip(s, half_of_length):
		result += pair[not True]
	return result
The pair[not True] was trying to get around indexing with 0. Which only works since python's bools are integers...
But I'm not storing it... Hmm.
 
6:19 AM
You can use False for 0 in Python
 
Oh. Duh
*facepalm*
 
I used it for list indexing :P
 
So there. My code there gives you the first half of a string in O(n) time
 
So we are or aren't on track?
 
I think. But I'm not sure what the algorithm on the wiki page is assuming for getting the first half of a string
 
6:23 AM
How would old length strings work?
Odd as in not even.
 
Wait, we're good
> Karatsuba's basic step take time proportional to n
My function gives the first half plus the one digit after
 
def second_half(s):
    return first_half(s[::-True])[::-True]
You can use this to get the second half.
 
That's way simpler than I was about to do
 
:P
Reverse the string, get the "first" half, and reverse it back.
 
But it might duplicate a digit
Careful
 
6:27 AM
If the string was odd numbered, yes it would.
 
Just iterate over the first half, and ignore those, then add the remaining to a new string
Still doable
 
What do you mean?
How would you tell whether or not the string had an odd length?
 
def second_half(s):
	fh = first_half(s)
	result = ""
	for char in s:
		if fh:
			fh = fh[:-True]
		else:
			result += char
	return result
first_half('11122') # => 111
second_half('11122') # => 22
@ZachGates I think you should allow unstored literals for list-indexing
 
I agree
 
But just call it "indexing", because string-indexing and list-indexing might seem different
It's just that some languages don't allow for using True / False as numbers, and it does seem to be abusing the rules.
 
6:35 AM
Well
Currently, they are allowed
You just won't win the bonus
 
Oh
Ahhh
 
> If you can come up with a program that doesn't use any of the digits 0 through 9, not including within string literals, you can take take a bonus of -5%.
 
Okay I think your question is a really interesting one right now
 
We should probably wait for other people to agree. Because my opinion doesn't accurately portray the community's anymore.
 
6:38 AM
Former question stands
Am I missing any details we discussed?
 
I don't think so. I upvoted, so I think it's good for posting, but others might not yet
I'm going to submit an answer; it looks very interesting.
 
No one else seems to be online at the moment.
Except possibly Dennis
 
Yeah, so I think we should probably wait for more opinions
 
I'll give it another few hours, then post it to the main page.
Then: Que Sera, Sera.
 
I'll be asleep by then.
What's that mean?
But I hope by "post it to the main page", you mean edit your deleted question.
 
6:45 AM
I do
 
Okay
 
It does, sadly, have a current score of -1.
Hopefully that won't deter anyone from reading it.
 
Yes, but that will be fixed when I get online
 
Haha, alright.
 
There, I favorited the question. Hopefully that means that I'll remember it
 
6:48 AM
The deleted one?
 
Yes
 
I'm going to undelete it, edit it, then redelete until I get more feedback.
 
Fine by me
Ha! Snuck in an upvote
 
Haha, that was a fast one.
 
Actually, why do you need to redelete it?
 
6:51 AM
I haven't yet. I was thinking the same thing.
Perhaps vote to reopen?
 
I was about to
 
Apparently I already did. Don't recall it, though.
 
I did, though
I only see one reopen vote
 
Same
Strange.
 
Yes, really strange. Maybe we encountered a bug O.o
 
6:55 AM
Perhaps we have
Maybe my vote is just too invaluable to give a single calculable number :P
 
idk
@xnor Do you mind looking over Zach's question to see if it's sufficient?
(that is, if xnor is currently active... it looks like it since the avatar is before Dennis's)
 
Not anymore once I refreshed the page.
 
Darn
 
I see
Oh well.
 
6:58 AM
I'm contemplating leaving a comment for isaacg to recommend reevaluating his close-vote.
 
That's not a terrible idea at all
 
> Since the close of this post, I've made significant edits to the content question. I would appreciate if you'd reevaluate your close-vote. Thanks.
Thoughts?
 
Sounds pretty good
 
content of the question*
 
Well, it's well past time for me to go to bed. It's 1 AM....
 
7:00 AM
2 AM here, haha
(That link only shows the correct time for my location if you're in MST.)
 
I am in MST
 
Are these code comments in the correct format?
It feels a bit wide to me. I've never commented in CJam, though.
 
It's fine. When I do cascading comments like that, I often do compress it, however
Here's a more interesting one of the new posts I've made codegolf.stackexchange.com/a/55265/9498
Basically, sometimes I'd put in ...s and stuff to format it "nicer". If it's feasible to try and make there be no horizontal scroll bar, that is.
 
Eh, hardly a good use of time, though.
Perhaps when I have some free time during school.
 
I really should get to implementing the lexer for my CS class... rather than trying to just learn Boost's MSM library, I should probably start using it
The lab is due this Thursday...
 
7:11 AM
Fortunately, my classes require no brain power whatsoever, so I have nearly the full day of free time.
The American Public Education System is suboptimal to say the least.
 
Yeah
I've learned about it recently. Through friends.
 
You must be privately schooled?
 
I was homeschooled. I'm going to BYU Provo now.
 
Ah, gotcha. I wish I could take some college courses /:
 
Sorry...
What are you interested in? Computer Science? Math? Engineering? English? Art? Music?
 
7:15 AM
I've had to settle for explaining my mediocre projects (no matter how fun they may be) to patronizing teachers.
Comuter Science, Math, Engineering, Architecture, Art, Music, Automotive, Wood-working
 
That's a lot of good things to be interested in.
My CS classes here have been boring so far. They didn't teach my anything new. The one this semester doesn't teach me anything new, but it gets me to implement new things (I've never actually implemented a lexer, parser, interpreter before)
 
I've taken a few IT classes and they aren't anything to talk about. Mostly just explaining bits and bytes.
Histories of operating systems and such, also.
 
Okay. But did they at least teach you about nybbles?
 
Also, you can add Astronomy, Marketing, and Web Design to my interests list (above).
If you're speaking about these, then no.. Sadly, I had to learn about such things myself.
 
Aww but it's so much fun to see how creative mathematicians, computer scientists, engineers, and physicists are at naming things.
Up quark, down quark, left quark, right quark, strange quark, ...
 
7:29 AM
What about the U L X Δ R1 O O O L2 quark?
 
There's such a thing? Hooray for physicists.
 
Check the link, haha.
 
@ZachGates I don't get it
 
Your "up quark, down quark, left quark, right quark" comment reminded me of the good ol' cheat codes of the ancient systems.
Smashing buttons to find new cheat codes.
 
Okay
 
7:35 AM
My International Talk Like a Pirate Day challenge got far less recognition that I was expecting.
 
Haha
 
Ye scurvy landlubbers don't know a good question when ye see one.
Well, I'm off to bed. I need to be up in a few hours.
Goodnight
 
Night
(I'm sleeping too)
 
Had to come back and brag real quick, it looks like my latest question is "hot".
 
8:21 AM
^ broken one box!
 
8:54 AM
presses panic button
 
Sep 12 at 6:00, by Optimizer
OMG CHAT IS BROKEN!!! NOW WE WILL HAVE TO GET BACK TO OUR WORK!!
 
Good job it's a Sunday :D
 
 
2 hours later…
10:40 AM
@Calvin'sHobbies So I opened my first box of Froot Loops in ages today... and it turns out that there are only three different colours in German Froot Loops :(
 
am I the only one that believes codegolf.stackexchange.com/q/58311/4162 is just homework?
'only 8 students in 10 years have managed to solve it'
'I don't want to figure out the solution again'
I just solved it in 5 minutes..
 
Yay! My first ever PPCG answer just went gold - thank you kind voters :)
 
11:16 AM
Ohh well done
Which one? @tricho
 
Thank you!
I won't link to it here - it has enough votes already...
You can see it on my profile - it's the earliest posted
 
Hm it says here that you've had the great answer gold badge twice
One for tweetable mathematical art and another for...
Make a circle illusion animation
 
(I don't mean it's my first gold answer - I mean it's my first ever answer)
 
Ohh I see
:P
 
:)
Six people have gold answers for Tweetable Mathematical Art, and I feel mine is one of the least deserved, so this new gold badge for my first ever answer means much more to me.
 
11:29 AM
@trichoplax It's how I felt after getting gold for Retina or Trash (a plain code golf challenge), after my first golds were for Vigil, Showcase and two Tweetable Maths answers.
 
Some of the most impressive Tweetable Mathematical Art answers are much further down getting seen so rarely that they don't get votes
 
I don't what it is about it, but I find this really adorable
 
uh wait what
 
Its a tricholaxer!
 
11:31 AM
the OP accepted an answer after all those months and it wasn't even the topvoted one? o.O
 
@MartinBüttner yes getting gold for a golf means so much more than for a popularity contest, which is basically just a vote machine
@MartinBüttner See my comment on the question
 
ah, just noticed
hm, Buddhabrot is still slowly climbing towards gold, but it's a shame that your action painting is still so far down the page
 
What I'd meant was that having no accepted answer would allow other answers more visibility, but I think the OP was quite set on accepting something - perhaps for closure
 
Pop cons need a new winning criteria:
Votes divided by time since first posting
 
Annoyingly tablecloths seems to be getting votes faster now that it's not at the top - so that backfired...
@BetaDecay I think long ago there was discussion on meta about that (for answers in general not just pop cons).
 
11:38 AM
@trichoplax If I post a pop con, I'll test out that
 
@BetaDecay If you pick one turtle and stare at it you'll see that it always faces the same way and only moves along a single straight line, not a curve
@MartinBüttner Action painting has at least made it onto page 1, and it still gets a vote every few weeks...
 
that's nice :)
 
I think I only have one sufficiently nifty code golf to warrant gold
but it'll never get it
19
A: Valid snakes on a plane

orlpPyth, 22 20 bytes ql{m+=Z*=T^.j)hCdzlz Try it yourself or run the testsuite. Note the ASCII values of SRL, respectively 83, 76, 82. I abuse the fact that: i 83 + 1 = 1 i 76 + 1 = i i 82 + 1 = -i From here I just keep a variable for the current position and current direction. For eve...

 
@orlp That is nifty. The OP seems to be saying it's invalid but doesn't make it very clear why, and doesn't seem consistent with the description in the question, so to me what you have is valid. +1
 
11:55 AM
@trichoplax it would be trivial to fix it, but the question leaves it undefined
 
Would it be longer "fixed"?
 
maybe by a character or two
 
Then I see no reason to change it as the OP hasn't edited the question
The question seems vague but fairly clearly based on sharing squares being collision, not projecting future moves...
So I think your answer fits the only reasonable interpretation
@BetaDecay um, ignore my previous reply to you - I misread "I don't know what it is about it" as "I don't know what it is about"
Sorry about that
 
0
Q: Tackling old challenges with new, legitimate technology

orlpRight now we have a rule in place that limits answers to language implementations that were made before the question was posted. This makes sense, because otherwise I could invent a programming language after a certain problem was posted that solves the problem in 0 bytes. However, I feel like a...

 
 
1 hour later…
1:34 PM
0
Q: Bob the Bowman!

minxomatBob the Bowman o /( )\ This is Bob. L L Bob wants to be an archer. ############# . / \ <--- bow So he bought himself a (c -)-> <--- arrow ...

 
 
2 hours later…
3:10 PM
1
A: Is this number a prime?

EtoplayHexagony, 29 Byte .?'.).@@/'/.!.>+=(<.!)}($>(<% The readable version of this code is: . ? ' . ) . @ @ / ' / . ! . > + = ( < . ! ) } ( $ > ( < % . . . . . . . . Explanation: It test if there is a number from 2 to n-1 who divides n. Initialization: Write n in one memory cell and...

4
 
holy crap :D
 
Yeah.
I tested it for all integers in [1,...,255].
(I can repond with a link but not ping with it?)
 
wat
Is that guy some random new user? :D
 
Unless he's somebody's sock, yes.
 
why would anyone post an answer for a 500 rep bounty with a new sock ^^
 
3:29 PM
No clue. :P
 
The bounty information is not present on the actual post itself ?
 
which bounty information?
 
the two endless bounties that you put
they are not mentioned in the actual post. (but only in the meta post about bounties)
 
they are mentioned in the answer that is to be beaten
 
3:54 PM
Did the new guy know about the bounty?
 
I'm pretty sure they did
 
4:12 PM
@MartinBüttner One could invent languages and have a sock post challenges where the language can excel. The higher the sock rep the less suspicious...
 
*checks IP cross-reference between Etoplay and Calvin's Hobbies...*
 
I'd be more wary of Histodennis ;)
 
Really tempting to do this in Brainfuck ...
 
Wait since when has codegolf.xyz redirected to the site?
 
Read the doc: codegolf.xyz/readme.txt @NinjaBearMonkey
 
4:27 PM
That's cool. How long has that been a thing?
 
bout three days.
 
Okay so I'm not too out of the loop
 
@minxomat would be cool if it supported user IDs in share links ;)
 
Is codegolf.xyz/users/42844 really too long? :)
 
that's not what I mean
I'm talking about links like http://codegolf.stackexchange.com/a/58347/8478
where 8478 is my user ID
(and a might be q instead)
 
4:36 PM
In this case, SEs DNS ignores the type (q/a) and just parses the two IDs.
 
yeah, but in the case of questions, I'm not sure it works as a share link because of the appended title
oh okay
 
In any case, the fallback mode is always valid: codegolf.xyz/a/58347/42643
 
4:58 PM
does the cypher where you substitute Z-A for A-Z have a name?
 
thanks
 
5:14 PM
@mbomb007, @NinjaBearMonkey, @randomra, @Sp3000, @TheNumberOne: Another, probably even more important, Retina update: there is a new mode for transliteration now. Given two lists of characters and a regex, do character-wise substitution based on the two lists in all the matches. This finally allows basic character transformations without having to list all of them. (Also let me know if you don't want to be pinged with these updates.)
 
Nice :P
 
I'm planning to add a clever case-insensitive mode to that which allows for simple case swapping
so if ~ was the character to activate that, you could swap the case of all letters with T~`a-z`A-Z
also, I'm taking suggestions for further character classes
 
Vowels/consonants?
 
(I had already written that down ^^)
 
Ah :P
 
5:28 PM
for golfing it might make sense to make d and w character classes and \d and \w just escape sequences for the individual letters
 
You could probably use a different character for that instead
Any symbols to spare?
 
well any character could potentially be used literally
but d and w aren't likely to come up often as individual characters
I think I'll change that
fixed. all in the name of golf.
 
5:52 PM
/me makes a challenge where the input consists entirely of d's and w's
 
wow, ~23M USD loss for amazon (AWS down for 6+hrs)
 
0
Q: Concatenation a no. of strings

user45169Given a string P containing n digits and an integer k. A string Q is formed by concatenating k copies of P. How many ways can you remove digits from Q to make it divisible by 5? Two ways are different,if the deleted positions are different. Input: First line containing the number of test cases T....

 
@ZachGates That is a valid point, not nitpicking. With any kind of logic (soft or hard), this task is (literally) impossible.
 
It's not literally impossible. @Justin and I spent quite awhile working to see if it was in fact possible.
Which it is.
 
@ZachGates Did you find a computer that doesn't store data with bits?
 
You referenced the ""You may not store an integer or float value" restriction.
It means that you can't manually set variables to integers/floats.
x = 1
 
6:36 PM
What is "manually"?
 
I wasn't disallowing the use of bits. That makes no sense.
 
Bits are integers.
 
Programmatically*?
 
But var = 65 is the same as var = 'A'.
If you encode in Base 255 or Base 10 doesn't matter, the values are integers.
 
So I'm supposed to write a program that stores data non-programmatically?
 
6:37 PM
@feersum Maybe require the user to remember the current RAM state :D
 
lol
 
I feel like my meaning with this restriction was fairly evident.
Disallowing variables being explicitly set to integers/floats?
For example:
x = 1
y = 1.0
 
What is "explicitly"?
 
See the examples above.
How would you prefer I phrase that?
 
The question does not qualify the restriction against storing integers in any way.
 
6:40 PM
But if you store a char in any variable, it becomes a byte automatically. And at this point it is the same as any other byte.
 
And nearly all of the rules are hopelessly vague.
 
Which ones specifically are "hopelessly vague"?
 
Ok, not all of them, but several
like "integer or float properties"
 
As a whole the rules are highly subjective, sorry.
 
6:49 PM
@minxomat could add some more examples to the bowman challenge? like the expected output when the arrow lands at distance-1, distance or distance+1. also, can the arrow land behind the target? I think you tried to add a rule about that with "no maximum y", but I don't understand it.
 
@ZachGates It might be worth taking a step back: What are you looking for in solutions to this challenge? What do you want people to implement? For example, are you looking for people to implement one of the below O(n^2) multiplication algorithms, and simply want to close loopholes where people could provide solutions without actually having to implement the algorithm?
 
An o(n^2) multiplication challenge is certainly difficult enough on its own. I'm sure someone can dredge up a duplicate though.
 
@MartinBüttner Hm. distance+1 marks the end of the world, after that everything is a miss. For distance there is already a rule ("arrows falling from the sky onto the target").
 
@minxomat it's clear that these are misses, but it's not clear how they should be rendered
 
@MartinBüttner I've added two rules for those special cases. No arrow should be rendered.
 
6:56 PM
k
 
@feersum Exactly. Unless it was done before, that would look plenty... challenging (pun intended) to me. I wasn't familiar with those algorithms before, but after following some of the links yesterday, it might make for a fairly difficult but viable challenge. Say you exclude all bigint built-ins and libraries. Allow all operations on word sizes up to 64-bit.
 
7:14 PM
awww
user image
5
@Dennis ^
 
7:38 PM
@Justin All of my music is synthesized.
 
you knew this was coming.
 
but its a lie!
 
8:24 PM
> +1. Cause, ya know, Java. :)
This is getting out of hand
 
0
A: Sandbox for Proposed Challenges

vihanAverage Character of a String code-golf In this challenge, you will get a string, find the average character code, then the associated character. Example Hello, World -> V We get this by: 72 H 101 e 108 l 108 l 111 o 44 , 32 87 W 111 o 114 r 108 l 100 d + 33 ...

 
Does anybody know an online (ad-free) chess AI where moves are logged (in from-to, not only to format) in plain text?
 
Like an API that you would pass a FEN board over HTTP and it replies a2-a4 or something?
That would be cool. (I should hack it together)
 
@minxomat Does it have to be online?
 
@Doorknob Yes. I always use lichess to play, but the log is hard to parse.
 
8:32 PM
What do you mean, the log? You can download the raw PGN.
Or do you mean PGN is too hard to parse?
 
lichess doesn't offer the raw download. That is why I'm looking for an alternative.
 
Yes it does.
You're referring to something like this, right? (taken from one of my games)
[Event "Daily Atomic Arena"]
[Site "http://lichess.org/JMUu0VpH"]
[Date "2015.09.07"]
[White "ChezZuxX"]
[Black "KeyboardFire"]
[Result "0-1"]
[WhiteElo "2047"]
[BlackElo "1690"]
[PlyCount "44"]
[Variant "Atomic"]
[TimeControl "300+0"]
[ECO "?"]
[Opening "?"]
[Termination "Normal"]
[Annotator "lichess.org"]

1. Nf3 f6 2. e3 e6 3. Nd4 b5 4. Bd3 g6 5. Qf3 d5 6. Nc6 Nxc6 7. Nc3 c6 8. b3 b4 9. Ba6 Bxa6 10. Na4 Bh6 11. Qg3 Bf4 12. Qg4 Nh6 13. Nc5 Bxh2 14. Qg3 e5 15. Qf3 Ng4 16. Kd1 Nxf2 17. Ne6 Qb6 18. d3 h5 19. Nc5 O-O 20. e4 h4 21. Bh6 Rfe8 22. Nd7 Qf2 { White resigns } 0-1
 
Oh there it is. Yep, found it (have to switch to analyze first).
 
You can even bulk-download the PGNs of 500 (IIRC) games at a time via the advanced search.
 
@MartinBüttner Thank you, keep sending them :)
 
8:39 PM
@MartinBüttner You could start a Retina news mailing list :P
 
8:51 PM
1
Q: Break tabs in half

Doorknob Holy wars have been fought over spaces vs. tabs. (And of course spaces, being objectively superior, won.) —Alex A. Some people still refuse to accept that which is clearly supreme. You've just received a file using the incorrect, bad, and inferior form of whitespace, and now the contents o...

 
@Doorknob ^^^ claps
 
Episode III: Revenge of the Spaces
 
Episode IV: A New Hope for Spaces
Episode V: The Tabs Strike Back
Btw @Doorknob, this new challenge looks crazy hard.
But I love the animation.
 
Well, I had to solve the challenge to make that animation, and it wasn't too difficult. :P
(the entire JS file, including the parts that handle the animation, is 71 lines long including blank lines and comments)
 
:O
 
8:57 PM
@MartinBüttner Just a quick note on Retina's readme, the "Operations Modes" section is missing the mention of the new Transliterate mode.
 
Of course, there's a grand total of two comments, one of which is // go through all the spans and do stuff
 
@mbomb007 oh thanks
 

« first day (1695 days earlier)      last day (3163 days later) »