« first day (2376 days earlier)      last day (2468 days later) » 

9:00 AM
@LeakyNun Do you have another CMC for me (Pyth or Jelly, depending on the challenge)?
 
10
Q: Range, Reverse, Sum!

Comrade SparklePonyGiven a positive integer n as input, output the reversed range sum of n. A reversed range sum is created by making an inclusive range up to n, starting with 1 and including n, reversing each of the numbers inside, and summing it. Example: Here is what would happen for an input of 10: Range: [...

don't look at the answer :P
 
@LeakyNun Sure
@LeakyNun I have 7 bytes. How long is the current answer
?
 
@Mr.Xcoder For that case yeah, but I meant in the more general sense. And how do you even read it in the 20 seconds? :P
 
This is why I think the voting buttons should be at the bottom of the post
 
9:02 AM
@TheLethalCoder I get notified instantly, I am online, read it (because it's short) and then test it, if it works I upvote
@LeakyNun I have sms_`dS
Sorry, markdown
 
Yeah I'm not saying it's a bad thing I was just wondering. Also 20 seconds to load the page, read it, load the testing page and then test is quite short. That was the only reason I was wondering.
 
similar
 
I think the d there can be removed somehow...
@LeakyNun We're both dumb
I commented ~2h ago on that answer and noticed now...
 
Anyone else have chat time out on them and constantly have to retry their messages. Or is it just my terrible internet?
 
@TheLethalCoder You have terrible internet
 
9:06 AM
I assumed as much
I'm at work and it is terrible here.
If someone uploads something, that's the internet gone down until they're done.
 
@TheLethalCoder You're at work and stay on PPCG at the same time?!
CMC: Give me a CMC
 
@Mr.Xcoder It's the only time I'm on :P
I keep a tab, or two, (or at the moment 6) open...
 
I guess I don't know what work is like, since I am too young
 
I answer challenges when I'm on a mini break
So I keep tabs open to the challenges I intend to answer.
 
Noice
Won't anyone solve my CMC above?
2 mins ago, by Mr. Xcoder
CMC: Give me a CMC
 
9:11 AM
Brute force it
 
If Charcoal did it in 80 bytes and it's ASCII-art, I highly doubt anyone will get down to 75
 
import time

test = 123456789123456789
temp = 0
N = 100000
pre_store = 10000

def rev1(n):
	r = 0
	while n:
		r = r*10 + n%10
		n //= 10
	return r

digit_reversal = [rev1(x) for x in range(pre_store)]

def rev2(n):
	r = 0
	while n >= pre_store:
		r = r*pre_store + digit_reversal[n%pre_store]
		n //= pre_store
	p = 1
	while p < n:
		p *= 10
	r = r*p + digit_reversal[n]
	return r

start = time.time()
for _ in range(N):temp = rev1(test)
end = time.time()
print(end - start)

start = time.time()
for _ in range(N):temp = rev2(test)
0.5310304164886475
0.2240128517150879
0.08000445365905762
How on earth is the last one the fastest?
RIP python
 
What ?!
Leaky Now I need another CMC... If you have any ideas, I'd be glad to solve them
 
@LuisMendo mobile is hard :)
 
@Mr.Xcoder I don't have much idea
 
9:16 AM
@LeakyNun I probably should go solve the X in Jelly (already solved the median related stuff)
 
@Mr.Xcoder alright
 
9:28 AM
@flawr Exactly! I couldn't even edit the message :-) What of those languages is your native one? I'm betting on German
 
@Mr.Xcoder 76 actually?
 
@EriktheOutgolfer The answer was Edited in the meanwhile
 
@Mr.Xcoder well, 1 more byte and your doubt is invalid
 
@EriktheOutgolfer I was talking about other languages
BTW look on JHT
 
yeah I see that one
 
9:42 AM
@TheLethalCoder It's a really long time to me
 
@ASCII-only I have slow internet and am not the fastest reader so might be why it seems quick to me then!
 
@LuisMendo It is indeed:)
 
@Nobody custom oneboxes, there are a bunch of userscripts that do this
@DestructibleLemon :| this has no winning criterion at all, meaning it isn't a challenge and therefore doesn't belong on ppcg if i understand correctly
 
Yay I fixed all of my problems using Crystal!
def clear
  print "\e[2J\e[0;0H"
end

def get_cursor_pos
  print "\e[6n"
  line = ""
  char = '\0'

  while char != 'R'
    char = STDIN.raw &.read_char
    if !char.nil? && char != '\e'
      line += char
    end
  end

  line = line[1..-2].split(";").reverse.map(&.to_i)
  return line
end

clear
puts get_cursor_pos
 
10:03 AM
@Qwerp-Derp I recommend using pastebin.com or gist.github.com for larger multiline pastes
 
15 hours ago, by wizzwizz4
CMC: Clear the unanswered list.
@Mr.Xcoder good luck doing this CMC ^ :P
 
@ASCII-only I am training with Erik in JHT
 
@Mr.Xcoder yeah well you wanted a CMC to do :P
except this one is already done
 
Could someone have a look over my sandboxed challenge
1
A: Sandbox for Proposed Challenges

TheLethalCoderThe Double Slit Experiment code-golf ascii-art physics random animation A lazy physicist has the job to perform the double slit experiment. However, they are lazy and can't be bothered to set up all the equipment themselves and so are going to simulate the effects. They can't program though so ...

 
10:20 AM
@flawr Yeah, I just got excited :P
Will do a hastebin next time (or something similar)
 
@ASCII-only best cmc ever
 
10:32 AM
@EriktheOutgolfer i know right
@Titus Yeah no that was CJam
 
@HelkaHomba Do we currently have a PPCGMCserver..?
 
@ATaco Downgoat had one that got abandoned
 
:(
 
11:09 AM
Is there anyway to shorten this in C#? int x = someCondition ? m + 2 * i : m - 2 * i; where m and i are both ints.
 
int x=someCondition?m+2*i:m-2*i; for starters.
 
Yeah I meant just the code not the whitespace but thanks :)
 
m-2*i*(1|-+condition)
 
> -+
really?
 
God bless C#.
 
11:14 AM
Fixed.
 
I just had m+i*condition?2:-2, but I'm not sure that would work.
 
@EriktheOutgolfer Not sure, but I'm assuming it works like Java.
In which case, yes.
 
I think you'd have to do condition?1:-1
 
Well it's explicitly m(+-)i*2 in this case, so 2:-2 works best.
 
@TheLethalCoder why do you want to shorten it
 
11:18 AM
Working on a reference, golfed, implementation for my sandboxed challenge
I actually managed to shorten the surrounding code to make that ternary shorter anyway
 
m+i*(someCond?2:-2) is the shortest I can get it.
 
Because I changed the code around it, it's now int x=n-1+(condition?i:-i);
 
Golfing the reference implementation is less than helpful.
 
I'm not posting it, I meant more like reference for myself of how it can be done.
 
2
A: Is it an Ordered Word?

Magic Octopus Urn05AB1E, 36 bytes v.•1нJ©½è`ÇHø¹á₂N¸°…ÈáÀ•#Dʒyå}k}¥0‹Ë Try it online!

 
11:24 AM
And because I'm competitive I want to see if I beat any C# answer posted.
 
The comments on that lol
 
0
A: Sandbox for Proposed Challenges

programmer5000code-golf tail: troll: file truncated Background When you run tail -f file in bash, the file is outputted and then any subsequent appends. However, when you remove something that has already been displayed, tail outputs: tail: nameoffile: file truncated Your Challenge When given an input ...

2
 
11:35 AM
ugh why c9 :| serously why is there always a cpu leak in the charcoal c9
@totallyhuman yeah O_o
 
@Mr.Xcoder yea there should be
 
basically there's .T and .t
 
@Mr.Xcoder 1. it's 71 bytes :P 2. that's because there's a lot of arithmetic, idk if sogl will do better
 
@ASCII-only 1) I was talking about languages other than Charcoal 2) That answer was edited 4 times since I left that message 3) Charcoal FTW
 
11:44 AM
@LeakyNun well the second one creates an expensive list, idk about the first one, maybe some vm overhead over pure c?
oh hmm if you can find any theoretical new features that would make the charcoal answer shorter pls suggest them
 
@ATaco userscript request: get se inbox items when someone votes one of your sandboxed posts
 
@EriktheOutgolfer I got the same thing as before in Jelly pyth.herokuapp.com/…
@EriktheOutgolfer 15 bytes
Do you know of a shorter way? (KE is dumb)
 
Okx
CMC: Calculate the sum of the ASCII values of the input. Should support all characters in ASCII range 32-127
 
@Okx Why 0-127 and not printable ASCII (32-127)?
 
Okx
¯_(ツ)_/¯
because i can
okay i'll change it :P
 
11:51 AM
@Okx Pyth, 3 bytes: smC
 
@ASCII-only the list is precalculated for the second one
this is what makes it faster than the first one
 
Okx
I don't think anyone knows this, but Neim automatically sums the ASCII values of the input if it is not a valid number (so it wouldn't quite work for this challenge)
 
@Okx Python, 14 bytes: lambda s:sum(map(ord,s))
 
Of course, Jelly 2 bytes
@Okx Jelly, 2 bytes: OS
 
@Okx 05ab1e, 2 bytes: ÇO
 
11:53 AM
idk if Charcoal needs a sum builtin
 
@Okx his arm is broken again
 
Okx
ugh
 
@Okx You need \\
 
@ASCII-only Python 3, 3 bytes: sum (input as bytes)
 
Okx
¯\_(ツ)_/¯
hey
 
11:54 AM
¯\\_(ツ)_/¯
Code markdown ^
Fail :)
@Sp3000 Not sure that's valid :P
 
@Mr.Xcoder no
@Sp3000 invalid...
 
@EriktheOutgolfer Ok thanks... That means I did well
 
I have KEj_.tm*\#.cdKS
except...
 
The same length?
 
no
KEj_.tm*N.cdKS
uses "s
 
11:57 AM
@EriktheOutgolfer Now it does: KEj_.tm*N.cdKS
@EriktheOutgolfer Equivalent: KEj_.tm*N.cdKh
 
@EriktheOutgolfer but :(
 
@Mr.Xcoder umm, doesn't that have a leading empty column or something?
 
@EriktheOutgolfer Nope
@EriktheOutgolfer Oh it does
Yeah, just the first one is valid
*Abuse of unary range* – ****Facepalm****
 
KEj_.tm*.cdKNS is an equivalent though
 
@EriktheOutgolfer Yea
@EriktheOutgolfer I beg isaacg would outgolf us
 
12:01 PM
dunno I've outgolfed him in the past
btw another equivalent would be
 
@EriktheOutgolfer Me too
But he outgolfed me in Pyth too
 
JEj_.tm*N.cdJS
 
@EriktheOutgolfer Ha. J instead of K
 
JEj_.tm*.cdJNS
 
@Dennis hmm I have no idea. undeleted
 
12:03 PM
@EriktheOutgolfer Now I should Pyth Hypertrain
 
that's not a good name
 
@EriktheOutgolfer I know
 
also we haven't needed such a thing yet
 
Pyth Hyperisaac?!
 
12:04 PM
@EriktheOutgolfer We have one
But it's not really a class
 
and it's frozen right?
 
It's just an informal training room
@EriktheOutgolfer No
 
hi all
 

  Pyth Training

A room founded by Jim and Mr.Xcoder for Pyth training
@Lembik Hi
 
could someone help me with a simple fastest code challenge please?
I want to ask for the fastest code to take the product of n complex numbers
but this has to be timed somehow in some precise way
and it needs some input
any ideas gratefully received
 
12:06 PM
@Lembik that's interesting
I would probably divide and conqueur
 
@LeakyNun thanks :)
 
@Mr.Xcoder what does the code do?
 
but how can I make it a robust challenge?
 
@LeakyNun Just a second
 
@Lembik no idea
 
12:07 PM
:(
but you are my ppcg experts!
 
10
Q: Range, Reverse, Sum!

Comrade SparklePonyGiven a positive integer n as input, output the reversed range sum of n. A reversed range sum is created by making an inclusive range up to n, starting with 1 and including n, reversing each of the numbers inside, and summing it. Example: Here is what would happen for an input of 10: Range: [...

@Lembik do you have any fast algorithms for this?
although my algorithm is already fast enough to go from 1 to 2^32 in 226613 ms while doing other things
 
v What do you think of the sandbox? v
 
@LeakyNun is that 2^32 complex numbers? 226613ms is 226.6 seconds. Did you mean that?
 
@Lembik no, I'm talking about n=2^32 for the challenge above
range, reverse, sum
and yes, 226613 ms is 226.613 s
 
@LeakyNun oh ok.. so fast algorithms will be simd and/or multicore
I assume
 
12:11 PM
I'm not talking about those
I'm talking about the algorithm itself
 
ah ok :)
are we still talking about my challenge idea?
or the question you posted?
 
The question I linked to
I can't talk about your challenge because I don't do fastest-code challenges, sorry :P
 
ah ok :) I haven't clicked on it!
 
Why would we need a new SB?!
 
Some people think we should get a new one
 
12:15 PM
Ok, bye everyone!
@LeakyNun Ping me if you come up with a shorter approach
 
Can some kind soul feast their eyes on my challenge:
1
A: Sandbox for Proposed Challenges

TheLethalCoderThe Double Slit Experiment code-golf ascii-art physics random animation A lazy physicist has the job to perform the double slit experiment. However, they are lazy and can't be bothered to set up all the equipment themselves and so are going to simulate the effects. They can't program though so ...

 
@Lembik any idea?
 
@LeakyNun sorry I still haven't looked
 
implements in c
 
#include <stdio.h>
#include <sys/time.h>
unsigned long rev(unsigned long n){
	unsigned long long res = 0;
	while(n){
		res = res * 10 + n%10;
		n /= 10;
	}
	return res;
}

int main(int a){
	struct timeval stop, start;
	gettimeofday(&start, NULL);
	unsigned long N = 4294967295L;
	unsigned long long normal = 0;
	unsigned long long reversed = 0;
	for(unsigned long n = 1; n < N; n++){
		normal += n;
		reversed += rev(n);
		if(normal == reversed){
			printf("%d\n",n);
		}
	}
	printf("%lld\n",normal);
 
12:23 PM
hi
 
1
2
3
4
5
6
7
8
9
12
86
89
9223372030412324865
6860253883396092805
took 226613 ms
 
what's the best way to separate two code blocks
 
@ASCII-only the above is my implementation in c and the output
@totallyhuman presumably by a "hi"
 
:P
no liek actually in markdown though
 
@totallyhuman <!-- -->
 
12:26 PM
o0 why do comments work
anyways thanks
 
@LeakyNun wait what is that an implementation for
 
in Primes and Squares, 33 mins ago, by Leaky Nun
> a(n) = A000217(n) for n=1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 86, 89, ...; checked up to 10^7. - Michel Marcus, Sep 15 2015 (checked up to 9*10^8. - Kenny Lau, Aug 01 2017)
in Primes and Squares, 26 mins ago, by Leaky Nun
I've checked it to 2^32 ~ 4e9 now
 
oh you linked to range reverse sum >_>
@LeakyNun wait why does it only go to ...538833...
 
@ASCII-only a(2^32) = 6860253883396092805
 
damnit i must have messed up i think i did 1 extra somehow?
 
12:33 PM
why is a random NSP post starred
 
@ASCII-only what do you mean?
 
@totallyhuman what do you mean?
 
there's an NSP post on the starboard
 

« first day (2376 days earlier)      last day (2468 days later) »