« first day (2359 days earlier)      last day (2477 days later) » 

3:16 PM
0
Q: I double the source, you double the output!

Mr. XcoderYour task, if you wish to accept it, is to write a program that outputs a positive integer (higher than 0). The tricky part is that if I duplicate your source code, the output must be double the original integer. Rules You must build a full program. The initial source must be at least 1 byte l...

 
3:28 PM
Can I get some feedback on this?
0
A: Sandbox for Proposed Challenges

HyperNeutrinoProper army (Canadian Air Cadet) platoon/squadron formation code-golf ascii-art (Note: I'm not in the army so feel free to correct me if my formation is wrong, but I will not be changing the question. I will change any terminology mistakes though, because I'm trying to avoid air-cadet-specific w...

 
Does anyone know how to run Python repl from a bash script?
 
for this:
4
Q: I double the source, you double the output!

Mr. XcoderYour task, if you wish to accept it, is to write a program that outputs a positive integer (higher than 0). The tricky part is that if I duplicate your source code, the output must be double the original integer. Rules You must build a full program. The initial source must be at least 1 byte l...

can i answer it with Brainfuck, 1 byte: +?
 
no
there's no output :c
 
but you can leave output on the tape
 
is that a standard
 
3:30 PM
i thought that was agreed upon
 
if so, then by all means do that :P
 
*checks*
 
@totallyhuman I think "complete program" outlaws leaving the output on the tape
 
0
Q: Word Chain Reloaded

geokavelThis is a variant of Play the word chain and Building a long chain of words . The input is a non-empty list of unique words at least 2 chars long made of characters in [a-z]. You need to output the length of the longest possible chain, where each subsequent word starts with the last letter of ...

 
43
A: Default for Code Golf: Input/Output methods

SuperJedi224The contents of the tape post-execution may be used as a Turing machine's output

 
3:32 PM
yay
darn that's probably going to get you a ton of upvotes lol :P
 
or a ton of downvotes ;-;
 
Does anyone know how to run Python repl from a bash script? Or TIO for that matter?
 
lol that too
Well, you could use repl.it, but let me try to find a way
 
most repls you can just pipe the input in. But that doesn't work
 
hm.
not really the same thing, but I think it's pretty close.
 
@Mr.Xcoder 0/10 that's basically what I just did but without multiline support :P
@Riker er that got NSFW pretty fast quickly lol
 
well at least i have one valid answer on the question :P
 
@HyperNeutrino o_O I haven't read hte comments yet
o I see it
 
@totallyhuman That's great :)
 
3:42 PM
lol yup
 
eh it's far enough down
 
Unfortunately I cannot test it
 
Darn it, the specification says it must be positive ;(
Wait but my idea wouldn't work anyway :P ):
0
A: Sandbox for Proposed Challenges

HyperNeutrinoProper army (Canadian Air Cadet) platoon/squadron formation code-golf ascii-art (Note: I'm not in the army so feel free to correct me if my formation is wrong, but I will not be changing the question. I will change any terminology mistakes though, because I'm trying to avoid air-cadet-specific w...

 
@HyperNeutrino You can't have 0 can 0 duh
@HyperNeutrino I've read it but I don't have any helpful feedback
 
Ah okay.
 
3:44 PM
Ok, bye now!
Will be back very soon.
 
+1;print +1 comes so close...
kinda weird how Python REPL beats CJam...
and pyth
 
@Riker wrong enough lol=)
 
ikr
I was thinking "hold up, I don't think I could get a pencil to smoke"
then I realized I just wasn't thinking wrong enough :p
 
4:01 PM
@totallyhuman Seems like I've written the challenge specifically for Python to beat eso-langs.
 
stupid answer in julia:
if !isdefined(:x)
 print(1)
else
 print(x)
end
x=2
prolly can be golfed more but eh
I don't think julia supports python-style print x if y else z or even ternaries
o wait it does have ternary
 
made that a while ago. What do you ppl think?
@Dennis I am planning on turning my esolang into python esolang. What do I need to do for you to place it on TIO?
 
4:19 PM
1
Q: Cover a range with multiples

Wheat WizardHere is a interesting question I have been thinking about recently. Lets take a set of integers greater than 1 (for example [3..11]) now we want to group the set into mutually exclusive subsets of a common factor greater than 1. For example we can regroup [3..11] as [3,4,5,6,7...

 
@Christopher i do not see how your edit helped anything
 
@totallyhuman It was obnoxious now it is not
 
4:32 PM
@Christopher he's said in the past, it basically just needs to be secure and you need to have a repo for him iirc (last part I don't remember that well)
 
I've written this short Pyth code: .!sS to get the factrial of the sum of all the positive integers up to the input. Example: 4: (1+2+3+4)! = 10! = 3.628.800
Can anyone golf it further (I doubt it's possible)?
It's also wonderful what golf does...
 
4:54 PM
@Mr.Xcoder no
 
Hi
Another question about Pyth (inspired by the CJam question): last index of a number in a number array. Consider the following array: K[2 3 4 2 3 4). I have written t-lKx_K2 to get the last index of 2 in the list. Is there no built-in/shorter way to do this?
 
@Mr.Xcoder ex2K (doesn't work for strings)
 
@LeakyNun Exactly half of my solution :P Thanks!
 
@Mr.Xcoder no problem
 
CMC: Given a list and an element of it, output the index of last occurrence of the element in the list.
(either 1 or 0 indexed)
 
5:05 PM
lambda l,x:l[::-1].find(x)
Wait
NVM that's wrong
 
@totallyhuman Python, 36 bytes: lambda l,n:~-len(l)-l[::-1].index(n)
 
Mm yeah that
 
@Mr.Xcoder remove ~- and it'll be 1-indexed
 
@dzaima I wanted to make it 0-indexed, because Python uses 0-indexing
I did know I could remove ~- for 1-indexing or replace it with -1 for 0-indexing at the end
 
It usually doesn't matter what indexing your languid he uses
 
5:12 PM
@totallyhuman I know, just done it for the sake of usefulness.
 
@Mr.Xcoder this is code golf, not usefulness :p
 
@dzaima OK >_<
 
> languid he
 
@totallyhuman ??
@totallyhuman Care to explain?
 
9 mins ago, by totallyhuman
It usually doesn't matter what indexing your languid he uses
 
5:21 PM
What's "languid",then?
 
Dunno
Was a typo
 
ok
I'm sooooo bored...
 
do what every PPCGer does when they're bored: make a new language
 
@totallyhuman No, couldn't get Cthulhu to work, so...
 
nobody's first attempt is great
 
5:36 PM
@WheatWizard not yet, I've been preoccupied with another writing project
 
@totallyhuman Which attempt should be great? I'm on the 4th one..
 
no attempt should be great
and sogl is doing awesome, isn't it
 
It is, but underneath it's an outright mess
 
@totallyhuman Why don't you get commata on TIO?
 
because it is very underdeveloped
 
5:39 PM
Ok
Ah, I really wanted to test it
 
use TryItOffline
 
@totallyhuman I don't see power in the command list (^ or **...)
Oh, it's *
 
Unusual choice
 
^ is bitwise something
 
5:42 PM
@totallyhuman XOR
probably
 
ye i don't remember my bitwise stuff
 
-> do nothing... WHAT?
 
look at the second column :P
it currently just pops one item
i'm planning on making it take input
 
Might be helpful in source layout challenges though, if it would do nothing.
Is there any input method so far?
 
command line args
i also recall it is allowed to put stuff on the stack beforehand
 
5:45 PM
In Cthulhu, » was input.
and « output
Of course inspired by C++'s cin>> and cout<<
 
can i see cthulhu?
 
@totallyhuman I had a huge rage a couple of days ago and deleted it.
 
oh ok
 
Will start writing it again shortly
 
i wonder what oeis A42 is...
@Mr.Xcoder pls link when you do
 
5:47 PM
I didn't expect this to be that well received... challenges seem to be overupvoted.
 
@totallyhuman Of course
 
it's a nice challenge
 
@totallyhuman I formerly had one of my ignored tags.
 
i quite like the trickiness of it in practical languages
 
5:50 PM
@totallyhuman Yes, it is hard to not error if you redeclare a variable.
@totallyhuman I now start writing the dictionary of commands. Wanna help?
 
sure
what do you want help with?
 
@totallyhuman Suggesting "suggestive" names to commands.
I want to begin with input and output: » and «.
 
@totallyhuman wow ,,,s function source code is so short.. lucky
 
@totallyhuman What do you think about ª for append?
 
@dzaima :P
like i said it's underdeveloped
@Mr.Xcoder are you going for descriptive characters?
 
5:54 PM
@totallyhuman Yes
 
0
Q: remove duplicates from array

Satish PatelYou have given an array from which we need to remove duplicates. e.g. {1,2,3,4,5,5,4,6,6,7,8}=> {1,2,3,7,8} {1,2,3,3,4,5,6,7,7,8} => {1,2,4,5,6,8} {1,1,3,3,4,4,6,6}=>{} {4,2,6,8,3,1,1,3,8,6,2,4}=>{}

 
I mean like one function of yours is ~100 bytes where SOGL's each averages 400 bytes (and some like + are 1500)
 
huh
what language is sogl written in?
 
Processing
aka java with built-ins, graphics and less verbosity
 
@Riker Secure was before. The new TIO even has an interpreter for raw ELF files.
@Christopher Cannot require network access. If possible, should take a filename as argument, read code from that file, then print to STDOUT.
 
6:19 PM
which is better:
<Sequence [A000004]>
<Sequence [A000004: The zero sequence.]>
 
@totallyhuman not required since it's a # ><
@totallyhuman <Sequence A000004>
 
@HyperNeutrino hmm you don't like the brackets?
this is for the output of repr(Sequence(4)) btw
 
I personally don't like the brackets. It looks kinda off-center almost, since the second open bracket is in the middle but they both close at the end.
But if it's for repr, you might want <A000004: The zero sequence>
 
@HyperNeutrino Would ~- be faster compared to -1?
(can't test now)
 
Personally, I think eval(repr(x)) should always result in x.
 
6:29 PM
So, just Sequence(4)
Interesting
That does make sense 'cause that's how it works with primary types
 
@Dennis should
 
@HyperNeutrino shouldn't it always include the class name?
 
saw a joke on r/programmerhumor and made it a real: betseg.github.io/hackerdatabase :P
7
 
lol
 
6:35 PM
._.
 
@totallyhuman .__. you're right it should. nvm then
@betseg Darn it, it doesn't actually store the information? Darn.
 
@betseg Oh wow, when I visit that site, Google autocomplete tries to enter my credit card o_O
 
uh what
 
<input type="submit" value="Search" onClick="JavaScript:do_query()">
<!-- -->
function do_query() {
    event.preventDefault()
    // ...
    return false
}
@HyperNeutrino it shouldnt ^
 
@betseg I was hoping it did. Then I could spam you with a million automated things :P
 
6:41 PM
xd
 
Suggests that this question may be unclear
 
@HyperNeutrino 2 people (myself included) VTCed as unclear, then retracted after clarifications.
 
Mine was the golfiest though :P
 
@totallyhuman not a golf though :P
 
6:46 PM
Ye but it looks awesome doesn't it
[*{*l}]
 
sure. I didn't even know that that was possible :o
 
CMC: error on STDOUT
 
Java can do this :D
 
@totallyhuman Brain-flak, 1 byte: (
The only one byte brain-flak answer you'll ever get
 
@totallyhuman Python: print('error')
 
6:48 PM
Oh wait crap
 
I just realized that all Brainflak answers are an even number of bytes.
 
@DJMcMayhem it isnt The only one byte brain-flak answer you'll ever get?
 
No, it's STDERR
 
@HyperNeutrino all valid BrainFlak answers
 
More seriously
 
6:50 PM
@cairdcoinheringaahing Well, that. Yes. :P
 
@HyperNeutrino @cairdcoinheringaahing False.
44
A: Golf you a quine for great good!

Wheat WizardBrain-Flak, 9.8e580 1.3e562 9.3e516 12818 11024 4452 4332 4240 4200 4180 3852 3656 3616 3540 2485 + 3 = 2488 bytes Now fits in the observable universe! (())(()()())(())(())(()()())(())(())(()()())(())(()()()()())(()())(()()()()())(())(()()())(())(()()()()())(())(())(())(())(()()()()())(())(())(...

 
How can you have addition in Brain-flak?
 
@Mr.Xcoder ({}{})
 
CMC: output How much wood could a woodchuck chuck if a woodchuck could chuck wood?
 
@HyperNeutrino Have you seen my comment on main?
 
6:51 PM
@totallyhuman how much ground could a groundhog hog if a groundhog could hog ground?
 
@Mr.Xcoder on the fast-code one?
 
@HyperNeutrino Yes
 
@totallyhuman tio.run/…
@Mr.Xcoder Yes. I edited the post but forgot to reply :( sorry
 
Fine :)
 
Technically has lot of repetition
 
6:53 PM
@totallyhuman or an actual answer: Python: print('1 thing of wood, as a wood chuck gets tired quickly')
 
@HyperNeutrino Not that, the other comment
Please take a look on Main.
 
@cairdcoinheringaahing could you give an actual answer :P
 
@HyperNeutrino This one: I get slightly better times if I add continue at the end of your if statement and drop the else (between 1.0405001376057044e-05 and 4.7165998694254085e-05), because it skips the evaluation of the else-statement.
 
@totallyhuman S.I.L.O.S, 68
 
@totallyhuman print('How much wood could a woodchuck chuck if a woodchuck could chuck wood?')
 
6:54 PM
(sentence is 71 btw)
 
I think its shorter than doing any replacements
 
@totallyhuman SOGL, 28 bytes
 
@totallyhuman print('How much {0} could a {0}{1} {1} if a {0}{1} would {1} {0}'.format('wood','chuck'))
its longer than the normal sentence
gtg bye!
 
Add a space to wood
Bye
 
@totallyhuman 56 bytes: iHow much wood could a wchuck chuck if a w c ch w? Try it online!
 
6:59 PM
Wha
How?
 
Python 3.6, 87: a,b="wood","chuck";print(f"How much {a} could a {a}{b} {b} if a {a}{b} would {b} {a}?")
 
caird's was 89
 
Ohh
Haha nice V
 
7:01 PM
I think caird's was the shortest in Python.
 
@dzaima isnt 2nd could actually would
 
@cairdcoinheringaahing You forgot "?" in the end.
 
@Mr.Xcoder wat
 
@betseg no
 
@betseg Sorry, wrong ping
 
7:07 PM
Atom, 55 bytes: How much wood could a wchuck chuck if a w c ch w?
Hehehehehe
 
@totallyhuman Pyth: "How much wood could a woodchuck chuck if a woodchuck could chuck wood?
Please post a number related CMC such that I can exercise Pyth :P
 
python 3.6, 77 bytes: a=" a woodchuck c";print(f"How much wood could{a}huck if{a}ould chuck wood?")
 
@Mr.Xcoder digit sum of 2^1000 (PE#16)
 
> huck
hyuck
 
@LeakyNun 3 bytes: 115.
 
7:13 PM
@Mr.Xcoder please
 
Just joking, doing a proper solution now
 
it's cheating and it isn't right
it's 1366
 
Oh, really
I dunno how to handle large numbers
 
@Mr.Xcoder Pyth handles it for you
 
@LeakyNun Pyth gives 1267650600228229401496703205376 for 2^100. Is it right?
 
7:14 PM
@Mr.Xcoder yes
but I said 1000
 
Ah, really?
 
3 mins ago, by Leaky Nun
@Mr.Xcoder digit sum of 2^1000 (PE#16)
my solution is 8 bytes btw
 
0
Q: Rapunzel, Rapunzel, let down your hair!

racer290Description I guess everyone knows the fairy tale of Rapunzel and the prince. For those who do not: read it here. However, Rapunzel had just had her hair cut, so it might not be long enough to let her prince climb up! She may get very sad.. Challenge Your task is to write a function that evalu...

 
What was str() again, in Pyth?
 
@Mr.Xcoder backtick
`
 
7:15 PM
That's repr
@LeakyNun ssM`^2 1000, 11 bytes. I am golfing it now
 
@Mr.Xcoder there's only repr
 
Is the above even close to your approach?
(I don't wanna see it)
 
@Mr.Xcoder well my approach can't be any different
considering that we're just implementing an algorithm
 
Again, 11 bytes: svM^2 1000`
10 bytes: sj^2 1000T
 
pity
 
7:20 PM
Getting better ^
 
it would've made a great challenge on main
if it weren't for everybody yelling "never gonna vote dupes up"
 
@LeakyNun Any small hint to get me going?
 
@Mr.Xcoder scientific notation
 
oh
Wait, how to write 1e3 in Pyth, e means sth?
 
no, you can't use scientific notation in pyth
it's just a hint
 
7:24 PM
@LeakyNun ಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_ಠಠ_‌​ಠ
 
just one suffices thanks
 
So, 2^1000 in scientific not.
I don't get it :(
 
you wanted a small hint
 
@LeakyNun I give up, you outgolf me by 2 bytes.
 
2 mins ago, by Mr. Xcoder
Wait, how to write 1e3 in Pyth, e means sth?
think about this more
 
7:26 PM
i have no idea about pyth, i'd say 1E3 :P
 
I probably am very dumb
Wait
@LeakyNun I throw a party, 8 bytes: sj^2^T3T
YAAAAY!
 
nice
 
I was sooo dumb
 
u r a genius @LeakyNun
 
7:28 PM
17
Q: Female and Male Sequences

Qwerp-DerpThis question is probably harder than all of those "generate a sequence of numbers" tasks, because this requires TWO sequences working in unison. Really looking forward to the answers! In his book "Gödel, Escher, Bach: An Eternal Golden Braid", Douglas Hofstadter has a quite few sequences of nu...

 
>_> Now I need another CMC :)
 
@Mr.Xcoder my solution is 24 bytes, and Jakube's solution is 23 bytes
try to parallel us
(don't look at the solution!)
 
Ok, will probably get 1k bytes
@LeakyNun I won't
Ah, sequences... That's going to be hard...
@LeakyNun But stay around till I finish... It's going to take a bit.
@LeakyNun I'm afraid that's a bit too hard for me. I can't really think of an implementation, because i don't really see a rule in there... Recursion seems to be the key here
I think I have a clue, but I dunno how to create a function in Pyth...
 
@Mr.Xcoder D,L,M
 
I can use L, because it says def y(b): return A. y -> ' ->,
 
7:36 PM
CMC: do the last CMC (this)
 
@cairdcoinheringaahing VTC as a dupe.
 
@Mr.Xcoder my CMC hasn't been done before.
 
@Mr.Xcoder Given a positive integer, output every N'th byte of your source code (1 is a quine, 2 is 1st, 3rd, 5th etc bytes, 3 is 1, 4, 7 etc...)
 
print'How much{0} could a{0}{1}{1}if a{0}{1}could {1:.5}{0}?'.format(' wood','chuck ')
86 bytes
 
@DJMcMayhem I have a CMC already by @LeakyNun.
And I'm kinda stuck.
 
7:40 PM
@Mr.Xcoder Chat Mega Challenge?
 
@LeakyNun please follow me an check if I am right: First create the male function, which checks if the argument is higher than 0, else returns F(M(argument-1))subtracted from the argument.
 
Would that be a good challenge for main? (My quine one)
 
python 2 would probably save some bytes
 
@Mr.Xcoder sure
@totallyhuman I don't use Python 2
 
7:42 PM
why not?
 
it's old
 
even for golfing? :P
 
I was about to type "why not?", and just before I hit enter, I saw totallyhuman's message. You ninja'd me without knowing you ninja'd me
 
@LeakyNun Then create the female function, that checks if the input is still higher than 0, and if so return argument - M(F(argument-1)), else 0, no else 1.
 
@Mr.Xcoder sure
 
7:44 PM
@Downgoat sheep are better than goats.
'Nuf said
 
And then just do the outputting... I'm starting to write it now.
 
CMC: write a program that outputs first Fibonacci number, when doubled, outputs the second, when tripled outputs the third
 
Jun 23 at 12:27, by Erik the Outgolfer
please, "ninja'd" should be restricted to when you actually post the message a split second later than somebody else posting the same message, and then you are the one who is ninja'd
 
@HyperNeutrino what on earth is that quote chain?
 
pyth cmc: out-golf this
 
7:46 PM
^^ It's all of us asking telling people to stop saying "ninja'd" when they didn't even post the message ._.
 
@HyperNeutrino can you just link the original quote so it doesn't take up the entire screen unnecessarily
 
You could just say [user], [user], [user] "quote"
 
oh thanks xcoder
wait what no
 
@LeakyNun How should I name a lambda?
 
7:47 PM
oh nvm
 
@Downgoat SOGL, 13 bytes: 11Ι⁄L3+/{⁴+;"
 
@Mr.Xcoder the name is provided.
L uses the name y
 
@LeakyNun I have no idea how to continue... I have sth like this: L&b
 
wait wut
leaky nun post it yourself
it's not even close to mine :P
 
@totallyhuman not interested
 
7:51 PM
¯\_(ツ)_/¯ your loss
 
@LeakyNun How should I have two lambdas that call each other??
 
@Mr.Xcoder the second lambda is called '
16 mins ago, by Mr. Xcoder
I can use L, because it says def y(b): return A. y -> ' ->,
 
By default?
 
The name goes from y to '
 
oh, I got it.
I see there is ! for logical not, but I think I can use &b in the lambda too, right?
Because it says If not A, return A. Else, return B. Short-circuiting. Same as Python and.
 
7:53 PM
I'm pretty sure that Alex A. has gone AWOL. He hasn't been seen for over a month.
 
I know have the male func: L&b-'y-b1
Now the female one.
Why would I get @memoized error?
 

« first day (2359 days earlier)      last day (2477 days later) »