last day (15 days later) » 

11:23
Hey, just a second about your challenge ...
I just noticed something about the boxes
The 1/2, 1/4, etc. is supposed to be the probability of hitting it, right?
Yeah, the problem is that works well with n=3 because 1/2+1/4+1/4=1 but for n=5 or n=1 that wont work, because for n=1 1/2!=1 and for n=5 1/2+1/4+1/4+1/8+1/8!=1
I know it won't equal 1
11:25
(Thats also a reason why the formula I posted won't work)
It's not meant too
But then it can't be the probability?
Think of it as being a 1 in 2 chance of hitting in the middle, then 1 in 4, then 1 in 8 etc...
Perhaps probability isn't the correct word choice
Yeah i guess it isnt
Because if you have only one box you can't have a 50% chance in hitting it, right?
Not in reality no but for the challenge yes. For n=1 each frame you have a 50% chance of hitting the canvas (as the box fills up the whole canvas)
11:30
Hm
I believe I get it
... kinda atleast
I'd show you my reference implementation but it's golfed :P
I'm just afraid that others wont understand it
If you want you can show me, and I will restrain myself from entering the challenge :P
No no I want to see how mine compares to yours :)
If I change probability to chance would that be easier to understand?
Well I guess the easiest way would be to give the chance in % (maybe)?
I was keeping it as fractions because it's easier to read, in my opinion at least
11:34
Let me give you an example real quick on how I understand it: for n=1 a particle being placed has a 100% chance of being inside (the only) box. For n=3 a particle has a 25% chance of being placed in the left or the right, and 50% in the middle.
Is that correct?
Yeah fractions is way better than %, i agree, but they should sum up to 1 I guess
So for `n=` per frame you have
`1` 50% chance of landing in the middle box
`3`50% chance of landing in the middle box, 25% of landing in the next
`5` 50% chance of landing in the middle box, 25% of landing in the next, 12.5% in the next
Where only one particle will land per frame.
Formatting -_-
But if there is only one box in n=1 how can it miss?
Because it isn't real life? Plus doing it that way would make n=1 a special case and I wanted to avoid that
Im curious if I am going to do it correctly if you upload it xD
Whatever, since apparently I am the only confused with this, you can leave it as it was
11:50
or the only one that has read it
Essentially
`loop centre to edge`
if chance
set particle
break
something like that
chance = 2
woops
Pseudo
chance = 2
loop middle to end; chance *= 2
if chance
set particle in box
break
But wouldnt looping from middle to end mean that 2 outer boxes at a time would be added a particle?
i.e how does the program now in which one of the sideboxes it has to add a particle?
Well in my reference I loop mid to end, if chance I then do a random.Next(2) < 1 to work out if I'm placing it to the left of the middle or right
ahh thats a nice little hack :)
Now your fractions make alot more sense to me
Meant I didn't need to come up with a formula as well
Ahh good
Should I change anything in the challenge so it is clearer?
Yeah, you don't need a formula that way
I think it's fine, was probably just me overhinking reality & coding
The question is whether its more efficient in terms of bytes with a formula ;)
12:02
Exactly, I'm no mathematician, I did Physics for a bit at Uni before becoming a programmer but I've never been the best at more complicated maths.
I think I lost interest in maths when I found physics so I stopped learning it, to an extent anyway
Sometimes you just don't get around some mathematics, atleast when I'm coding
It sometimes makes your work alot easier :)
Then again, as a game programmer thats a difference probably
Oh yeah I enjoy working it out.
Just I don't always think of it because I'm not as interested in maths as I once was.
You can work around everything somehow ^^
Yeah, it gets boring pretty fast though
I created an OMR engine last year. That's full of maths
I'm sad that my teachers basically ruined my physics classes by showing no interest at all
12:09
I had to fight to do physics, my college wasn't going to run the course
And were you lucky?
Yeah, only because someone who said they wasn't going to do it changed and said they were. And even then it was because her mum worked there as a TA
12:25
Hahaha, nice :)
Think I'll post the challenge tomorrow, depending on any other feedback
Alright, hope that I'm around when you do so :)
Well it'll be 9-5.30 GMT tomorrow, probably the early side
Im going to work on the code dogs vs robbers once I get home, can I count on your support? ;)
Sure if you need any help with it let me know
12:32
Uhmm GMT is CET -2 right?
Thanks, it'll be on sandbox anyways :)
UK time :P I'm not the best with timezones
Alright, i should be kinda around nevertheless
Hope that nobody steals my C#
I'll be leaving this chatroom now, (potentially) see you tomorrow!

last day (15 days later) »