« first day (1752 days earlier)      last day (3092 days later) » 

3:00 AM
@Calvin'sHobbies it won't work after a certain amount of time (not sure how long)
 
@ZachGates I've changed names several times per week, with days in between changes
 
Anonymous
@ThomasKwa I highly doubt most moves will come close to 10 seconds
 
@Calvin'sHobbies ): you're just special
 
@ZachGates It will complain if you try to change it on the same SE site
 
@Mego No, the good ones all will.
 
3:01 AM
@Calvin'sHobbies I tried on SO and Christianity, but it wouldn't work
 
Trying to word this meta post but it's so difficult to write it without sounding like an idiot
 
A factor of ten increase in time means about 1-2 extra plies in an alpha-beta search (just guesstimating)
Which is pretty big
 
Anonymous
There, 5 second timeout set
 
@Mego I've run a few KotH. It's constantly surprising how long some entries take. Whether they will in your case or not, it's best to plan for worst-case.
 
Would asking about input methods for Minecraft be considered a dupe of the machine code one?
 
3:02 AM
I'd still go with 1 second
Your choice though.
 
Anonymous
Hmm
 
@quartata IMO no.
 
@quartata but according to previous evidence, you are one, right? :P
3
 
Anonymous
I'll stick with 5 for now, and run a few tests
 
@Doorknob ...
maybe..
 
Anonymous
3:04 AM
If the crap that I write takes the full 5 seconds, I'll consider changing it
 
Anonymous
Actually... No. 1 second will work.
 
For this kind of game, it's very advantageous to search for the full time limit and spit out the 'best-yet' move.
 
Anonymous
If someone wants to submit an entry with a lookup table of the best moves, be my guest :P
 
I was thinking about making a 360collateralnoscope bot that only moved when one of the pieces could jump over at least two checkers
 
Anonymous
3:06 AM
Do it
 
Anonymous
The more bots, the merrier
 
? Can you even pass a turn? How could you just not move?
 
Anonymous
Except that you aren't allowed to pass your turn
 
\o/
 
(I've just spent a day furiously researching strategies for a Connect 4 AI that runs in 60 seconds on a TI calculator)
 
3:06 AM
@Mego I guess I'll just move a piece randomly then.
 
Anonymous
So you would have to make it where it only jumps if it can score 2 or more
 
@quartata There's always at least one of those in a KotH.
 
@Mego Yeah, basically.
 
(Which is the time that it takes for an empty loop from 0 to 100k)
 
@Geobits I mean when it can't get a collateral
 
Anonymous
3:07 AM
This is why I was excited when I came up with the idea
 
Trust me, it's fun when there is very limited time for a move.
 
Anonymous
Draughts is a simple game with very interesting strategies
 
Anonymous
So lots of neat entries
 
@quartata Maybe we need a Meta Sandbox? Like, meta Meta.
 
What would go there? Can we have a meta site to determine that?
 
3:08 AM
I dunno, why don't you ask on meta.meta.meta.meta.codegolf?
 
Anonymous
I'm really upset that meta.physics isn't about metaphysics :(
 
> The server at meta.meta.meta.meta.codegolf can't be found, because the DNS lookup failed.
Mods are mean.
 
Anonymous
@Geobits Try this link
 
No, this one is way better. Seriously.
2
 
Anonymous
@Geobits ಠ_ಠ
 
3:11 AM
I just forgot the .com originally.
 
@Geobits rofl what?
 
I have no damn idea.
 
hahaha
 
Anonymous
 
3:11 AM
My first meta post
Tell me how much it sucks
Ooh just noticed a typo
Fixed
 
Looks good!
 
you guys wanna see something fun?
double fast_sin(double x) {
    const double magicround =  6755399441055744.0;
    const double pi         =  3.14159265358979323846264338327950288;
    const double invpi      =  0.31830988618379067153776752674502872;
    const double a          =  0.00735246819687011731341356165096815;
    const double b          = -0.16528911397014738207016302002888890;
    const double c          =  0.99969198629596757779830113868360584;

    union { double _; uint64_t i; } u { invpi*x + magicround };
    x -= int32_t(u.i & 0xffffffff) * pi;
I wrote that a couple of years ago
 
@orlp When I see/hear that, it's usually followed by something not fun :(
 
@orlp wat
 
Anonymous
@orlp You and I have very different definitions of fun
 
3:13 AM
@quartata Oh wait, you wanted this? "Wow, your post sucks so bad it could be a vacuum for /b/!"
 
@orlp wat
I see c++
 
C
 
I C ++
 
3:15 AM
I D
 
that sin approximation runs in ~6-10 cycles (hard to measure) on modern intel CPUs
 
Why don't you just use a sine table?
 
because that's less fun
 
gets kickbanned
 
std::sin(float) runs in ~34, std::sin(double) runs in ~104
 
3:15 AM
> sin table
 
max abs error: 0.000296046
max rel error: 0.0339924%
 
@orlp Interesting
 
Anonymous
needs more inline asm
 
@quartata because a sin table is slower and less precise?
 
@orlp I thought they could be pretty quick.
But you're right on the "less precise" part :P
How does it work?
 
3:16 AM
magic
 
@quartata in the absolutely ideal case they can be quicker than 6 cycles
but that's only in very very tight loops with small codesize
as soon as you hit L2 cache it's slower
 
@orlp Ah I see.
 
first I compute truncate(x / pi) * pi using an IEEE754 floating point trick
I then subtract that from x to basically get mod pi
then once the input is in the range [-pi, pi] I do a polynomial approximation
 
@quartata Output by spawning things. Assign each byte value to an entity and line them all up. Newlines can work as usual :P
 
Anonymous
x -> [-pi,pi] is not the same at all as x mod pi
 
Anonymous
3:20 AM
That's (x mod 2*pi) - pi
 
@Mego depends on the definition of mod
 
The fact that mod has different definitions is eternally frustrating.
 
45
Q: What's the difference between “mod” and “remainder”?

songhirMy friend said that there are differences between "mod" and "remainder". If so, what are those differences in C and C++ . Does '%' mean either "mod" or "rem" in C?

 
I need a question title for something I'm about to post. Something clever involving binary and parentheses.
 
@Calvin'sHobbies Parenthary
 
3:22 AM
@Calvin'sHobbies Anything else to go on?
 
Base-(2)
the constants for the polynomial aren't optimal btw
 
@Geobits How about a word synonymous with "number" that starts with B
 
I haven't gotten to that yet, it's really complex =/
 
The task type would help. Parsing, counting, etc.
 
the constants were derived using this system of equations:
f(x) = ax^5 + bx^3 + c
f(pi/2) = 1
f'(pi/2) = 0
f(pi/6) = 1/2
 
3:23 AM
@Calvin'sHobbies Bunch. A bunch of things -> A number of things :P
 
@Geobits Don't say it here! Post it!
 
Anonymous
@orlp That code could be golfed way more, btw
 
@quartata Really? I was joking... It sounds like a pretty terrible output method for most things :)
 
2
Q: Minecraft I/O Methods

quartataSeeing as how we've established a size measurement for Minecraft redstone creations, I thought I'd follow that up with establishing standard output and input methods. Minecraft, obviously, does not have STDIN or STDOUT in the traditional sense. So how exactly should we handle input and output fo...

 
@Geobits It isn't terrible. It just might not be the shortest
 
Anonymous
3:26 AM
Lever = 1 bit, mob = 1 byte + 1 byte for each character in its name if its name is used, command = 1 byte per character in the command (after /<command name> )
 
@Mego the code isn't golfed though
 
Anonymous
@orlp Yeah and that's the problem
 
Anonymous
This is codegolf, not codereview
 
30 mins ago, by orlp
there's a time and place for code golf, and a serious interpreter is not it =/
s/interpreter/thing/ :P
 
@Doorknob It's always code-golf time.
 
Anonymous
3:27 AM
@Doorknob It's not an interpreter, it's a math doohickey
 
@Mego Yep, and that's why I think the name of this site is wrong.
 
Place, I'm not so sure about. I've tried code-golfing on paper but it's kinda tricky to debug.
OK serious talk here
 
Anonymous
@Geobits This isn't alex.se
 
I actually do find myself code-golfing on paper while I'm away from my computer
Should I be concerned?
 
Yes
 
3:28 AM
Is this a new level of addiction?
 
yes
 
Anonymous
@quartata get help
 
very
 
Go look at main if you want to be FGITW
 
I'd tried code golfing to "show my work" on a math test. 1/10 Do not recommend
 
3:29 AM
Better yet, just don't ever be away from a computer. They have pocket computers now.
Hmm. It doesn't sound any different from other parentheses matching challenges imo, except "convert to binary" first :/
 
@quartata I wrote the Pyth Gamma function on paper
I write 150-byte TI-BASIC programs on paper all the time
 
@Calvin'sHobbies Do we just ignore the decimal place for your latest challenge?
 
I often go into classrooms and borrow their whiteboards to write APL programs on.
 
@phase Decimal place? You still take in an integer, it just needs to be input in base 10, not base 2
 
That's because writing APL is easier than typing it :P
 
3:33 AM
@Geobits Heh, maybe
 
@Calvin'sHobbies decimal point*
 
Anonymous
Boom
 
@phase What I just said still applies
 
Anonymous
@Calvin'sHobbies first :P
 
huh, Calvin's challenge reminds me of something I want to post
 
Anonymous
3:35 AM
Wait crap
 
@Calvin'sHobbies ohh, I thought you meant input 1234.1213412
 
> wait crap: when you're waiting on something to finish, so you use the restroom to pass the time
2
 
Anonymous
I oopsed my answer but still fixed it in time to be first :P
 
4
Q: Parenthifiable Binary Numbers

Calvin's HobbiesIf you express some positive integer in binary with no leading zeros and replace every 1 with a ( and every 0 with a ), then will all the parentheses match? In most cases they won't. For example, 9 is 1001 in binary, which becomes ())(, where only the first two parentheses match. But sometimes ...

 
man
why is main posts bot always so slow =/
 
3:38 AM
@Mego I think you need to check for Syntax Errors, since Type Errors can still be validly matching
 
Anonymous
@Calvin'sHobbies I can't think of a circumstance where it would throw a TypeError and not a SyntaxError
 
Anonymous
Crap
 
Anonymous
Oh well, deleted
 
Anonymous
Was worth a shot
 
3:45 AM
@Mego ?
 
Anonymous
@AlienG I'm not going to help you read
 
@ZachGates github.com/agazersyacht is borked
 
@Mego I was asking why it was deleted... (Why so rude?)
 
@Mego I have forgot again but how do I emulate a for loop? I promise not to ask you ever again ...
 
@AlienG It was incorrect like I had just said
9 mins ago, by Calvin's Hobbies
@Mego I think you need to check for Syntax Errors, since Type Errors can still be validly matching
 
3:49 AM
@Calvin'sHobbies I didn't realize that would cause it to be deleted. (Was assuming he'd just edit it)
 
2
Q: De-Parenthesizing a String

redstonerodentGiven a properly-parenthesized string as input, output a list of all nonempty substrings within matching parentheses (or outside of all parentheses), with nested parentheses removed. Each substring should be the sequence of characters in exactly the same matching parentheses. Substrings should be...

 
@orlp thanks
 
How did @Mego 's insult get stared?
.-.
 
@AlienG he never loved you
 
downstar
 
4:00 AM
If you invent a language, perhaps people will star your insults as well
 
@ThomasKwa what if you are inventing?
 
@ThomasKwa Who said I didn't?
@phase He just hates me because I'm awesome. :D
 
@AlienG you have?
 
I like how people assume I haven't done anything.
And even if I didn't, why would an insult ever get stared?
 
@TheDoctor I fixed it on my profile. It should be @zachgates7 again
 
4:02 AM
@AlienG you haven't done anything
 
@AlienG Maybe TanMath was implicitly nicely asking what language(s) you invented...
 
jk like i know what's what
 
@Calvin'sHobbies exactly!
 
@TanMath I didn't view it any other way
 
user image
2
 
4:06 AM
 
...
 
^
 
@phase what be that?
 
@ThomasKwa my contributions on github
 
GihTub
 
4:12 AM
0
A: Parenthifiable Binary Numbers

orlpPython2, 88 bytes try:exec "print 1,"+"".join(["],","["][int(c)]for c in bin(input())[2:]) except:print 0 A terrible implementation that abuses syntax errors.

 
Giþub
 
I feel dirty
 
@orlp is it optimal?
 
probably not
 
Could you make a code-golf question with the goal of making as many errors as possible?
 
4:16 AM
@AlexA. I predict that you're writing a Julia answer to my challenge...
 
@Calvin'sHobbies Why would you assume that? >_>
 
@AlienG How would it work?
 
@AlienG It's not code golf if the goal isn't making the shortest code.
 
Most program stop after encountering one error so "most errors" needs to be defined
 
@Calvin'sHobbies Well, I'd think either the code would create errors during execution (like divide by 0) or just errors in the code in general. (It was a mostly stupid question though)...
Then you'd just ignore the errors and see how many it would make...
@AlexA. Well if you have a set amount of errors with an error type it could be...?
 
Anonymous
4:20 AM
@AlienG I deleted the answer because it would take more time to fix it than I had available at the time. I'm sorry for snapping at you.
 
@AlexA. To be fair, Programming a Pristine World was a golf that sort of involved inducing lots of errors
 
@Mego Oh, alright.
 
Anonymous
I've started designing a major update to Seriously, that will totally go against my original design goals but make everything so much nicer
 
Anonymous
Save/restore stacks
 
Anonymous
And maybe a few general-porpoise registers
 
4:24 AM
@Mego cool
 
^
 
Anonymous
And I still don't know what broke in permalinks
 
Anonymous
<insert shrug face here>
 
@Mego so a basic face? ('-')
That brings up a good question, does your face change when you shrug?
 
Anonymous
¯\_(ツ)_/¯
 
4:27 AM
Guess that's as good as an ASCII reply will get
 
[o],_,[o]
 
-,..,-
Also, does anyone use the insert button?
 
Anonymous
Yeah, for pasting into a terminal
 
Anonymous
@AlienG Technically not ASCII
 
Anonymous
is unicode
 
4:29 AM
*As good as a non-word response will get.
 
Anonymous
@Calvin'sHobbies omnomnom?
 
how is this safe?
 
0
A: Make my pseudocode real

phasePython 3, 299 bytes import sys;s=int(sys.argv[2]);t="";b=0 for l in open(sys.argv[1]): h=l;g=0 for c in l: if c!=" ":break g+=1 if g/s<b:h=" "*g+"}\n"+h;b-=1 if l.strip().endswith(":"):h=l.split(":")[0];h+=" {";b+=1 t+=h+"\n" b-=1 while b>-1: t+=" "*(b*s)+...

Since no one else wanted to do it...
 
4:40 AM
@phase You could start a bounty
 
@ThomasKwa How do those work? Do you give up your own rep for it?
 
Anonymous
@orlp Because parkour
 
377
Q: How does the bounty system work?

A. Rex What is a bounty? What is the "Featured" tab on the homepage? How can I search for questions that have a bounty attached? How do I start a bounty? When can I start a bounty? How long is the bounty period? How do I award a bounty? Can I award a bounty to my own answer? Can I award a bounty to an ...

 
Anonymous
@phase horribly golfed, shame (ding)
 
Anonymous
4:42 AM
You golf your interpreter but not your answer?
 
I don't know how well you can golf python with the whitespace stufferoos
 
@Mego d[aiou]ng?
 
Anonymous
@phase one space per indent
 
Anonymous
4:45 AM
for c in l:
        if c!=" ":break
        g+=1
 
@phase Replace 4 spaces with one tab or one space
 
Anonymous
for c in l:if c==" ":g+=1
 
Anonymous
Or even better, g=l.count(" ")
 
@Mego you did not get my message?
 
Anonymous
@TanMath I did, but on account of you being an ass earlier, I elected to ignore it
 
4:46 AM
@Mego wouldn't count() count all the spaces in it?
 
@phase and put all of the stuffs for one indent level on the same line, separated by semicolons
 
Anonymous
@phase True. So use the other one
 
(or on the same line as the colon, even better)
 
@Mego Seriously?
 
Anonymous
Or len(l.lstrip())-len(l), but I think that's longer
 
4:48 AM
@Mego i am sorry...
 
@Mego That's not a very civil way to approach the situation.
2
 
are we counting the number of whitespace characters or just the number of space characters specifically?
 
@AlexA. Mego? Civil? When? Peanuts? I'm hungry?
2
@quintopia amount of spaces in front of the line
 
ah
 
@AlexA. I concur
 
Anonymous
4:49 AM
@TanMath To do a for loop, either do a while loop with an int that you decrement every loop, or do a map over a list created with r or R
 
@phase so for your java pseudocode you just switch the whitespaces with brackets?
@Mego thanks!
 
Anonymous
Best solution to @phase's question: write a Java-to-Python transpiler
 
lolol
 
Anonymous
Call it Pava
 
Anonymous
(since Jython is taken)
 
Anonymous
4:52 AM
WAIT
 
@TanMath essentially
 
Anonymous
Compile the Python code into Java bytecode with Jython, run it with Java
 
Anonymous
Even better!
 
@phase so why is it so hard that no one answers it?
 
@TanMath No clue, I made it a couple months ago :\
It took me like 10 minutes to think of a algorithm for it
 
4:53 AM
"Oct 19". "Couple months". Eh close enough
 
@phase i will try my luck at it...
 
Anonymous
@phase I saw it, thought about trying to solve it, drank alcohol, and then the rest is history
 
@Sp3000 Oct -> Sept -> Nov
@TanMath <7
 
Anonymous
@phase ಠ_ಠ
 
@phase you are out of phase with time?
 
4:55 AM
@quintopia Was that English? I'm not an English professor, but I know enough about the language to know that that sentence didn't make any sense.
@TanMath I think the easiest approach would be to copy my algorithm in CJam
 
Well, actually, it kinda does.
 
@phase huh?
 
ah, being out of phase with time, you must have been trying to parse it backwards
let me try again
time? with phase of out are you @phase
 
@phase Makes sense to me..
 
@phase "out of phase" usually refers to a cyclical process, like a sine wave
I guess it could work, but the pun was a stretch
 
Anonymous
4:56 AM
@phase I'm tired and slightly inebriated and that made sense to me
 
I told you I wasn't an English professor.
 
@phase No I heard you were
 
Anonymous
Neither am I
 
Anonymous
I have a degree in codemaking, which is like the opposite of English
 
@phase Just a few questions: 1) The number of spaces to indent a block is given as an argument - if the input program doesn't match that indentation do we need to fix it? (the examples already match their respective inputs, so I can't tell) and 2) Sometimes you replace the : with just { and sometimes there's a preceeding space before the { - does that matter?
 
4:59 AM
I can't figure out how to find where to put the last bracket to close..
 

« first day (1752 days earlier)      last day (3092 days later) »