[1] https://ioccc.org/2020/rules.txt [2] Personal communication
C implementation of Tic-Tac-Toe in a single call to printf
11–20 of 85 posts
Re: C implementation of Tic-Tac-Toe in a single call to printf
#12https://www.usenix.org/conference/usenixsecurity15/technical....
Very interesting. Roughly, that the existence of Turing-complete functions within programs creates a fundamental vulnerability that even rigid control over the control flow of a program cannot avoid.
Re: C implementation of Tic-Tac-Toe in a single call to printf
#13> %n takes a pointer and writes (!!) the number of bytes printed so far. > Okay, everyone probably knows this. Let's get a bit more advanced. Ok, but I didn't know about that. What's the use?
One use is aligning outputs: char *prefix = "example"; char *line1 = "line 1"; char *line2 = "line 2"; printf("%s: %n%s\n", prefix, &n, line1); printf("%*s%s\n", n, "", line2); will output example: line 1 line 2 That’s a bit more robust than using strlen(s)+2 , where you have to keep that magic constant 2 in sync with ": ". Moving ": " to a variable and using strlen(s)+strlen(separator) would fix that, though (at the…
n = printf("%s: ", prefix);
printf("%s\n", line1);
printf("%*s%s\n", n, " ", line2);Re: C implementation of Tic-Tac-Toe in a single call to printf
#14Re: C implementation of Tic-Tac-Toe in a single call to printf
#15I am afraid that the author has disqualified himself by publishing the source code before the judging of IOCCC 2020 is over. See catch 22 in the rules: "The judges STRONGLY prefer to not know who is submitting entries to the IOCCC."[1] Even the winners are asked not to publish the code until it is available on the IOCCC web site.[2] [1] https://ioccc.org/2020/rules.txt [2] Personal communication
Re: C implementation of Tic-Tac-Toe in a single call to printf
#16Re: C implementation of Tic-Tac-Toe in a single call to printf
#17> Until recently all content on this website was research, and while writing papers can be fun, sometimes you just need to blow off a little steam.
I think more companies should allow for their employees to have some plain old fun with no strings attached on a regular basis.
Re: C implementation of Tic-Tac-Toe in a single call to printf
#18Title correction: Tic Tac Toe written almost entirely in #defines.
Re: C implementation of Tic-Tac-Toe in a single call to printf
#19This is just crazy and I love it From a description on the author's website[1] of a Doom clone written in 13k of JavaScript. > Until recently all content on this website was research, and while writing papers can be fun, sometimes you just need to blow off a little steam. I think more companies should allow for their employees to have some plain old fun with no strings attached on a regular basis. [1] https://nichola…
Maybe we could call this additional 'holiday pay' or a longer 'weekend' and mandate it through law so that everyone benefits.
Re: C implementation of Tic-Tac-Toe in a single call to printf
#20> %n takes a pointer and writes (!!) the number of bytes printed so far. > Okay, everyone probably knows this. Let's get a bit more advanced. Ok, but I didn't know about that. What's the use?