« first day (4233 days earlier)      last day (600 days later) » 
00:00 - 14:0014:00 - 00:00

2:00 PM
yes and that is great!
thank you
 
@graffe Do you watch Primer? This really reminds me of the primer challenge
 
@mousetail I don't! Let me look it up
 
No it's a youtube channel
recently they posted a coding challenge
There where cheating and fair coins
 
link please!
 
you needed to determine which was which in the fewest number of flips
@graffe Can't access youtube at work
 
2:02 PM
ah ok... what should I google? primer doesn't do it for me
@mousetail that does sound cool
 
@graffe Search for primer on youtube
It's not their most recent video but the one before I think
 
that gives me "Primer Learning"
 
Best players got -0.05 which is insane
@graffe Does it have a lot of brighly colored blobs?
 
yes!
 
That's probably it then
 
2:04 PM
I think it is.. thanks!
 
discord.gg/HmbMFeFH this is the discord channel where we dicussed optimal strategies
 
maybe make your own room?
 
nice!I hope you can discuss the witch's puzzle too
 
i found the problem its kind of silly
 
Well the prize for that challange was a lot bigger
 
2:06 PM
i had the cost as 2y and not 2^y :P
 
lol
 
@thejonymyster :) in python 2^y would be a mistake too!
 
that would make things a lot easier
 
@mousetail bigger than pride on the internet?!
 
A blob plushie and a t-shirt
so not great
but still worth more than just pride
 
2:08 PM
where the q?
 
ok now my averages are in the 16k range
 
1
A: Strategy: The cunning cousin witch

mousetailRust, score= ~6,081.9 Guesses each number 1-9. Aborts if the number found is less than 0.8 * number. use rand; use rand::{Rng, RngCore}; struct Which { rng: rand::rngs::ThreadRng, numbers: Vec<f32>, score: f32 } impl Which { fn new(rng: rand::rngs::ThreadRng) -> Which { ...

 
@thejonymyster that sounds much better
 
yeah im glad it was just that and not something weirdly wrong about the rest of my code
 
That's really close the the analytically computed score
 
2:22 PM
@mods maybe move these?
 
Make a room and I will
 
@mousetail did you try optimizing over the constant 0.8?
 
@graffe you or me
 
that is trying different values
 
@graffe Nope, just random guess
 
2:25 PM
@NumberBasher sorry?
 
I'm sure changing it would improve the score
 
@mousetail ah.. well that's an easy improvement :)
 
Also using a step size other than 1.0 would probably improve it
 
all sounds good to me
 
@graffe i mean, who make a new room for your challenge
 
2:27 PM
on discord?
 
on SE chat
 
No on here
 
could you please do it
I will have to go in a little bit to go to a birthday party!
but what is wrong with chatting here?
 
well this is tnb, not "graffe's challenge discussion"
 
@graffe omg have fun yay
@NumberBasher tnb is about cgse, which contains graffe's challenge :P
 
2:29 PM
doesnt mean its the best place
 
@thejonymyster thanks!
 
fair point :P idk then lol im just riffing
 
Is the discussion whether this topic is off topic itself off topic?
3
 
I think the conversation is fine here
If it starts pushing out more relevant discussion, then sure, take it elsewhere, but it's fine atm
 
@cairdcoinheringaahing thanks
 
2:32 PM
oh ok
 
@mousetail maybe the various parameters can be plugged into scipy to be optimized?!
 
@graffe Maybe
 
@mousetail :)
 
You'd have to find a analytical way to compute the score though
I'll leave that to others
 
@mousetail can you just estimate it by running it a thousand times?
 
2:34 PM
Yes, but not witth SciPi right?
You could do some kind of biased random walk algorithm
 
@mousetail why not? I mean define a function score that takes some parameters and returns the estimated score
then optimise that function over the choices of parameters
 
Oh you mean fitting the expected score to a curve with some kind of non-linear regression then finding the minima
Maybe possible but seems very hard compared to biased random guessing
 
@mousetail I wasn't thinking over anything so clever. I literally meant have scipy optimize a function that you define that takes some parameters
there are methods that don't need derivatives
just anything function that returns a number will do
 
just in our case the number will be an estimate
 
2:38 PM
bye guys
just ping me for anything
 
@graffe How do you find the function though?
 
@mousetail as an example, the function takes in a single number and runs the simulation for 1000 iterations. Let's say the number is the value of 0.8 in your code so a real between 0 and 1
 
You can't optimize a function like that in scipi I think
 
the simulation gives us the estimate of the cost for a particular value of that number
 
It needs to be differentiable
 
2:40 PM
@mousetail It doesn't. They have fancy things now like shgo
 
Ok that's probably the biased random walk I was talking about
 
ok :)
let's bet what the best score will be?
I am going to go for 2000
 
2:59 PM
hmm.. no bets?
 
3:24 PM
@graffe I'll bet 1 (one) rep that I don't win
 
3:58 PM
I guess I never noticed the meta post said the nominator is supposed to post the post
 
my strategy of "do the naive strategy with a number less than 9" doesnt seem to be getting me anywhere
 
4:26 PM
@thejonymyster Try a different number, but if you are close enough try a bigger number
 
4:39 PM
@mousetail but how do I give it to you when you do!
 
@mousetail oh yea that makes sense lol
 
5:15 PM
@graffe So a accept is 15 rep and a downvote 2 so all you need to do is accept my answer then downvote is 7 times.
 
5:26 PM
or just upvote once, then you have to downvote 9 posts yourself.
(if you downvote an answer, you lose 1 rep)
 
Yes that's probably easier
now how do I found 9 down vote worthy posts
 
5:43 PM
Or, just accept and downvote one answer
 
5:57 PM
0
Q: Language of the Month for September 2022: Prolog

SteffanIn accordance with our meta agreement, since one candidate received more votes than the others, we have a new featured language! Throughout September 2022, our Language of the Month will be: Prolog What's a Language of the Month? See the meta post for nominations. In short, during September, th...

 
6:15 PM
@Feeds Lost too much rep last time that you are changing it from 3rd answer to 5th?
 
6:32 PM
no it's just that prolog is easier to program in than knight
so it's easier to write more answers
(imo)
 
You think? Maybe IDK
 
I only lost a couple hundred, wasn't much
Knight is like a bare minimum language, you know, no builtins for anything
And no lists
Prolog is more normal, builtins for all sorts of stuff
IMO, much easier to write code
I guess the rep is part of it, because I'm so close to 10k
 
6:49 PM
I can start bounties if you like
Or instead I can award a couple +500 to strffan or someone in case I’m not around to award them
@Steffan how much do you think you’ll need? I can spare like 4000
Oh wait I can spare more than that, noice
 
7:06 PM
@hyper-neutrino @WheatWizard Could you unfreeze the Prolog room? Thanks and sorry for the pings
 
0
Q: Detect round trips on a dodecahedron

KarlAn ant starts on an edge of a dodecahedron, facing parallel to it. At each step, it walks forward to the next vertex and turns either left or right to continue onto one of the other two edges that meet there. A sequence of left/right choices that returns the ant to its initial state (edge and dir...

 
9
Q: mini SPICE solver

helloworld922SPICE is an electrical circuit simulation program originating from UC Berkeley. Your goal is to implement a minimalistic version which can solve for the nodal voltages and branch currents of a circuit composed of resistors and DC current sources. Input Format The input may come from a file, io ...

36
Q: Sum of Modulo Sums

AdmBorkBorkGiven an integer n > 9, for each possible insertion between digits in that integer, insert an addition + and evaluate. Then, take the original number modulo those results. Output the sum total of these operations. An example with n = 47852: 47852 % (4785+2) = 4769 47852 % (478+52) = 152 47852 ...

 
7:30 PM
Say, would anyone here happen to know the best way to optimize some trivial assembly?
	ldh [32]
	and #0xf3f
	jeq #0x01, drop
	jeq #0x02, drop
	jeq #0x04, drop
	jeq #0x08, drop
	jeq #0x10, drop
	jeq #0x11, drop
	jeq #0x12, drop
	jeq #0x14, drop
	jeq #0x18, drop
	jeq #0x19, drop
	ret #1
drop:
	ret #0
I can't think of any efficient way to optimize this since jumps are only allowed forward (language is cBPF).
 
@mousetail :) I will resist the temptation
 
@forest Depending on what you're optimizing for, you can post it as a tips question on the main site (disclaimer: may fuel the current controversy ;P)
 
@user Size (actually performance, but size has a nasty overhead in this). These are TCP flag combinations.
 
That sounds like an objective winning criterion to me
 
hm
 
7:35 PM
If you post it as a question there are definitely people on CGCC who know assembly who'll see it
 
It's not CG though.
 
Here it's less likely to be solved
 
Just optimization of a regular language.
Yeah I know. Was asking just in case anyone happened to have a quick idea.
 
@forest If you're shortening it it's just code golf right
 
Perhaps. I'm not sure since I haven't posted to CGCC before. :P
 
7:38 PM
@forest What are all the possibilities? Maybe swapping #1 and #0 would let you have fewer jeqs?
 
What do you mean?
All the possible instructions? Flag combinations?
 
Wait I misunderstood
 
@lyxal Probably :p
 
I thought you're checking if one single item on the top of the stack is 0x01 or 0x02 or ... (I was asking what possible values that could have)
 
Although I'm nomnating you
 
7:39 PM
I think you can only nominate yourself?
 
@user It loads a half-word from address 32 into the A register, ANDs it with 0xf3f, then checks it against all those other immediates.
 
@user No?
 
Okay, so it is just one thing
@emanresuA Oh ok
 
I don't really know either but it seems sensible
 
@forest What are all the possible values for that half-word, I meant?
 
7:41 PM
@user All possibilities within the limit of the bitmask 0xf3f.
 
@WheatWizard Would you mind putting prolog LoTM on the upcoming events board?
 
You can always raise a flag
 
True
 
 
1 hour later…
9:16 PM
0
A: Sandbox for Proposed Challenges

caird coinheringaahingPersistence of a number Given a blackbox function \$f : \mathbb N \times \mathbb N \to \mathbb N\$ and a positive integer \$x = d_1d_2d_3...d_n\$, where \$d_i\$ are digits with \$d_1 \ne 0\$, output the persistance of \$x\$ under \$f\$. Shortest code wins

 
9:46 PM
@user keep your rep lol
 
@thejonymyster I appreciate the feedback, but I've posted ^^ to get it down on paper, not to get feedback :P
It's a lot easier to edit an existing post than it is to have a draft to work on
 
Well i guess ill explode then
nah i get u ^_^)b
excited to see it fleshed out then, take ur time
 
10:01 PM
typo: persistance
 
10:28 PM
@Steffan I don't want or need it
 
11:22 PM
@forest seems the logic can be factored into something like this (depends on instruction support though):
if x == 0x10 or 0x19: return 0
if (x & 0xf20) != 0: return 1
x = x & 0xf
if x == 0x1 or 0x2 or 0x4 or 0x8: return 0
return 1
 
@Bubbler Hm, OK I'll try writing it like that and see if it's shorter.
The first "if x == 0x10 or 0x19" probably wouldn't work because the and #0xf3f is used to mask out bits that should be ignored, so I'd have to still keep that AND in there.
 
Oh, I meant after x = x & 0xf3f
 
Since there's only one general-purpose register and one index register, doing if (x & 0xf20) might require an extra instruction or two.
Er, actually no, I can use jset for that.
Yeah it looks like that saved two instructions. I'll test it out.
(It'd be easier if it had some sort of popcnt, but it doesn't)
	ldh [32]
	and #0xf3f
	jeq #0x10, drop
	jeq #0x19, drop
	jset #0xf20, match
	and #0xf
	jeq #0x1, drop
	jeq #0x2, drop
	jeq #0x4, drop
	jeq #0x8, drop
match:
	ret #1
drop:
	ret #0
 
11:41 PM
If the machine was something closer to x86, I could suggest something like selecting x-th bit from a 32-bit constant (the ten positions are 0, the rest are 1)
 
00:00 - 14:0014:00 - 00:00

« first day (4233 days earlier)      last day (600 days later) »