« first day (2313 days earlier)      last day (2524 days later) » 

9:01 AM
2
Q: General tips for representing large numbers

ArjunSometimes, while golfing, one needs to represent large number(s) in their code. Writing them as is can significantly increase the byte-count. What general1 tips do you have for representing long numbers concisely in code? Please post one tip per answer. 1With general, I mean tips that can be...

 
Am back!
 
9:17 AM
BTW, AdmBorkBork is fine! He retweeted a tweet 6 hours ago!
 
How does CoffeeScript work with inserting code into HTML with <script type="text/coffeescript"> tags?
 
9:32 AM
@Qwerp-Derp I am sure that it won't work without a dependency. See this.
 
@Arjun I know that, but how does embedding CoffeeScript even work?
 
@Qwerp-Derp Well, that dependency transpiles the code present it any script tag with type=text/coffeescript and executes it. Since bowser only knows, type=text/javascript, it skips that <script> tag
 
Anonymous
I remember reading that Chrome will start complaining on script tags that have types other than text/javascript
 
Anonymous
That's one of the reasons why I'm having to rewrite all my brython projects in pure JS
 
@Mego Yes, that's why it's a bad practice.
@Mego But one can do something like <div class="coffeescript-code">#Code</div>, CSS : #coffeescript-code{display:none;}. And that dependency can get the content of that <div> and execute it.
@Mego How is your username pronounced? Mægo? Meego?
 
9:46 AM
meg-o?
 
M-ego?
M-E-G-O?
@Mego
 
Anonymous
Me-go
 
Anonymous
Just like the two words
 
caveman words
 
0
Q: Print Real Invisible Text

MayubeMy previous challenge, Print invisible text was quite popular, likely due to how trivial it is. However those more observant of you may have noticed that you're not really printing invisible text, because it's impossible to read what was inputted given only the output. So I figured how about a ...

 
9:53 AM
@Arjun pls no
 
Anonymous
Please refrain from sending non-English messages.
 
what Destructible Lemon and Mego said
 
It meant "Everyone Calls me a Joker", BTW
It's from lyrics of an old song
 
Anonymous
@DestructibleLemon That could be an interesting idea for a challenge: given a word that is spelled as a concatenation of two or more smaller words, decide if it is a "caveman word" (a word where the pronunciation is the same as the pronunciation of the constituent smaller words)
 
Bye
 
9:55 AM
How do you find the formula for square pyramidal numbers (where the $n$th square pyramidal number $=\sum^n_{k=1}k^2$)?
 
Anonymous
@Qwerp-Derp What do you mean, "find the formula"?
 
Bye forever...
 
Anonymous
You mean a closed-form solution?
 
@Mego Like, given an integer n you can use a formula instead of a sum to get the number
I'm bad at explaining :P
 
Anonymous
Let me write some LaTeX real quick
 
9:57 AM
@Mego no, it was a caveman words because caveman apparently knew english, but not the difference between subject and object
 
Anonymous
@DestructibleLemon Ok well maybe not a caveman word, but something else that describes those type of words
 
"me go" is "caveman" for "I am leaving"
"quotes"
 
I tried doing $sp(n) = n^2+(n-1)^2+(n-2)^2...+(n-(n-2))^2+(n-(n-1))^2$, and then applying $(x-y)^2=x^2-2xy+y^2$ to each of the items and then summing it, but that didn't work
 
CMC: Given a string of only uppercase characters, lowercase the string without using a "to lowercase" or similar builtin
 
@Mego?
 
Anonymous
10:05 AM
@Qwerp-Derp Working on it
 
Anonymous
 
@Mayube :| nooooo
 
Anonymous
Add 32 to every ordinal
 
@ASCII-only what? You can just add 32
 
@Mayube yeah i know :P but lowercase is just so much golfier
 
10:07 AM
@Mayube Jelly, 5 bytes: O+32Ọ
@Mego Actually right?
 
@Mayube Braingolf: VRl1-M[R# +>v]R&@
 
Anonymous
@EriktheOutgolfer Obviously :)
 
Anonymous
@Qwerp-Derp I'm trying to work out an explanation that doesn't require Faulhaber's formula, but it's difficult
 
@Mego What is Faulhaber's formula?
 
Anonymous
@Qwerp-Derp Complicated
 
10:11 AM
@Mego Just looked at the formula from Wikipedia, and it's daunting to even look at
 
@Mayube Charcoal, 8 bytes: FS℅⁺℅ι³²
 
@Mayube ->s{s.tr "A-Z","a-z"}
 
@Mayube CJam, 5 bytes: r32f+
 
@JanDvorak You don't need the space
 
wait is that Ruby?
 
10:16 AM
oh. Wasn't sure, thanks.
@EriktheOutgolfer yes
 
Why does Charcoal have to do this so ungolfily ;_;
In mathematics, a pyramid number, or square pyramidal number, is a figurate number that represents the number of stacked spheres in a pyramid with a square base. Square pyramidal numbers also solve the problem of counting the number of squares in an n × n grid. == Formula == The first few square pyramidal numbers are: 1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, 650, 819, ... (sequence A000330 in the OEIS). These numbers can be expressed in a formula as P n = ∑ k ...
 
@ASCII-only Yeah no, the proof doesn't really help, I'm looking for an algebraic solution
 
@ASCII-only oh don't be sad, 05AB1E is even worse
 
@ASCII-only you still beat Ruby and braingolf
 
@Mayube well yeah it'd be embarrasing if a golflang couldn't beat ruby
 
10:22 AM
@EriktheOutgolfer You don't need vy and the last J
 
oh how stupid of me
 
And AuA‡ is two bytes shorter
 
u is uppercase right?
oh I see
 
yes
 
doesn't u count as a similar built-in to "to lowercase" though?
 
10:25 AM
@EriktheOutgolfer not really imo
 
Presumably "to uppercase" count as similar. Otherwise we could probably do with just š
 
@Adnan What do A and do
 
A = alphabet, ‡ = translate
so the code is "translate upper case alphabetic chars to lower case"
 
Does Charcoal need a translate builtin
 
does it? Isn't it primarily designed for ascii art?
 
10:26 AM
yes
 
Could be useful if the pattern contain similar forms of different chars
 
@Qwerp-Derp You mean an algebraic derivation right?
@Emigna example?
 
AAAAAA\nBBBBBB, print row of A's, duplicate down, translate A to B
 
@ASCII-only Yeah, but I need reasoning as to why it's like that, I think I can understand it better in algebraic form than in the form that Wikipedia showed me
 
maybe not the best example
In general you probably don't need that function
 
10:28 AM
I'm using the formula to justify my reasoning to a problem that I have
 
@Emigna Charcoal doesn't have "duplicate down + translate A to B"
 
Anonymous
@Qwerp-Derp I can't find a good way to derive the closed-form solution for the square pyramidal numbers, but it's n*(n+1)*(2*n+1)/6
 
Anonymous
Even in the textbook I'm using, it's just an entry in a table in an appendix :P
 
@ASCII-only replace duplicate down with something charcoal has then
 
Quick question: What do you call it when you merge two lists into one in the following fashion: ABC, abc -> AaBbCc?
 
10:29 AM
zip?
 
interleave?
 
@Emigna I mean it has copy down but you can't selectively translate the pasted item
 
@Emigna Duh! :)
 
@ASCII-only Well, translate was the potentially new command we were talking about so I expect it not to exist :P
 
@Emigna I mean you can't selectively do anything to just the pasted item
 
10:31 AM
It is probably not a useful command in general though
 
Anonymous
The wiki page on Faulhaber's formula has a decent proof of the derivation. It can be a bit hard to follow, though.
 
@KritixiLithos And Duh! :P My head isn't always where it should be :P
 
Then there is almost no point in having a translate command
 
Anonymous
@StewieGriffin I will not ask where you found it this time.
5
 
2
Q: Interleave numbers from 1 to n, with the same numbers reversed

Stewie GriffinA simple one: Take a positive integer n less than 1000, and output the integers from 1 to n interleaved with the integers from n to 1. You must concatenate the numbers so that they appear without any delimiters between them. Test cases: n = 1 11 n = 4 14233241 n = 26 12622532442352262172081...

 
10:39 AM
@Mego I can tell you :) But in hindsight, it would be more correct to say: My head isn't always where it should be when it should be. On the way back from our (short) honeymoon, instead of flying non-stop from Florence to Bergen, KLM sent us (due to several cancellations) from Milano (4 hour drive from Florence) to Berlin to Copenhagen, then an overnight stay, then from Copenhagen to Oslo, and from Oslo to Bergen.
 
Anonymous
Oh wow, that's rough
 
Hmm, Braingolf really needs some sort of Map function
 
0
Q: How many goals has Steven Gerrard scored?

WeedozeSteven Gerrard was born on 30th of May 1980. He is now 37 years old. Happy birthday, Steven! To celebrate his anniversary, your goal is to remind him the number of goals he has scored each year in premiere league for Liverpool. He doesn't want to remember the goals scored before or after playi...

 
@Mayube Yes it does
 
right now to do something to every item in the stack you have to do this: VRl1-M[R(Code goes here)v]
it's an overhead of like 10 bytes
 
Anonymous
10:51 AM
Map is a very good and important function
 
Anonymous
Well, operator. But that's being pedantic.
 
hmm, but how should it work
should it be something like A and the next function will run on every item in the stack, or should it be like {} and everything inside runs on every item in the stack
 
Anonymous
Both?
 
@Mego I have both
@Mayube Both, like CJam
 
yeah I'll do that then. I still need to completely rewrite some parts of the interpreter
 
Anonymous
10:53 AM
In Actually, there's two way to do maps. The first way is ⌠code here⌡M. It maps the function literal over an iterable. The second way is ♂f (where f is some single command), which is shorthand for ⌠f⌡M.
 
CJam has the same, either {code here}% or :f
 
Anonymous
And then there's , the binary map operator. ♀f is equivalent to Z⌠if⌡M (Z is zip and i is flatten).
 
CJam has .f (vectorize)
e.g. [1 2 3 4 5][1 2 3 4 5].+ -> [2 4 6 8 10]
 
11:08 AM
@Qwerp-Derp Wait are you allowed to use the first few square pyramidal numbers in your derivation
 
@ASCII-only ???
 
@Qwerp-Derp I mean, if you're allowed to, just assume it's a polynomial and use repeated differences
 
@ASCII-only I'm summing the first 10,001 square numbers
 
@Qwerp-Derp yeah i mean assume it's a polynomial, use repeated differences to find the formula
 
@ASCII-only Elaborate?
 
Anonymous
 
@Mego I think I'm more confused after reading the Wikipedia article...
 
1
Q: Remove the Salutations

Beta DecayChallenge Hi, given a string as input, remove any salutations found at the start of the string. The program which performs the most correct substitutions in under 50 bytes wins. Salutations Hey, a salutation is defined as one of the following words: hi hey hello dear greetings hai guys hii ...

 
Anonymous
@Qwerp-Derp By using the values of the square pyramidal number sequence ((1,1), (2,5), (3,15), ...) and applying the method of divided differences, you can get what's called a Newton polynomial. That polynomial, when evaluated at positive integer values of its parameter, will yield the corresponding value in the sequence.
 
Thanks, Google!
Wait why the screenshot doesn't show half of "seconds"
 
11:21 AM
censorship
 
Anonymous
Rendering weirdness
 
Anonymous
Last call for feedback on this before I post it to main
 
11:33 AM
:37745199 I don't understand the need for "odd" in the first sentence. If it's redundant and just for emphasis, I personally find it causes more doubts about having misread the sentence than it adds clarity
 
hehe, in the process of implementing a Map function in braingolf, I found myself writing a VRAM program
VRAM&=
Takes the input, moves each character to the next stack in reverse order, then prints all stacks :P
 
Anonymous
@trichoplax I used that wording to keep it consistent with the OEIS description
 
I see. +1 either way, but that's the bit which made me doubt I'd understood what the challenge is about
Haven't looked at OEIS recently. Just seen this:
> The OEIS is looking to hire part-time people to help edit core sequences, upload scanned documents, process citations, fix broken links, etc.
I wonder if that opens new loopholes for some of our challenges...
Also I'm not entirely sure what "part time people" are
 
@trichoplax they're only people tuesday to friday
 
Exactly how I read it :)
 
Anonymous
11:39 AM
@trichoplax It's an important specification because MR doesn't work on even numbers.
 
Anonymous
One of the assumptions of the MR test is that n is odd and greater than 3.
 
I see. Makes more sense now.
 
oh crap I forgot I'm using { for reading input from STDIN, I should change that
 
Anonymous
Use , - it's what the cool BF derivatives/spritual successors do
 
, is for reversing elements of the stack
plus Braingolf isn't a derivative or spiritual successor to BF
 
12:09 PM
There we go, now to lowercase in Braingolf you can just do {# +}&@
 
@Mayube :| are char operations a good idea
 
@ASCII-only nothing about braingolf is a good idea
 
12:28 PM
I have a great idea for a golflang, a goo.gl link for a gist of a javascript program is a whole program
 
@JanDvorak O_o
@SIGSEGV Most programs would postdate the challenge though making them noncompeting
 
Umm
But the language doesnt
 
@SIGSEGV Yeah but if it didn't work before the challenge it's noncompeting
 
also a loophole
 
0
A: Sandbox for Proposed Challenges

Stewie GriffinThis is a multiple-holes challenge, where there are two groups of three related challenges. You must solve all tasks, possibly using several languages. You must solve the first challenge using a set of characters/bytes. Then you must add characters/bytes to the existing code (wherever you like...

 
12:32 PM
Oh by the way, this isnt a place for discussing games but just, The game Geometry Dash is kinda becoming a programming language
People even make games inside it
Game inside a game. So meta
 
there are submissions in minecraft, tis-100 and others so we're basically arqade.se already :P
 
What. how. O_O
-2
A: Sandbox for Proposed Challenges

ChristopherInterpret as many languages as possible code-challenge You must write a interpreter for as many languages as possible. Input You will take language name, code, input. These may be taken in any reasonable format, and in an order of your choice. Output The output of the given code when run wi...

 
@Ephphatha lol we need SMW code injection tho
 
I am thinking of removing this post. Should i?
 
@Christopher Yes pls
 
12:36 PM
@Christopher Thats your choice
 
I well if anyone wanted it they could have it, it is really bad
 
But you could tell them to create one program that interprets as many languages as possible
 
It's called a script that uses TIO
 
lol
 
@ATaco Bet you can't guess my name XD
 
12:54 PM
@Christopher Hmm, is it Calvin? :P
 
@ASCII-only oh my so gud
user image
2
Massachusetts has no criminal laws confirmed.
 
1:13 PM
0
A: Golf my Shakespeare quote references

blepIn what ungodly universe are these answers code? What's going on here?

Lol
 
he's either gunna walk away thinking we're all lunatics, or we're about to gain a new golfer
 
Funny thing is that most answers are in perfectly standard languages
There's only Retina and Jelly that are local to PPCG
Can't imagine their reaction on some other challenges
 
and if you've ever worked in JS you've seen minified JS before
 
Yeah except they all look like somebody took a bag of characters, threw it at the wall and then tried to write an essay
3
 
Well to be honest Perl always looks like that
3
:p
 
1:17 PM
oh snap
@ASCII-only Now update Charcoal so it can do this
10
Q: Buzzby Berkeley Robot Hokey Pokey

BumpyBuzzby Berkeley Robot Hokey Pokey Task Write a program or function to produce an ASCII art animation depicting a line of robots dancing to the lyrics of the Hokey Pokey (or Cokey, if you prefer) in the style of a Busby Berkeley number! Example Output Input Accepts three arguments (assumed ...

 
user165474
1:35 PM
o.o I broke subl
 
user165474
now I have to use atom
 
user165474
and I don't want to break that because if I do then I might need to use Kate D:
 
subl - sublime text?
 
user165474
yes
 
1:39 PM
@totallyhuman my English teacher would probably give such an essay an 80/80
 
user165474
My English teacher gives like 80/100 even if I try ;_;
 
…who marks over 80?
 
1:52 PM
Hellen Wait
 
Speaking of english: today is english final and english teacher hasn't even said if we have final ;_; and I have not even read book Q_Q
 
X_X
 
try and read chapter summaries online? ¯\_(ツ)_/¯
 
spark note for it is not working :'''''(
 
oh that sucks :/
 
1:58 PM
Question: can someone link/explain why Weierstrass function is not differentiable. is it because of the way the maximums peak?
 
Wow, there's 7 PPCG questions on the HNQ sidebar for me right now
 
nice
 
2:18 PM
> necro contest
wait wat
 
doesn't necro mean dead
 
0
Q: What are my arguments?

GreedoI had to solve this problem recently myself, and thought it could make for good golfing. Sometimes my Excel formulae get very unwieldy with functions nested within functions, bits and pieces all over the place. I’d just like to be able to look-up an argument of a function when it's nestled withi...

 
there are two androidify avatars and they both look similar
except one's in the air
 
@Arjun Why are you removing that note?
 
2:38 PM
@DJMcMayhem for this edit I believe it's because it's already in the tag excerpt so when someone clicks on it they see it twice
imo the suggested edits should show both but ¯\_(ツ)_/¯
 
user165474
@MartinEnder One of my friends said you have great hair (according to your profile picture) :P
 
@HyperNeutrino Yes, he does have nice hair :P
@Shaggy Because it is already present in the excerpt of the tag wiki.
@totallyhuman It was actually a GIF. But Stack exchange only shows first frame.
 
wonder if gravatar allows for gif's
 
2:56 PM
5 messages moved to trash
 
Can't I even "Hmmmmm..." here? C'mon! This ain't any secret chatroom of Men in Black, the intergalactic heroes
 
Am I missing any non-motorized, wheeled transport methods? bike, scooter, unicycle, skateboard, roller blade, roller skate
 
@HelkaHomba heelys.com
:D?
 
mmm, kinda
What's that scooter with no handle and a hinge between the wheels?
 
hoverboard?
 
3:04 PM
no
 
@HelkaHomba tricycle
 
caster board
 
yeah a ripstik
 
...which is the same thing as a ripstik yes
 
3:06 PM
Caster is more generic, thanks. Those look really hard to use...
 
mountain board
 
hehe
@HelkaHomba they're not bad
once you get used to it, they're more fun than skateboards imo
 
unicorn, probably
 
> wheeled transport
 
0
Q: Github Messenger

NonlinearFruitGoal: This goal to take a string and output how many contributions should be made on which days in order to display this message. Specification Input Support letters plus space (i.e. [A-Za-z ] ) Space is a blank 3X7 The letters are defined in this 5x7 DOT Matrix font provided below The siz...

 
3:07 PM
longboard
 
wheeled unicorns, probably
 
Ripsticks are super fun
 
and what's that triangular scooter with two footpads and 3 wheels?
 
I don't remember the name, but I think it was made by the same company as ripstick
Razor?
 
Razor is a brand
I mean this thing but I don't see a generic name
 
3:11 PM
err
a car meets your criteria
nope
 
maybe "propelling scooter"
 
tbt gym class google.com/…
 
i'm dumb
 
I don't know if they're common enough to have a generic name
 
3:18 PM
@HelkaHomba tricycle
 
@Poke good luck getting around (though I recall playing with things like that on special gym days too :))
@Arjun poke beat you
 
0.0
 
self-interpreter in python is easy
 
eval
 
lambda s:exec s
 
3:20 PM
eval()
 
speaking of which, what is the difference between exec and eval?
 
@totallyhuman fails for print "Hello". Needs escaping.
 
@totallyhuman I asked that a few days ago... eval evaluates an expression in a string an returns the result. exec just runs the code inside
 
@BusinessCat Oh! Then @totallyhuman, it does not fail for print "Hello". Sorry.
 
3:24 PM
As another example: eval("2 + 3; 4 + 6") errors but exec("2 + 3; 4 + 6") doesn't
 
while 1:exec(input('>> '))
errors will bork it though
 
Add a try-catch in there
 
yeah
 
@BusinessCat Why does eval produce error? Is 2+3;4+6 not valid in Python?
 
@Arjun it's not an expression
 
3:29 PM
So, both of them take in Strings?
 
it's like the same as trying to do return (2+3; 4+6)
 
@totallyhuman Ah, then, this will indeed produce error with print "Hello". Escaping required.
 
Can anyone with a tiny bit of Java-knowledge welcome a new user and explain what needs to be done in order to make this a valid submission? I'm quite sure it's not valid as it is...
 
for Java 8, simply wrap it with () -> {//code}
 
Wouldn't it be (int n) -> {} in that case
 
3:40 PM
oh, does it take a parameter?
my bad :)
 
(int n)->{for(int i=0;i<n;i++)System.out.print(i+1+""+(n-i));}
 
If I posted this challenge right now would you guys have any questions or complaints about it?
 
I have no idea how to use lambdas in Java so I can't test but (int n)->{for(int i=0;i<n;System.out.print(i+++""+(n-~-i)));} Would be 1 byte shorter
Err it should be ++i+... I think
 
@HelkaHomba There's also the snakeboard which pivots around the vertical instead of the horizontal, if that's relevant
 
@BusinessCat the double use of i makes this difficult
 
3:46 PM
0
Q: What is this date format?

JimFor Gregorian calendars, the date format varies from a country to another. There are three main formats recognized: YY-MM-DD (big-endian) DD-MM-YY (little-endian) MM-DD-YY (middle-endian) Your task is to write a program which, given an input string representing a date, output all the possible...

 
Yeah it does
 
@ETHproductions Looks well defined to me
 
ETHproductions: seems to me like it's well defined, but as a comment I'd say it's kinda simple
 
I definitely agree it's simple, but that doesn't exclude it being interesting to golf
 
I think it will be more interesting than most simple challenges, such as this one
Alright, here goes
 
3:51 PM
@ETHproductions could you say for concreteness what the printable ascii characters are?
 
I'd be afraid it just turns into another "shortest way to echo" challenge as the only thing you really have to do is {for i in string: print i ^ 2}
 
0
Q: How does heart beat faster while doing a strenuous task?

ArjunI know that when we do tasks which require extra physical effort (like running etc.), our heart beats faster. I also know that the reason behind this is that these jobs require more energy than usual and, hence, require more oxygen for breaking down food. And, since, oxygen is transported throu...

Could anyone help?
 
I don't think this is the chatroom you intended to ask
 
@xnor Yeah, sure
 
@Mayube since it's one parameter, you don't need the parentheses
you also don't need the type declaration
 
3:58 PM
@Arjun Which programming language are you seeking answers in?
 
Language of Humans, English, probably :P
 
I'm just joking because this may not be the best place to find biology experts :P
 
@totallyhuman yes you do.
the type parameter is required because Java doesn't compile without type information
which, in turn, requires the parenthesis
 
4:12 PM
7
Q: Same length, different string

ETHproductionsChallenge Given a string S of positive length L consisting entirely of printable ASCII chars, output another string of length L that also consists entirely of printable ASCII chars, but is not equal to S. For completeness, a printable ASCII char is one between \u0020 and \u007E, inclusive; that...

 
Is there a way to search the answers of a particular question?
 
Holy cow, how'd I get five upvotes in those two minutes I looked away
@WheatWizard search terms inquestion:55422
 
@ETHproductions Thanks
 
@ETHproductions Maybe it's 7 x had already read through the Sandbox-post, so once you posted I was already ready to upvote...
 
4:35 PM
Man it'd be nice if whitespace didn't require 13 bytes just to pull a character from stdin onto the stack.
 
I think your problem is that you're using Whitespace
 
nonsense ;)
I mean when you write a whitespace JIT compiler that does 1 billion instructions/sec you might as well use it right.
 
4:53 PM
Aw crap, I messed up the test cases: codegolf.stackexchange.com/a/123559/30525
 
0
Q: Google Logo in Conway's Game of Life

arodebaughGoogle Logo in Conway's Game of Life Conway's Game of Life base challenges are always fun so here is a new one. This is Google's Logo (if you have not somehow seen it): The font is called Product Sans. Your job is to replicate this logo (no color of course) in 800x439px just like the image (j...

 
Is it too late to change them?
 
If you don't alter the definition of the challenge itself that should be fine?=)
 
Okay, I'll just tell each answer to update
 
0
A: Sandbox for Proposed Challenges

flawrMultiplicity of a Curve code-golfmathpolynomialsabstract-algebrageometry Given an polynomial p in two variables x and y as well as an point (u,v), determine the multiplicity m of the curve C = { (x,y) | p(x,y) = 0} at the point (u,v). Details The degree of a monomial a * x^i * y^j in two var...

 

« first day (2313 days earlier)      last day (2524 days later) »