« first day (4307 days earlier)      last day (834 days later) » 

00:10
@JoKing does the 31 byte solution have something to do with walrus operator?
how would that be shorter
Good point
Gahhh
 
2 hours later…
@Bubbler none, post it :3 I wanna see someone's <9999 solution
02:18
@DialFrost yeah
@Seggan howd u find 80 dart leh? :p
i didnt
watch who you pinging bro
were not a hivemind anymore :P
0
Q: 50 digits of π in HQ0-9+-INCOMPUTABLE?

BubblerBackground HQ0-9+-INCOMPUTABLE?! is a half-joke programming language introduced in Internet Problem Solving Contest 2011, Problem H. HQ9+ is an esoteric programming language specialized for certain tasks. For example, printing “Hello, world!” or writing a quine (a program that prints itself) cou...

02:35
@DialFrost what you talking abt anyway?
@DialFrost Kotlin
@Seggan 80 byte dart quine, i got 85 lol
where
@Seggan code.golf
wait i meant to ping @Steffan not seggan
:/
earlier lol
me when the issue why my code wasnt working in JS was cuz of " vs '
 
1 hour later…
03:53
for this is the "binary fraction" jsut a binary?
im confused
int(binary,2) doesnt seem to work
integers are, by their nature, whole numbers
my poor attemp that works partially
x=y=0
a=""
while-43516<y:a+=str(1+x%2);x^=~y&~-y;y=~-y&x//2
a="."+"".join(str(int(x)-1)for x in a[1:])
print(int(a[1:],2)/2.**999)
it doesnt give enough decimal places unfortunately
try to not use floating point numbers
@Bubbler ?
why tho
04:03
like the other constant holes, you should try starting with 10**1000 representing 1
floating points have limited precision
because a float can't accurately represent 1000 digits of decimal
@JoKing ???? I can't solve the other constant holes though
@Bubbler oh
@JoKing wdym 10**1000 representing 1
@DialFrost the classic 0.1 + 0.2 != 0.3
more like: print 0., and then print a 1000-digit integer
@JoKing why does it print 0.3000000004?
04:05
> floating points have limited precision
0.3 is not a power of 2, or an easily representable sum of powers of 2, so it gets mangled to the closest a float can manage
or in python, you can use decimal module I think, though it won't do a good job at short code
@Bubbler sigh ok thanks (not trying any more constant challenges anymore lol)
try looking at the pi or e challenges here on CGCC for inspiration
04:08
you really need to try to solve things first before even trying to golf them
5
this is why I recommended codewars the other day
@Bubbler ye I can't lmao
you can only get so far with googling the problems and modifying other people's solutions
@JoKing I tried but don't understand
@JoKing tru..
@JoKing the attempt above was all mine except the sequence part
has a few redundant parts, like that whole fourth line
you add one to each digit, only to use a whole line to remove it again, and then do the same again with the .
also you need more than 3000 binary digits to get 1000 digits in decimal accurately
04:15
@Bubbler OverflowError: int too large to convert to float whoopsie
that magic number, 3320
@JoKing ?
that's roughly how many iterations you need for most constant holes
this error aint allowing me to get any larger iterations, lemme find another way round
just checking, do you understand how a fraction works in binary? otherwise you're probably not going to be able to get it
04:18
@JoKing no
oh, err okey then
0.111_2 = 2**-1 + 2**-2 + 2**-3 = 0.5 + 0.25 + 0.125
@JoKing huhhhh???
how does 0.111 = 0.5+0.25+0.125
that's how binary works with a decimal point
in base 10, 0.111 = 0.1 + 0.01 + 0.001 = 10^-1 + 10^-2 + 10^-3
you get this?
so when i said you can represent 1 as 10**1000, you can then use 10**1000//2 to represent 2**-1 = 0.5 and then represent all the rest of the digits with integers
04:22
so 10 is 2 in base 2 right
10_2 = 2_10
@Bubbler god this is so confusing
is there some standard notation for bases without using Mathjax?
I don't think so
04:23
@JoKing er wut..oh well just forget it
what part don't you understand? you seemed to get the division by 2**999, which shifts the binary integer to a fraction
 
1 hour later…
05:53
this guy requires exactly 10 rep to get 10k :p
@JoKing sorry i just got frustrated so i didnt wanna try it sorry :(
06:40
anyone have any hitns for 55 bytes? JS collatz code.golf
f=n=>n-1&&-~f(n%2?n*3+1:n/2)
for(i=0;i++<1e3;)print(f(i))
07:00
@DialFrost On week golf the solutions are public
@mousetail i tried logging in with github and it bugged btw
Log in on SO
Tell @TKirishima if it's bugged
@mousetail wdym
The solutions are public
So you can see how collatz was done in every language
There is no pure colatz challenge but one that includes a collatz component
i got confused by what the challenge was asking for and gave up lmao
@mousetail u have to do it first right
like post mortem?
07:08
No
This is a old challenge
Answers are secret for only the first week of each challenge
oh
@mousetail really meh
i took a look at the solution, didnt see much interesting stuff
Mostly look at t he difference between the best and second best
those are golfs
@mousetail and that will give me 55 bytes somehow? XD
07:11
No you do that yourself
This is just hints
@mousetail no
you wanted hints
I meant hints
since when this challenge is hints lmao, its honestly a ... complicated one
 
2 hours later…
08:56
@DialFrost there's a blank space in the for loop you aren't taking advantage of
@JoKing blank space??
after the second semicolon
oh
you can put something there???
you never seen the traditional for(x=0;x<i;x++) style loop?
ya I've seen it
but I was asking what to put there lmao, cuz I don't see anything of use
09:02
@JoKing tbh the first kind of loop I've seen is for each [x v] in ()
from scratch removed blocks
@JoKing the only other 2 things avaiable are the print(f(i)) or the function, both where i dont see any adv
you can save on the newline
I tried that, unless I messed up the syntax
isnt JS function style like this? f=n=>...
no alternatives?
you can also do f=(x,y)=>... for multiple parameters
or f=x=>y=>... for chaining
09:19
new hobby, short-circuiting other people's boolean expressions. Just wait for them to ask something like "Is the meeting in one hour or-" and hit them with the taser
7
@JoKing speaking of booleans, it turns out we can use ternaries in python in while loops when declaring the condition
wait, like while x if cond else y:? i guess that makes sense
exactly
which is a new revelation
we can now take over the whole world we can now golf our code even more
i feel like there's usually a shorter way to handle booleans than the native ternary
[a,b][c]
09:28
@mousetail what does that do?
What do you think?
looks... non-pythonic to me
Yes of course, but it's much shorter than a if c else b
@mousetail multiplies 2 lists, making no sense
multiply? it's just indexing
09:29
I mean
(forget algebra already!)
there's no algebra here
yeah my bad
it's literally just indexing a array
my math exam is still in my head
Im coming to terms that I didnt get full
although I topped
besides the tio link is an answer to The Thonnu's most recent sandbox challenge
which I think borrows off yours
Doesn't seem related at all
09:35
you know, the classical "replicate the x function of language y"
That's not what my challenge was like at all, those are bad challenges
0
A: Sandbox for Proposed Challenges

The ThonnuImplement Python's range function code-golf Your task Given up to three inputs, \$a, b, c\$, output list(range(a, b, c))*. * range doesn't actually return a list in Python 3, but we'll assume it does. Explanation In Python, the range function can take different numbers of inputs: If there is on...

Its just my opinion
so I may be wrong
I dislike those types of questions, since any real function in a real language has way too many edge cases
leave a downvote then
besides i think the first rule is useless cuz smart guys will use workarounds
CMC Given a number, output the base so that the number in that base has the greatest number of unique digits. If there are multiple output the largest. For example f(12)=10, f(27)=4, f(44)=5, f(101)=8, f(156)=11
09:46
I'm having a feeling you've asked this before
It was different
The sequences are related though, but kinda inverse
but not quite
What's the answer for f(10)
just asking
8
or 9
My program says 8 but I think it should be 9
what about 1234567890?
That would take wayy to long to calculate
0003      2      3
0004      2      4
0005      3      3
0006      4      4
0007      3      5
0008      5      6
0009      4      7
0010      6      8
0011      3      9
0012      7     10
0013      4     11
0014      3     12
0015      3     13
0016      3     14
0017      3     15
0018      4     16
0019      3     17
0020      6     18
0021      3     19
0022      3     20
0023      3     21
0024      4     22
0025      3     23
0026      4     24
0027      4      4
0028      4     26
0029      3     27
left column is lowest equal value, right is highest
09:50
Ok this is now getting confusing
so i quit
Try yesterdays one then
nice try, but I only answer code-golf questions from twitter gadflies
@JoKing hmm but i still dont see how a function can fit there
10:15
It seems to give a reference error :/
have you tried declaring the function before you use it?
then i don't see why you would get that error then
10:50
@JoKing i probably did it wrong
the last byte is a bit cleverer
oh so its supposed to be 56 after putting the func in? (ignoring the last byte removal)
i kinda just plonked it in :/
for(i=0;i++<1e3;f=n=>n-1&&-~f(n%2?n*3+1:n/2))print(f(i))
what'd I do wrong?
> have you tried declaring the function before you use it?
The last clause in for is evaluated after each iteration
oh :facepalm:
@emanresuA i tried putting it in the first clause, doesnt print anything :P, second clause gives error
@JoKing I... er did? Or I just don't understand JS lol
11:03
Swap the print and the declaration
??
ah nvm got it at 56 rn
@JoKing cleverer in what way? :3
@emanresuA smart
start with the fact that n-1 can also be ~-n and go from there
hm
On first looks it seems useless, does it have something to do with the && in the middle?
12:03
Hi! What is the bug that you have?
@mousetail thanks for notifying
@DialFrost said he had a issue logging in with github
@TKirishima i tried logging in with github and it didnt work :(
Did you have any errors ?
ya
gimme a sec lemme find it
darn i cant log out
So you are logged in ?
If you want to log out you can go on settings + Log out at the bottom of the page
From what I see you already have an account: week.golf/profile.php?id=294
12:09
This page isn’t working
week.golf is currently unable to handle this request.
HTTP ERROR 500
this is when I try logging in with github ^
@TKirishima ye
Well, Ill look at it. I have to go for the moment. Maybe log with SO as it seems it worked last time?
yup that works
 
2 hours later…
14:08
@JoKing i give up :(, I alr know that trick and it doesnt seem to help
 
2 hours later…
15:58
Hello! I am new here, so sorry if this question is very basic. When someone golfs your answer further is it standard practice to edit your answer to include the new golfed version?
Yes, usually you'll cross out the old score (with <s>/</s>) and add the new one, then update the code and add a short thank-you to the person who suggested the golf (like "-1 thanks to @[person]")
@huanglx Yes, if someone suggests a golf to your answer, generally, people will edit their answer to include that. The main time when people don't, is if they believe the new version is distinct enough from their original answer as to merit another another
thanks
16:37
@DialFrost I just wrote it myself?
I wrote a program that read its own source code?
The filneame is /tmp/code.dart
@DialFrost See this hint
17:09
argh ofc i have a great challenge idea while falling asleep and i forget now
 
1 hour later…
18:39
f
also wait when did you unfuse
19:28
They never unfused, it's still one hivemind typing those messages, it's just made two socks. See how they're not interacting with each other? It's because they're the same entity. I say ban both accounts
exactly!
19:46
Can't believe I missed a numberphile challenge
ooh two left
tnb seems really quiet, even though it's monday
20:49
old news
lmao
21:21
seggan actually means something
> the stinking iris
idk if that's what you want to be known as

« first day (4307 days earlier)      last day (834 days later) »