« first day (2447 days earlier)      last day (2413 days later) » 

6:03 PM
♫ Save some bytes with FOIL ... (FOIL) ♫
 
CMC: Given an array of non-negative integers, determine whether the differences between consecutive elements are all equal.
[1,4,7,10] -> True, [9, 7, 5, 3] -> True, [1, 2, 3, 5, 6] -> False
ಠ_ಠ 2 bytes in Jelly
 
Anonymous
@Mr.Xcoder IE
 
@Mr.Xcoder Matlab: @(x)all(diff(x)==x(2)-x(1))
 
@Mr.Xcoder and 2 in 05ab1e
¥Ë
 
6:18 PM
@Mr.Xcoder PowerShell, 66 bytes (seems long) -- param($n)(1..($n.count-1)|%{$n[$_]-$n[--$_]}|group).Name.Count-eq1 -- Try it online!
 
@flawr, Octave: @(x)all((y=diff(x))==y(1)) (1 byte less than in matlab)
 
Anonymous
 
Anonymous
Probably can be improved
 
@Mego Seems optimal to me
(Some would argue)
The numpy version is 45 bytes too
 
6:35 PM
@Mego 43 bytes: lambda a:len({*map(int.__sub__,a,a[1:])})<2
 
Anonymous
@EriktheOutgolfer That's Python 3.5+
 
yeah what's wrong
 
Anonymous
Well for one, that's a different language
 
Anonymous
Mine was for any version of Python 3
 
oh I consider it to mean "the most up-to-date" version
 
Anonymous
6:38 PM
Nope, that's not what that means. If a specific version is required, you have to denote that version.
 
Just realized it takes two clicks instead of one to get to the review queue now. Ugh.
 
Anonymous
@mbomb007 Review queue usage goes down by 50%. SE: "whatever could have caused this?"
9
 
@Mego Like Python?
 
Anonymous
@mbomb007 Python's syntax isn't exactly sane either, but it's the pleasant kind of insane, like a stranger singing in public. JS's syntax is the unpleasant kind of insane, like mental ward patients screaming at the top of their lungs.
 
lol
that's a great comparison
 
Anonymous
6:45 PM
Haskell has the best syntax
3
 
Ruby's like 'shrooms then. Most people don't understand it, but it feels awesome.
... I instantly regret making that comparison.
4
 
@Mego Yeah, I agree. I enjoy using Python. But JS is part of my job. If you do something wrong, the browser just stops execution. Troubleshooting can be hard.
 
Anonymous
@JohnDvorak I'd say Ruby's syntax is like the red pill from the Matrix: looks innocuous on the surface, but takes you down a rabbit hole that makes you question reality.
 
If there'd be a language with the built-ins and modules of Python, syntax of Haskell, features of Ruby and the performance of C, it'd be awesome
 
@Mego Fair enough, I guess
 
6:47 PM
Syntax of Haskell? Ew
 
@mbomb007 except that you can just go to a queue directly without clicking "all queues" :p
 
@Mr.Xcoder I'm longing for Crystal on Windows
 
Crystal?
 
Anonymous
@Mr.Xcoder Haskell has really good performance for well-written code. It compiles to machine code.
 
@EriktheOutgolfer I'd rather see them all at once. Also, then I can open each non-empty queue in its own tab.
@JohnDvorak is glass a crystal? Most windows are made of glass.
 
6:49 PM
wait why would you open review queues in separate tabs I'd say better reserve the tabs for golfing languages :p
 
glass is not a crystal
it’s almost the opposite
 
Nope. Glass is amorphous.
 
@EriktheOutgolfer So that I don't have to go back to the main review queue page after reviewing a queue.
(in order to review another queue)
 
Anonymous
Glass is largely-unstructured melted-and-solidified silica. Crystals are highly-structured compounds. Glass is easy to make. Crystals are much harder.
 
6:52 PM
> Glass is easy to make. Crystals are much harder.
Wait what
 
Glass is easy to make. Just melt some sand.
 
just freeze some water
 
How is frozen water glass ಠ_ಠ ?
(ice ≠ glass)
 
They look the same.
 
But they aren't
 
6:54 PM
Glass is really easy to make. You just need 8 sand blocks, and 1 coal, throw them both into a furnace, and... oh wait
4
 
Anonymous
@FrownyFrog Anyone can make glass out of silica with sufficient heat. To make quartz, you need an autoclave with precisely-controlled temperature gradients. Or a volcano.
 
Like I said, just melt some sand.
sure, an autoclave with a volcano is super-easy to find.
 
I grew some crystals in a glass of water with a box off the shelf
 
Anonymous
Ice is a crystal too, but I meant silica crystals (aka quartz).
 
any crystal is easier to make than any glass
ok
 
6:56 PM
@DJMcMayhem 1. you don't need that much sand, 2. you need stone, which requires at least a wooden pickaxe, which requires at least 3 logs (I think)
 
@DJMcMayhem seems like you confused stuff up there :p
 
@HyperNeutrino You do need that much sand if you don't want to waste coal
Let me revise though
 
Anonymous
@JohnDvorak It's one or the other. Volcanoes make natural quartz. Autoclaves make synthetic quartz.
 
yes, but this is block-golf, save 7 blocks
 
Okay, well in that case you could also use your wooden pickaxe as fuel
 
6:58 PM
That's true...
 
So you need 3 logs (1 for the crafting table, 1 for the sticks, and 1 for the three planks), then 8 cobblestone, and 1 sand. So 12 blocks minimum
 
Anonymous
Hmm, block-golf could be interesting. Find the minimum number of items needed to make an item in Minecraft.
 
That's an awesome idea actually
 
I smell a challenge...
 
@DJMcMayhem s/xe/xes/
 
6:58 PM
(cc @HelkaHomba)
 
also minecraft golf is only for those who do minecraft...
 
Block Golf: Bare minimum blocks required for obtaining a dragon egg in one's inventory, assuming perfect conditions.
 
Anonymous
@EriktheOutgolfer You only need one wooden pickaxe to mine 8 cobblestone and smelt a block of sand into glass.
 
What's the burning power of a wooden pickaxe?
 
when it comes to minecraft I'm afraid I can't help
 
7:00 PM
Oh, it's 1
Of course, you could also put your two extra sticks in as fuel so you can keep your pickaxe
 
and the extra plank
and your crafting table
 
Anonymous
@HyperNeutrino 2. All you need is a piston and a redstone torch. Both can be found naturally.
 
you can reduce this count using the Bonus Chest but that's cheating lol
@Mego how do you get into the end?
 
Anonymous
End portals have a 10% chance per block in the portal frame to already contain an eye of ender
 
7:01 PM
I wooden pick that as my choice
 
Anonymous
Therefore you have a 10**(-12) chance of finding an already-constructed portal
 
MCMC (Minecraft mini-challenge) Assuming perfect conditions, what's the minimum number of blocks you need for an enchanting table? (starting from an empty world)
 
how do you kill the ender dragon with your bare hands :c
 
Anonymous
@HyperNeutrino Very carefully
 
7:02 PM
lol
 
empty = pristine with normal terrain generation, or void?
 
getting to mainland isn't an issue because sometimes you appear in the main island region
 
Also, no cheap answers like Use creative mode! or Console commands! Or Have another player drop one!
 
Just make a few beds.
 
@JohnDvorak Normal terrain generation
 
7:02 PM
lol
 
I'm pretty sure that would be impossible in something like superflat lol
 
you can get obsidian, redstone, and books from looting chests, so one block for the crafting table :3
 
That's why I said no cheap answers
 
CMC: assemble a mod-pack that lets you start your sky factory from a single block (and nothing in the inventory)
 
@DJMcMayhem :c it's legit tho
(when I'm trying to make an enchantment table, I always forget the book)
 
Anonymous
7:04 PM
@DJMcMayhem 5 diamonds, 3 logs. Make a crafting table, then a diamond pickaxe. Find a village and smash a bookshelf for a book, and mine 4 pieces of obsidian from a cave.
 
you need iron then
so you need stone
 
But how are you going to mine the diamond?
 
Anonymous
Fair
 
And you'll need to smelt the iron too
 
7:05 PM
CMC: make a mod that lets you mine diamond by hand
 
Diamonds can be found in chests
 
I'm guessing you'll need one coal, unless there's some workaround to re-use earlier leftovers
 
@AdmBorkBork apparently that's "cheap" tho :c
 
Anonymous
So for the 5 diamonds, you need half a log and 3 iron for an iron pickaxe. For an iron pickaxe, you need half a log and 3 cobblestone for a stone pickaxe, plus 8 cobblestone and a piece of coal to smelt the iron. Stone pickaxe takes a wooden pickaxe, 2 sticks, and 3 cobblestone. Wooden pickaxe takes 3 planks and 2 sticks, which is 2 logs.
 
7:08 PM
And one for the crafting table :P
 
Anonymous
@DJMcMayhem I counted that earlier
 
Minecraft summons Helka
 
Anonymous
Grand total: 6 (?) logs, 11 cobblestone, 3 iron ore, 5 diamonds, 4 obsidian.
 
Anonymous
It might be 7 logs - I'm not 100% confident in my math
 
7:09 PM
Shamefully, he gave up on his series
 
@JohnDvorak really? D:
@Mego where did the sunglasses go?
5
 
CMC: make Helka Homba reinstate his Another Adventure series
 
Anonymous
@Mr.Xcoder what sunglasses? I took them off.
 
Cold 'gain out there in texas...
 
Anonymous
Going back to my rant about IPS.SE yesterday: this is on HNQ
 
7:13 PM
A terrible question on HNQ? I am not surprised.
... if you count this question as terrible, that is
 
Anonymous
@JohnDvorak It's beyond terrible. I thought 8-year-olds weren't allowed to make accounts on SE.
 
Anonymous
"So-and-so stole my seat" is a problem you learn how to deal with in grade school
 
That's a lower rating than I would give
 
also the fact that it has +14
 
7:15 PM
Replace seat with parking spot, and it makes perfect sense to me.
 
@Mego IPS can boil down to "don't be a dick"
 
yesterday, by Mego
The answer to every IPS question is "have a mature conversation with the other person/people". The whole site can be closed as a dupe.
 
Excellent.
 
Anonymous
@Dennis The answer is still the same: "Unless it is clearly marked that the seat/parking spot is solely for use by you, get over it and find somewhere else to sit/park. In fact, go ahead and get over it even if it is marked."
 
VTC IPS as dupe of kindergarten /s
 
7:22 PM
0
Q: Repeat the Nth elements

caird coinheringaahingWe haven't had a string question for a while (5 days to be precise), so let's go for one. Given a string s and a positive integer n, take every nth element of s, repeat it n times, and put it back into s. For example, if n = 3 and s = "Hello, World!", every third character is Hl r!. You then re...

 
@Mego I have legs pains and walk with a cane. Parking far away because someone stole the parking spot I've been waiting for for half an hour isn't exactly an option.
 
Anonymous
@Dennis Then the solution is even simpler: beat the person with your cane until they learn their lesson :P
 
......
 
Anonymous
Also I'm imagining you as Cranky Kong during this :P
 
@Mego 100% correct answer :P
 
7:31 PM
@Dennis A regular boring cane or is it embossed and fancy
 
I can't wait until I get old so my crankiness has an excuse.
 
@Mego Really? I'm imagining him similar to my grandpa >.< Old and crotchety :P
I'm not sure if that's good or not :P
 
Crochet limit: The distance from an old person you can be before the gravity of the situation rips you apart.
 
@HyperNeutrino your Python program just returns the elements that should be repeated, not the whole string for the NMP question
 
yup noticed that too lol
 
7:35 PM
@Poke A magic one.
 
@NewMainPosts TBH, I was gonna post as a CMC, but I wanted rep :P
@Dennis I don't understand how that's magic :(
 
@cairdcoinheringaahing revised
 
@cairdcoinheringaahing It's called a Magic Cane.
 
Anonymous
@cairdcoinheringaahing It's actually the focus for his golfing powers. If it were to break, he wouldn't be able to write any code shorter than 100 bytes.
 
@Mego brb, stealing Dennis' cane :P
 
7:38 PM
@Mego Then he'd probably write insanely short jelly answers with 90+ character comments :P
 
Anonymous
@DJMcMayhem Does Jelly even have comments? I genuinely don't know
 
use a string maybe lol
 
Anonymous
@cairdcoinheringaahing Nah, it's attuned to him. It doesn't work like that.
 
@Mego No, comments are a waste of userfull commands
 
Anonymous
Also attempting to steal someone's cane usually results in them smacking you with it
 
7:39 PM
Ah, the good old void expression trick. Gotta love loopholes.
 
Anonymous
@HyperNeutrino I guess you could use never-called links that return strings as comments
 
@NewMainPosts This should just be òlhÀälÀlÀ­l in V, but it doesn't work and it makes absolutely no sense why not
 
Anonymous
@DJMcMayhem Looks like the name for the next big pop hit
 
@DJMcMayhem Is it just me, or does that look like Olohalololo?
 
Anonymous
Sounds like Sims-speak :P
 
7:41 PM
I'm glad you think it's funny, but I'm actually really frustrated with it
It makes no sense at all
 
might be a city in Wales
 
Anonymous
What about it doesn't work?
 
qqlhÀälÀlÀ­l@qq@q works, and ò... is exactly the same as qq...@qq@q
 
Anonymous
@JohnDvorak Far too short for that
 
True. Swedish?
 
7:42 PM
@Mego It's duplicating the wrong characters
 
@Mego I'm young and fast, I might escape with only a couple of of bruises :P
 
Wait, that doesn't even work either
This is stupid
 
@NewMainPosts This is like impossible in SOGL.. it's gonna probably be over 17 bytes
 
@DJMcMayhem I'm glad you think my challenge is stupid :P
 
I don't think your challenge is stupid, I think my language is stupid
 
7:45 PM
@DJMcMayhem Hmm, thats a shame :( Hope you do get a V answer though, they're always interesting to read
 
I found a workaround
At least it's still shorter than charcoal :P
 
@Dennis Fair enough. I guess the magic is that it doesn't fall over when you let go of it :]?
 
@DJMcMayhem Careful, @ASCII-only's threatening to write a MapString operator which would save a couple of bytes
 
> threatening
Code golf is officially cut throat :P
 
@cairdcoinheringaahing You should post more string challenges. I only need 14 more for a gold badge :D
 
7:50 PM
@DJMcMayhem Hmm, let me check what I have in the Sandbox
@DJMcMayhem I have a string CnR waiting for feedback, that might be interesting :P
 
my friend effectively insulted all of us (ppcg-ers) :P I think we've stated the same thing though so it isn't really an insult :P
 
@HyperNeutrino What did he say? draws sword
 
"You have no life ("you" being me, but it refers to everyone here) and the moderators who run this site have even more so no life"
:P
@cairdcoinheringaahing is it riffle shuffle or ruffle shuffle? you use both
 
@HyperNeutrino This means war! (and riffle shuffle)
 
7:55 PM
Truffle shuffle
 
So one spelling mistake to fix. Anything else?
 
I think it looks good :)
 
@cairdcoinheringaahing In your walk-through example, you're reversing the string segments, but don't explicitly say that anywhere.
I'd also make it more clear that Cops are supposed to riffle-shuffle their own code.
 
@Mego How can we talk about 8 year old's on SE, without bringing up this question?
> Starting from the ends of the strings
 
I just noticed they changed the top bar on PPCG, is there any way to revert that?
 
8:01 PM
> Your Cops submission will consist of 4 things
Your program, riffle shuffled.
@flawr Without userscripts, I don't think so
 
Hey, you asked for feedback. Sorry you don't like the feedback I gave.
 
why do they always have to change everything? they'd better start working on our design!
 
@AdmBorkBork Not a complaint, just asking if that answers the information you were asking about?
 
"Starting from the end of the string" is ambiguous to me. It could mean rld or dlr.
I saw the bullet point, but that was after a paragraph of explaining the Cops' submission, and nowhere in that paragraph did it say to riffle shuffle your program. I can easily see that bullet point being missed.
 
Hmm, I see your points. Adding to fix list :P
For any Jellyers, what is the difference in behaviour between y and a string replace atom?
summons Dennis from the depths of TNB
 
8:14 PM
what is y
 
20
Q: Is there a word/ phrase to describe somebody who has devoted their life to practising something but is still not very good at it?

English StudentI need a word/phrase/idiom (either adjective or noun) to describe somebody who has devoted their life to practising something but is still not very good at it. Example: Look at Uncle, practised music all his life and still not very good at it: he is __________ (adjective) or he is a _______...

PowerShell golfer
 
oh /. I see
 
0
Q: In Search of a Soulmate

flawrGiven a nonempty finite list of integers, output a truthy value if there are exactly two equal entries and all other entries are distinct, and a falsey value otherwise. Examples truthy: [1,1] [1,2,1] [1,6,3,4,4,7,9] falsey: [0] [1,1,1] [1,1,1,2] [1,1,2,2] [2,1,2,1,2] [1,2,3,4,5]

 
8:27 PM
lol I tried making an ASM-like language:
https://tio.run/##tVdtb9s2EP4c/QqCS1DJcdVkHTDAW1B0jZsOC2Kg8T7JTkBLdMxWogSSTmMs@@3ZHSnbki01cY0BiRLy7p577o4vx2JhZrl8@/QksiJXhijeJXqhPS9Omdbk2uSK3fGed5DwKbm9FVKY21tf83QawOQB/hOyOJ5n85SBriZn5J9/nfZ1f2gVu0SyDGDvWTrn1kpM7RQ5OyP0cPD3kOLkQaGENL7V6hIuE4CiNAAJT2sGHz59rhrEM@WMgjYrmRsiJNniakEUE5qTv/iir1SufFpGTOyQPGIU8LU4R5oIbdEgPCF5QsmRlTh3mlvALTcRqoyBl2UJKoqbuZLLIabqopaq7Rz9eeUiLi2FLObGDza1@lfnlzU9OpKU/ESGg/MBydhXTrDEbJLydxXTvbJz8cLslIRacuOScN7/@Mx6@WGaAF2nyVLFWbJoovoj9TvvX7bVb6/0Au6L0pvwdNvDmulVLkuiHwefP/Rbsvxc4OWRcDEYDprOgy5J83gNBAOwhK/noSpHDGa4b/KvXGo4ZFyoaI
gtg now o/
 
\o/ I made a Jelly answer that works and is short
 
\o
 
(This is much more of a big deal for me than you guys would think :P)
 
8:41 PM
lulz
 
I'm all in favour of challenges not accepting answers, unless I have an answer that is winning :D
 
 
1 hour later…
10:15 PM
ROFL: someone on meta called the review icon "a comment about a stapler"
 
@flawr @(x)nnz(~conv(sort(x),-1:2:1))==1 :-D (+1 already)
 
What is this language
 
Octave / MATLAB
My comment is because it uses convolution, which I like :-)
 
@LuisMendo I did expect it to be even longer:)
 
@flawr Turns out, it should be longer :-) Namely, I think you need to add the 'same' flag to conv in case x has a leading or trailing 0
 
10:32 PM
@LuisMendo oh, thanks!
 
Anyone know what was up with SE outage earlier? nothing on stackstatus
 
10:45 PM
Is there a way to pipe a file into a program and also echo the file's contents only when they get read by the program? I tried tee /dev/tty < file | prog but the output came out with first the file contents, then the program output.
(Basically I have a large file containing test cases for a program I'm writing and I want it to appear in my terminal as if a user had typed it, and it would take me a long time to type it out myself every time I want to test)
 
@Pavel STDIN is buffered so that would depend on your shell/program itself
but can't you just read line by line witihn your program itself?
 
Right, that's what it's doing.
Normally when a user types input into the program, that input appears on screen inline with the output the program generates. I'm trying to simulate that effect.
 
oh, so you also want it to appear on screen?
 
Yep.
 
@Pavel maybe tee /dev/tty < file.txt | prog
wait that's what you are doing :|
 
10:50 PM
Yeah.
The file contents all get written by tee before the program can even start up to recieve input.
On the bright side, I learned about /dev/tty, so that was cool.
Where's a Bash wizard when you need one
 
You rang?
 
11:09 PM
23 mins ago, by Pavel
Is there a way to pipe a file into a program and also echo the file's contents only when they get read by the program? I tried tee /dev/tty < file | prog but the output came out with first the file contents, then the program output.
Although I solved the problem by now by spending a few minutes typing out the test cases by hand. It miraculously worked on the first try, so I can turn in my project with no need for further testing.
 
One test case per line?
 
Yep
 
11:23 PM
No clue.
 

« first day (2447 days earlier)      last day (2413 days later) »