« first day (1315 days earlier)      last day (1814 days later) » 
00:00 - 17:0017:00 - 00:00

12:22 AM
@Sparr I'm quite positive C is changing. However, realize that the snapshot you get is after C increments, and before the conditions are processed (in game). I pre-process the conditions to highlight them.
@Sparr cyan marks the current turn, green for true conditions, grey for overwritten lines, and white for everything else. If a line matches multiple of the above, the order I listed is the priority.
you're right. I was seeing C+1
I forgot bots would step back on repeat conditions
so now my attack bot is overwriting C or C-1 at random
Ok. Your logic statement is a bit flawed
If you have a neighbor not in front of you, what do you want to happen?
1/24 chance to move, or move?
1/24 chance to move
on top of all the other move conditions
Ok. If you have no neighbors, what do you want to happen?
let me rethink it :)
12:33 AM
right now, you have 100% chance to move with non-front neighbors and with no neighbors
and 0% with a front neighbor
oh, re preventing instant attack... that's only if you sit still
you're always vulnerable to attack after moving
what do you mean?
3 hours later…
3:27 AM
A: Sandbox for Proposed Challenges

YpnypnPrint the Constitutional Amendment Given a number from 1 to 27, print the appropriate amendment to the US Constitution, using this text. Your score is the byte count of your source code, divided by the byte count of the best answer to this question in the same language. Therefore, you must use ...

2 hours later…
5:55 AM
2 hours later…
8:19 AM
@Rainbolt why?
1 hour later…
9:46 AM
hi @MartinBüttner
10:11 AM
@user2179021 Without failure, you manage to greet me after I've left.
@MartinBüttner :)
@MartinBüttner or before you come back?
10:35 AM
usually closer to after I've left :P
welcome back!
It looks like someone actually went through questions which were one upvote from the badge and upvoted them. The ones I checked got their 5th upvote last night.
O.O Synthetica's avatar is a 99 with two rifle bullets... I never looked at it in detail and the smaller version always looked like a mix of diving goggles with a snorkel and a gas mask o.O
11:30 AM
@MartinBüttner I always thought it was slippers on a shelf propping up a book
hi @VisualMelon
how things?
I'm lamenting how unfit I am and I'm meant to be preparing for a party
so pretty good I guess
you don't need to be fit for most parties
so don't worry
also, you need some physically demanding lamenting which will fix your problem
have you considered options?
is VisualMelon how you see yourself? ;)
11:41 AM
I'm not sure I follow, until recently I was happily running every 3rd night for an hour or so, but then I stopped, and now the nights seem cold. I'll probably slip back into a pattern when I'm back at University and my parents don't have to let me in at 02:00
I was just being silly :)
The joys of street lighting
better than street fighting!
of course you could spend your time writing an answer for codegolf.stackexchange.com/questions/37269/… :)
I do intend to do that, but it probably won't be for a couple of days
@user2179021 In 6 hours you can set a bounty on it.
sorry, 7 I think
11:49 AM
@MartinBüttner yes :)
@VisualMelon great!
the fastest entry for codegolf.stackexchange.com/questions/37270/… is awesome
it seems a shame that such amazing code won't be included in standard libraries to be honest
I mean they could just replace the built in functions for binomial coefficients with this code
it would be lovely if there some route from winning fastest-code entries to being included in open source projects
there is: patch it in yourself and send a pull-requests.. that's what they're open source for :P
@MartinBüttner it seems rude to do that with someone else's code
well you can either suggest it to them or credit them
still seems rude just to copy it from here and include it in something without their permission
what license are the answers here under?
11:56 AM
I don't think it's rude if you credit them... can't imagine anything better than my code showing up with my name in some open source project, without ever having to go to the lengths of working it in and testing the project myself :D
12:16 PM
@MartinBüttner are you any good at C?
I need some help
do you mind if I ask possibly dumb C questions?
probably :)
lol, go ahead
I am trying to understand Keith Randall's amazing answer here codegolf.stackexchange.com/questions/26643/…
well ok forget that. let me try with another one :)
I am trying to improve james_pic's answer
currently he hardcodes the table size
is there some way to avoid this?
since he's using dynamic memory allocation already I don't see why not
12:21 PM
how would you do it?
he has "for (size_t i = 0; i < TABLE_SIZE; i++)"
for example
make it a global variable instead of a macro
then set the value at the beginning of main
but what do you set it to?
I mean you just get the input file
you don't know how many lines it has in advance
well I don't know :D ... that depends on your problem, not on C ^^
ah okay
in an algorithms class they would tell you to try something large and then double it whenever it gets too full I suppose
would traversing the file twice add a significant overhead?
if not, first pass: count new lines, then allocate, second pass: read data
12:24 PM
do you think counting new lines is going to be any faster than running wc?
two passes isn't ideal
possibly, because you don't need to invoke another process, but you should just try it
ok let me ask an easier question :)
are the lines fixed length?
sadly no
do they have a maximum length?
12:26 PM
here is an easier question.. how can I change it to take a filename as a command line argument?
(yes they have a maximum length)
actually maximum length is useless
minimum length would be more useful, but that's probably 1?
re command line argument, change the signature of main to: int main(int argc, char** argv)
then argv[0] is the first command-line argument as a \0-terminated string
which you should be able to pass to fopen
maximum length is useful, surly ? lets you know an upper bound of the number of lines which can only be too big by a factor of (max / min - 1)
@VisualMelon no it gives you a lower bound.
(given the file size)
thanks ;)
you are right
I can just use a minimum length
thanks :)
12:32 PM
wow, did I really just get that wrong
much easier
@VisualMelon so did I :D
so readAll(argv[0], table) should work?
@MartinBüttner sadly not...
12:38 PM
[0] should be the program's file name
ah ok
I did wonder.. that's what it is in python
ok next question :)
do you understand this warning
warning: pointer targets in initialization differ in signedness [-Wpointer-sign]
uint32_t * currentElement = &(currentRow.a);
btw, I think you should be able to fix your user name, if you went to your SO profile, changed it to Lembik there, and ticked a checkbox saying something like "Copy to all SE profiles"
I don't really mind it as long as it doesn't upset anyone else
it's slightly confusing sometimes :D
12:40 PM
@user2179021 yes. currentRow.a is an int. currentElement is uint
ah... maybe everything should be uint32_t ?
is there any harm in doing that?
I don't know. I still haven't read the question/tried to understand the answer ^^
if your values can never be negative, make everything uint
ok so things are improving :)
no problem
the answers are magic
they run faster than wc!
ok my last challenge is to understand readAll
12:44 PM
let me know if I can help with that
basically.. the current input format is num num num. My new format is 437,39,30,text
I need to change it to cope with that
where text is variable length
I suppose you could change ' ' to ',' in the switch and then handle reading the text in default
can I you explain the current default line?
I don't follow what it is doing
it builds up the number
it multiplies the existing number by ten (shifting all digits to the left) and then adds the new digit
- '0' simply subtracts the character code of the 0 character, which converts the ascii codes to actual digit values
oh.. in case the number has more than 10 digits?
12:53 PM
why 10 digits?
ignore that
ok so really I need to modify Row I think
to add a "text" term to it
the output should just be a subset of the rows in the input
I am not sure I am competent to do this in C :(
can you explain this line?
"this line"?
if (currentElement == &(currentRow.a)) currentElement = &(currentRow.b);
stackexchange censored it :) It should be visible now
if currentElement points to currentRow.a, make it point to currentRow.b
it's just advancing the pointer when a ' ' is encountered
oh I see
pointers to parts of structs
I should get used to this :)
1:01 PM
C becomes quite amazing once the whole pointer magic and memory layout clicks with you
I can imagine
what are the parts of a struct called? fields?
members, maybe?
fields definitely works though
ok so.. what does " Row * this" mean?
is the space significant?
Wikipedia uses both terms, but member in the first few examples: en.wikipedia.org/wiki/Struct_(C_programming_language)
@user2179021 no it's not
1:05 PM
it's the same as Row* this or Row *this (possibly even Row*this. I personally prefer the former form, but it took me a while to get used to
ok thanks
so .. my problem is that I have to somehow store all the stuff after the third comma and then incldue it in the output
everything between the third comma and the newline that is
there's a maximum length to that text, right?
each line has a maximum length
typedef struct Row {
uint32_t a;
uint32_t b;
uint32_t t;
needs a string now I think
to start with
which I think is normally a pointer to a char array, right?
char *text;
but now I have to allocate memory for it?
@MartinBüttner Wanted it to look consistent.
well if there's a maximum, just hardcode it
like char text[20];
1:12 PM
ok good
Plus someone else had already bumped it (the sandbox post I mean)
@Rainbolt ah okay, I didn't see that
@user2179021 remember to account for the space of a terminating null-byte
New question posted!
Q: Generate the outline of an island from a seed

jshThe challenge is to draw the outline of an island, generated using a seed as input. Input (seed): 1 to 12 character alphanumeric string Each seed is to give a unique island (you don't necessarily have to prove this to be the case for every seed) Using the same seed should always give the same ...

@MartinBüttner ok.. so now I just need to modify readall to put the stuff after the third comma into it
@user2179021 yes
@Rainbolt Do you think, I can submit this? ;)
1:16 PM
DO IT! (If it's still open)
it's not a valid submissions as it stands, because it doesn't produce an 800x800 image ^^
@MartinBüttner you guys are so mean :)
why not suggest ways to improve the question?
and then close it if that doesn't happen
@user2179021 if it needs improvement it should be closed as quickly as possible, and reopened when fixed
the point of closing (which is actually "putting on hold" btw) is that the question can be salvaged before answers come in which would be invalidated by changes
@Rainbolt I'd also feel bad about posting it, because it's just an (incomplete) reimplementation of www-cs-students.stanford.edu/~amitp/game-programming/…
@user2179021 I actually did make a suggestion.
Before I read your comment (I promise)
good points all round
I just feel sorry for people :)
1:21 PM
@MartinBüttner Ok, so would you mind if I pointed this guy to that challenge for inspiration?
of course I really just want someone to answer my question! :)
@Rainbolt no (it's not a challenge though ^^)
Well, if he copies and pastes it without turning it into a challenge, then he probably wasn't meant to post here anyway.
@user2179021 how are you getting on with reading the text from the lines?
@MartinBüttner unwell :)
1:37 PM
I think in default you can just check whether currentElement points to the text field to switch between two methods of reading an element
and if that's the case you keep an i around to iterate through the characters of the string
oh and by the way.. codegolf >> stackoverflow :)
on codegolf you get code. On stackoverflow you get "why don't you just make your code do this"
1:50 PM
Hmm, looking around to have fun vs having a problem and needing an answer? Well of course one's more fun. That doesn't make it better for everything ;)
2:14 PM
to retract or not to retract
added a question for the code-golfers to enjoy :)
Q: Able was I ere I saw Elba

LembikUsing your language of choice, golf a palindromic quine. In many languages, an empty file is also a quine: that isn't considered a legitimate quine. You are also not allowed to read the source file and print it. As is usual here, points for: Smallest code (in characters) Most obfuscated/obscu...

I did seach
but not for teh word mirror
also, you copied the spec from one of the very first questions which were often quite horrible
the "points for" is completely meaningless in a code-golf
it's gone
it was a terrible mistake :)
and I am ashamed of myself
I don't like code-golf questions but I wanted to make people happy :)
2:19 PM
Hmm, I can't decide whether it's worth starting on something for the island popcon. I have an idea, but it's on the edge of closing.
I like questions where people get to show off some real practical skills
Palindromic quine is practical? I need a new job.
@Geobits you can still answer closed questions right?
No, that's the point of closing them. It keeps people from answering and encouraging bad questions.
@Geobits no :) I meant I did it to make people happy *rather than * my usual preference
2:20 PM
@user2179021 no, that's what "closing" means
@Geobits oh.. stackoverflow is full of answered closed questions.They must close them afterwards
Right. PPCG has a few of those too.
@Geobits I just wanted to throw something simple together, but it's not working as well as I had hoped
@MartinBüttner I was thinking something along the lines of diamond-square, but with the radius moving in/out.
I'm not sure that it would be able to make bays/inlets well, though.
Anyone else going to play Destiny?
2:23 PM
I keep on getting confused people asking questions on codegolf.stackexchange.com/questions/37269/…
I really didn't think it was so confusing :(
@Geobits I was trying a simple fractal noise on a polar plot, but it all looks too regular
@Rainbolt It looks decent, but no PS4 yet, so it'll have to wait.
since it's not code golf, I could just modify the code I linked to above
but I can't be bothered
That's it. I'm buying a PS4. I was torn between being able to play Smash Bros and <insert other game here> and I finally found a game to insert here.
Thank you Bungie for consistently delivering the same game over and over. It's awesome every time.
I've already got a U, so no issues for me there. Got that when SMK8 came out :D
2:26 PM
the main reason for me to get a U would be the most recent DK
is there a two level quine? That is code with source code A that outputs code with source B that outputs code with source code A ?
after getting over my disappointment that the first part of the reboot didn't feature any Kremlings, it was an absolutely amazing game
@user2179021 yes
@user2179021 I believe so, but can't remember what it's called.
@MartinBüttner is there already a question on it?
@user2179021 yes, let me look it up
2:27 PM
Quines have been pretty much played out IMO.
ok thanks
@Geobits it seems so :)
but I have just thought of a variant :)
which is sort of crazy
Just make sure it isn't one of the 44 quine challenges already posted.
I think you might be lucky with a polyglot quine. that would be sick.
actually that's irrelevant. it only has one answer, and that won't be competitive
I might actually post that :D
polyglot quine seems good
do you mind if I post it?
Ouroboros !
no, unless you use that bad spec again :P
2:32 PM
@MartinBüttner I will try not to be a naughty boy :)
look at some older polyglot challenges
both quines and polyglots have some tricky edge cases to consider
I like the idea of an ourobos challenge where the length of the ourobos is the score
but you have to somehow account for source code length too
quines: reading your own source code, working only in a REPL, etc.
polyglots: using similar languages or languages which are subsets of one another
I wonder if you just divide by it
I have no idea what you're talking about
@Geobits should we retract our close votes on the island challenge now?
2:36 PM
I'm unsure. It's no longer a dupe (my CV reason), but now it kinda just reads as "draw a closed loop that you could call some sort of island."
that's true
it's also still an art contest
@MartinBüttner An ourobos is code in language A that outputs code in language B that outputs.. and then back to A
Right. Clearly not thinking this morning.
You should eat breakfast
Q: Write a third order quine

Peter OlsonThis challenge is an extension of 'Golf a mutual quine'. Using three languages of your choice, create a third order Ouroboros program. That is, in language A, write a program pA which outputs program pB in language B. Program pB should output program pC in language C, which in turn outputs the ...

for example
it repeats forever exactly
I would like to have the score be the number of languages in the loop
2:38 PM
Stupid chat. I'm pretty sure I didn't tell you to edit that.
but you need to limit the code size too somehow
well code size / languages
but I feel like that's been done before too
That doesn't really give a bonus for more languages.
@MartinBüttner .. right.. but is that the right measure
@MartinBüttner ah...
I'm just gonna stop now.
2:40 PM
@user2179021 I can't find it at the moment though, but I'm sure I've seen something like that.
@MartinBüttner ok
@MartinBüttner I've already cast my reopen vote. If anything, I did it just because he put in the effort to make it better.
@user2179021 that's fixed
@MartinBüttner yes
maybe just have a league table per number of languages starting at 3 :)
or starting at 4
starting at 3 sounds fine
2:43 PM
you could just make the scoring by number languages, code-size being the tie-breaker
that makes sense
if you wanna go ahead and do that, I'll still write up a spec for a polyglot quine though
you know what I hate about the phrase "Polyglot Quine"?
it's got 14 characters in it...
Well obviously it should just be polyquine at the most.
@Geobits that has only 9 :(
(I like it though)
2:48 PM
Oh, I thought you were saying it was too long (speaking of golf). You're looking for a 15 char title....
"Quine a Polyglot"?
Polyglot Quines
"Write a Polyquine"?
@Geobits I like that :D
Polyglottal Quine (ugh)
@MartinBüttner ok.. yours will be more popular than mine
Q: How long is your (language) snake?

LembikFollowing on from the third order quine challenge, your task is to write an Ouroboros program that uses as many languages as possible. That is, in language A, write a program pA which outputs program pB in language B. Program pB should output program pC in language C, and so on until eventually ...

3:00 PM
@PeterTaylor I think you might want to add meta.codegolf.stackexchange.com/a/2073/8478 to meta.codegolf.stackexchange.com/q/1324/8478 now. It hasn't been disputed at all and it seems quite solid.
A: Sandbox for Proposed Challenges

Martin BüttnerPolyglot Quines code-golf quine polyglot Write a quine which is valid in at least two different languages. This is code golf, so the shortest answer (in bytes) wins. Rules for Quines Only true quines are accepted. That is, you need to print the entire source code verbatim to STDOUT, without: ...

Any feedback for the polyquine?
I tried to write a new spec for the quine and the polyglot part which is hopefully a bit more solid than earlier ones, but let me know if I've overlooked any usual loopholes.
only two languages? :)
yes, "Number of languages" is even harder to determine in a polyglot than making sure that two languages used are different enough
because if I include that in the scoring I really need to draw a line between every suitable pair of languages and every unsuitable pair, which is near impossible
@user2179021 I think you meant "impressive"
how on earth did he do it?
3:11 PM
he generates it I think
the code layout is amazing though
3:23 PM
well writing a generator seems like a nice challenge :)
you enter the number of languages it generates the code :)
@user2179021 that exists... it was in a comment in one of the challenges similar to yours
that was in Third Order Quine
"write a quine that takes as input the name of a language and outputs the same thing implemented in the input language" :)
how about that as a code golf challenge?
or somethign similar
3:33 PM
@Geobits I was just looking at Wednesday's xkcd again and I think my favourite panel (of the ones I've found so far) must be "I'm gonna go shut the server down!" ("splish, splish") :D
I don't think I saw that one. I stopped shortly after my browser developed an arrhythmia.
oh you can delete a comment!
nice :)
@Geobits it's basically cueball saying the above sentence with a bucket of water in his hands
@user2179021 yeah forget what I said
3:34 PM
sounds quite interesting. the user picks how many languages work?
I have to go.. I will have to set the bounty later
still no answers :
4:22 PM
I wish the chess koth had some way to inspect single games, whether graphical or notational output. I have no idea what's happening in a given game, so it's hard to improve.
that sounds indeed very useful for a chess koth ^^
00:00 - 17:0017:00 - 00:00

« first day (1315 days earlier)      last day (1814 days later) »