« first day (1274 days earlier)      last day (3552 days later) » 

12:04 AM
-=15? shouldn't that be -=i?
also does redeclaring i three times work without doing funny things?
I can't see anything wrong with the first one though
 
You're right, that should be -= i, thanks. And as I said, I'm just starting to teach myself, but I think that i should fall out of scope each time anyway?
That may be wrong.
 
no you might be right
I'm just not sure whether the declaration within the for already counts as belonging to the block following it
 
Now I get the same answer on both of them, but it's being accepted on the site. Must have been a copypaste error. Oops.
Thanks for the help :)
 
no problem
 
Does int isPrime(... make sense? Or should I be using bools here? Does C++ have proper bools?
Okay bools are a thing
I don't know where I got the idea that they aren't...
 
12:11 AM
@MartinBüttner got my program producing looping, timed gifs
you don't want to see the code
(I'll re-do all the gifs and then edit them into my answer)
 
@VisualMelon ha, great. looking forward to it :)
 
the way to get it looping is to insert 17 or so bytes
most of which is the word "netscape2"
@MartinBüttner would you mind checking this works and doesn't set your computer on fire or the like visualmelon.onl/103.gif (should loop after 1second delay on the last frame)
 
works like a charm
I'm off to bed
 
thanks for your help
 
 
4 hours later…
4:35 AM
0
A: Proposed Question Sandbox - Mark XIV

KroltanGlobal Warmth king-of-the-hill This KOTH takes place on a nice iceberg of circular surface which gradually shrinks. The goal is to be the last entry to fall off the iceberg. Each turn, participants can either move in a certain direction (or none), or if they are near enough, can push other parti...

 
@undergroundmonorail Plain C doesn't have bools.
 
5:05 AM
'struth. C99 has _bool. But IME you're better off using int and use a naming convention ("apps Hungarian") to indicate that it's a "Boolean".
I tend to use *flag or *f.
 
 
3 hours later…
7:43 AM
I just ran my first multithreaded postscript program.
PS>mark { (hello world!\n) print yield } fork (hello back!\n) print yield
hello world!
hello back!
bye!
child falls off the bottom of its exec stack, making the interpreter quit.
If I put another yield in the child, it would just sit idly in the background.
Now I have to deal with the ending of a process: exit -> zombie -> free (cleanup resources).
 
 
2 hours later…
9:25 AM
Hi guys, I'm trying to get some code started for the challenge I suggested in the sandbox here meta.codegolf.stackexchange.com/questions/1847/…
I changed my mind about the output input, I think it's worth more that the helper code provides extended functionality in this challenge than that people can use the language they want.
I'm not a very experienced coder at all, did i start okay?
There might also be mistakes, I did this in some online java editor thing, I'll finish it in eclipse though.
 
There are some important mistakes in your code:
 if (direction.length() = 3) {
Use == to compare, = is for assignment.
 } else if (direction.length() = 2 {

 } else if ( direction. length () = 1 {
Same there, and you did not close the parentheses after the numbers.
And if you want, you can use a ternary operator to shorten some if-else statements:
public int getY() {
    if (alive) {
        return y;
    } else {
        return -1;
    }
}
That can be replaced with:
public int getY() {
    return alive ? y : -1;
}
But overall, it is a good start :)
 
9:41 AM
oh shit yeah, I'm mainly programming in delphi, there = is to compare and := is for assignment. I didn't know java had a ternary operator, in such simple functions it's definitely a plus.
thanks for the input
 
You're welcome!
 
9:58 AM
Xpost version 0.0.1
PS>mark { 1 = } fork
fork cid 3, ctx->id 3
op_fork ctx->id 2, cid 3, newctx->id 3
--1-- 0
--2-- 2
1
I AM ZOMBIE
--3-- 0
--4-- 0
--5-- 0
--6-- 0
--7-- 0
--8-- 0
--9-- 0
--0-- 2
PS<?>join
found zombie child
PS<[>clear
PS>bye!
The --#-- lines is the scheduler searching through the process table.
The child process prints the number 1 and then becomes a zombie (with message).
 
@VisualMelon what does your solution output for:
C     Z
 /   \
 -|||
 \\
- -
/|\
?
(that's 7x6)
 
edits things to be monospaced
 
10:26 AM
@MartinBüttner# #
# #
##|#
#\
# -
errr, yes, the monospacing may be an issue
 
@VisualMelon ^ Is that a correct monospaced version?
 
afraid not, how does one preserve the spaces?
 
Paste your output and press "fixed font", then post your message.
That will make it monospaced.
 
ah, so just SE
#     #
 #   #
 ##|#
 #\
# -
 
10:41 AM
hang on... it would help if I could count
@MartinBüttner correction
#     #
 #   #
 ##|#
 ##
# #
###
 
Wow. I never saw the Fixed Font button.
It's not visible if I zoom too much.
 
@luserdroog there's also a keyboard shortcut, forgot what it is, lol
 
ctrl-k, maybe?
 
yup
 
that's what it is on the rest of SE.
"zombie children" always tickles me.
 
10:48 AM
@luserdroog took me a while to remember the zombie question
 
Oh. I was talking about my postscript interpreter.
 
@luserdroog xD
 
I got it to fork child processes. and clean up zombie children.
 
@luserdroog :D
 
One of the next big hassles is non-blocking io, cross-platform for posix and windows.
The posix part is easy. But windows ... ick.
then it needs event dispatch queues and shit.
and a canvas hierarchy.
Hmm. I need to stop doing that. I keep psyching-myself-out when I catalog all the things it needs. :)
brb. need to reboot to fix my Netflix.
 
11:24 AM
@VisualMelon ah good... from a quick glance at your code it looked like you replaced things with # immediately, in which case that last tile probably would have fallen, too
 
visualmelon.onl/test4.gif so you know it goes round the loop the right way ;)
 
@VisualMelon yeah I would have taken your word for it ;)
 
11:47 AM
@VisualMelon I noticed that my rules aren't as realistic as I thought
C  \|/
 /\  -
 \/||\
\
this works
but if I don't fix it for the domino circuits I might be able to avoid forwarders
 
that doesn't strike me as an issue, that strikes me as awesome
 
Dominoes are tall and thin, so I think it's OK that they can fall over their fallen comrades at those angles
 
hm yeah, I don't think they'd be thin enough in reality, but who cares
 
more importantly, if you don't fix it then I don't have to work out how my code works
 
11:54 AM
oh no, I'm definitely not changing anything for the existing challenge
I was just thinking about whether I should change it for the Domino Circuits follow up one
 
would the idea of the domino circuits be that they are one-time use, or you they 'reset' themselves?
 
no they are one-time use
how would they reset themselves?
 
well they wouldn't in real-life, but if the dominoes were to reset themselves after falling you could form loops and such
 
12:17 PM
right. I think for the challenge that would just complicate things unnecessarily
 
1:01 PM
Ha! MarkovBot is in the lead!
 
 
1 hour later…
2:12 PM
Also, @undergroundmonorail, it looks like the Gambler's fallacy is indeed a fallacy. ;)
 
Hi guys, I updated my sandbox answer that I originally intended to have someone else do. Any feedback on the direction it's going and the code in general are welcome : meta.codegolf.stackexchange.com/questions/1847/…
 
2:32 PM
@MartinBüttner Damn. Maybe I'll set MODE to 0 for the next tourney. :)
I don't actually know if this is true, but I've heard rumours that the slot machines in the Rocket Game Corner from the generation 1 pokemon games were programmed to behave in ways gamblers think that casinos work. There were hot machines, cold machines, that kind of thing.
As a kid, I usually ended up just buying coins to buy prizes with, though. It was faster, and why play slots when I could be battling pokemon? :P
 
woohoo, I entered the RPSLV tourney :D codegolf.stackexchange.com/a/35168/13702
 
@Trimsty When I'm reading submissions, I get hyped about confusing code and I take it as a challenge. Anything else and my eyes just kind of glaze over, haha.
 
@undergroundmonorail ;3
 
@overactor am I correctly reading that the planes are pointed at each other at the start of your dogfight?
that is, my plane at altitude 8 is pointed at your plane at altitude 8, and vice versa, ditto for the planes at altitude 11?
 
@Trimsty why is it golfed o.O
 
2:45 PM
@MartinBüttner What? I see tons of unnecessary whitespace! It's just unreadable :P
 
@MartinBüttner it isn't...it's just a one-liner
xD
i didn't want to have to think of variable names
plus the third line is a snake! and it's a herpetologist!
and the language is a snake! and it's opening move is always a lizard!
:D
 
It has a horizontal scrollbar... that's bad enough >D
on an unrelated note the windows shortcut for switching between keyboard layouts is the worst
 
where is it?
 
@MartinBüttner Oh, god, I know. One time I let my sister use my laptop and set it to QWERTY for her, but she accidentally set it back to Dvorak and I wasn't around to help her. The solution that her and Dad came up with was to go into my system settings and remove Dvorak entirely. Wasn't a hard fix, but still.
@MartinBüttner ?
 
2:52 PM
you can change the hotkey
I've only on a few occasions found myself typing in Russian, however
 
so i discovered something weird today
If you position your hand like you're making the "looser" sign and look at the back, and move your middle finger up and down by 90 degrees
the ligament that connects your index finger curls up
 
why would you tell me that, now I'm afraid of my own hands
 
xD
it's fun to look at :D
no idea how i found it
uh, where's evolution's bugzilla?
 
anyone here entered the pointy stick koth?
 
i was gonna, but
meh, what the heck, I'll do it now :P
 
3:03 PM
I'm trying to figure out something about the judge
the rules say that poking with zero sharpness does nothing. the judge says that poking with zero sharpness blocks. many existing entries seem to calculate as if poking with zero sharpness results in negative one sharpness.
 
@Sparr :/
Anyway, I entered :P
0
A: Caveman Duels (or: Me poke you with sharp stick)

TrimstyThe Entertainer Caveman have party. Caveman poke guests. Caveman have plan. from sys import argv print("PSSBSPPBSB"[len(argv)<2 or (len(argv[1])+argv[1].count("B"))%10]) The name comes from his strange ability to influence the opponent's action.

 
that is certainly an entry :)
 
xD
 
I want to write an entry that takes advantage of other bots that mis-calculate sharpness... but I don't think it would be particularly successful.
I just want to see other bots blocking against a sword :)
 
@Sparr my entry knows no sword
 
3:18 PM
sure, but many others do
 
3:42 PM
Isn't this problem provably insolvable? Unless I'm misunderstanding something, this is literally just the halting problem.
 
not quite. the halting problem is unsolvable precisely because it cannot determine the halting-ness of its own potential solution.
in that problem, you're allowed to write a program more complex than the programs the "machine" in question can execute
 
Ah, that makes sense.
 
4:33 PM
@VisualMelon to be honest I can't think of anything that would be much better
@Sparr yeah, PokeBackBot :D
@Sparr I'm pretty sure that's a bug with the submissions then
 
aye
I'm going to submit a bot that takes advantage of it, I think
 
don't mention that too explicitly in the post though, or you'll get DQ'd for "code specifically against specific other bots"
 
I modified some good existing bots to test with. Giving up the first move is a net loss, but it does win in some situations that the bot would otherwise lose in
and my goal is more to get the other bots fixed than to win :)
 
5:22 PM
for a second there I thought I was beaten on the laser golf
but luckily I hadn't tried very hard in the first place :D
 
5:35 PM
Game element idea: You're can change one of your earlier moves, but you have to choose wisely because the moves that you did after that might kill you.
 
 
2 hours later…
7:26 PM
@Trimsty that sounds messy
but I suppose in the right context it would provide an really interesting twist
(something like Waving Hands... although that in particular is already complicated enough)
 
8:21 PM
@Sparr @Sparr, they are not pointed at each other, the z coordinates (the height) is different and they are all pointed horizontally
 
 
1 hour later…
9:46 PM
I've been teaching myself Javascript today by writing userscripts to interact with a webgame I play
Okay that's a stretch actually, one of them hides the mouse if you haven't moved it in half a second and the other says "gg" at the end of the game
 
@undergroundmonorail one language a day? :P
 
But! It delays the "gg" for anywhere from 0.5 to 2 seconds so people don't know I'm too lazy to do it myself! :P
@MartinBüttner I mean so far it was Turing, then nothing for a year, then C#, then nothing for a year, then Python, then nothing for a year.
I have to make up time!
 
good point
hey, I just noticed, you were the one who posted the pokeball simulator challenge!
 
that was the first thing I ever golfed! (apart from regexes)
 
9:49 PM
:O
Cool!
 
ugh, all-caps in JS code? :D
(it's very rad though)
 
Are constants not allcaps in JS?
Also, I'm not actually sure that it makes sense to have all my code in an anonymous function that immediately gets called. It's not bad, either, but I don't actually know if there's a reason to do that.
That's just how it was in the SO answer I found :P
 
huh, apparently that is the convention
is well ugly though :D
 
:P
I can see so many improvements... I'm going to try again :P
 
also, yes putting stuff in a function and calling it immediately is very common among "good" JS code
 
9:52 PM
Okay, cool
I guess I'm not polluting the global namespace, at least
 
the reason is that JS doesn't have block scoping but function scoping... so unless you code in a function, everything is global. so the only way to create a scope/module/whatever is to write a function. but if it's your "main" or whatever, you still wanna run it, so you call it immediately
 
cough WAIT_TIME and CHECK_FREQ cough
 
in fact, when you compile CoffeeScript to JS it will wrap every single file in a function that is called immediately
 
9:55 PM
Cool
 
very cool
@undergroundmonorail Hehe, not very competitive against a -9 GolfScript submission :D
 
well my Pokeball one was beaten by J (amongst others)... but why would I golf in CoffeeScript anyway :D
how on earth is Generalist a silver badge... on SO the only gold badges that are rarer than Generalist are Reversal, Legendary and Publicist (plus the moderator ones, obviously)
 
The only gold badge I have is fanatic
 
I was lucky with my Vigil answer
and even more lucky with my Euro answer, that got me Populist
on SO I have a gold tag badge
(which I got before Jon Skeet, ha!)
well and electorate, but I'll get that soonish on PPCG, too, I think
 
10:44 PM
@Doorknob would you care to pin this? ^
oh my god this is amazing
 
One word: magical
 
a day on which I don't need to touch my mouse is a good day
(I don't think such a day has ever happened to me, though)
meh, I can't open the review queue with it
 
11:04 PM
I can't use modtools with the keyboard shortcuts. goes to complain on meta
 
please do, you have my upvote
 
Eeek, we can't upvote / flag / edit / delete comments either
 
that's a letdown...
it's a good start though
 

« first day (1274 days earlier)      last day (3552 days later) »