« first day (2372 days earlier)      last day (2481 days later) » 

12:13 AM
Anyone familiar with lambda calculus?
 
12:27 AM
0
A: Sandbox for Proposed Challenges

GryphonSquare a Number my Way. code-golf number People keep telling me that the square of a number is the number multiplied by itself. This is obviously false. The correct way to square a number is to make it into a square, by stacking it on top of itself a number of times equal to its length, and th...

 
@ASCII-only nvm
 
Just spent 5 hours debugging to find that I misspelled "tint' as "tind" -_-
 
12:49 AM
10/10
 
@totallyhuman this isn't the only time I've spent that long on an off-by-one-character error... I need to work on my speeling xD
 
@SocraticPhoenix once i debugged a capitalization error haha
 
It's still not working though :(. The TileEntity won't sync with the client so BlockColors isn't picking it up and tinting it anyway... _
 
Capitalisation has happened often enough to me due to python's booleans >.>
 
12:56 AM
Nim has almost case insensitive variable names to help with that
 
@SocraticPhoenix I did the same to figure out I did js compare instead of js_compare yesterday
 
a_long_variable and aLongVariable are equivalent
 
@trichoplax I dunno if I'd like that
 
@trichoplax what about a-long-variable
 
I like it apart from the "almost" - A_long_variable is different because the first character is case sensitive
@StepHen also equivalent
@StepHen No wait that would be subtraction...
 
12:59 AM
Hey that'd make a challenge
 
@trichoplax right
 
Check if they would be equivalent variable names in nim
A simple one but y'know...
 
I love how replete coding docs are with minor spelling/grammar errors, we really don't care :P
 
Hmm, the explanation says dash-style is fine too - not subtraction...
 
1:01 AM
@trichoplax I've usually heard it called snake-case
 
I'll just make it I don't see why not
 
Sounds clear to me.
Two inputs, return true or false?
 
I don't think I need to sandbox it either, given that the docs cover it fairly well
 
1:04 AM
COLORS! IT MADE COLORS! Teh tint works! I'm so happy :)
 
Nice
 
@trichoplax I dunno what I'm doing in Nim, but golf the reference implementation and you'll get upvotes
 
@SocraticPhoenix what tint
 
@StepHen looks fairly easy...
 
@ASCII-only the block tint for the ores with the overlays so there can be 256^3 ores in minecraft
(I'm modding)
 
1:05 AM
@totallyhuman I know how to golf it, I don't know how to run it then :P
 
@totallyhuman I tried not sandboxing a challenge once. It went badly...
8
Q: Tips for golfing in Nim

trichoplaxWhat general tips do you have for golfing in Nim? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Nim (e.g. "remove comments" is not an answer). Please post one tip per answer.

 
It looks fairly simple, all I'd need to look up is how to print stuff :P
 
It's fairly easy to pick up, especially if you're used to python
 
And anyways, I shall include it as a reference implementation so none of y'all can get points golfing it :P
 
Unless they can golf it more...
 
1:11 AM
Oh yeah sure
But just plain removing whitespace is boring
 
You can't do the python alternating indentation with tabs and spaces in Nim though
 
@SocraticPhoenix um... maybe not 256^3
that would not be very fun to distinguish between
 
One for every colour in allrgb.com
 
@trichoplax Wait so each image is just a rearrangement of the pixels of the other?
 
Yes
 
1:21 AM
ooh pretty xD
 
Like this:
383
Q: Images with all colors

Mark JeronimusSimilar to the images on allrgb.com, make images where each pixel is a unique color (no color is used twice and no color is missing). Give a program that generates such an image, along with a screenshot or file of the output (upload as PNG). Create the image purely algorithmically. Image must ...

 
Was I going crazy or did a flag just briefly appear?
 
13 messages moved to Trash
 
Not here, please. If you have any questions, ask the on the Ask Ubuntu post.
 
Alright. Regardless, I have to go now. o/
 
1:31 AM
@trichoplax woah the winning answer was on new scientist and gizmodo
 
I did not know that. Wow
 
@betseg :P
 
1:45 AM
hey anybody have some random strings for test cases?
 
@totallyhuman for what
 
nvm i'm done
ok NMP you can do this
you got this
you have one job and you can nail it
 
@totallyhuman do we have to make it's a valid identifier too? ie what's the output for ~ , ~
 
2:00 AM
NMP is ambiguous. It could mean "New Main Posts" and "New Meta Posts".
 
Leaves us in suspense as to whether it was sandboxed first...
 
3
Q: Are these identifiers equivalent?

totallyhumanIn the language Nim, the rules for differentiating identifiers are slightly more relaxed than most other languages. Two identifiers are equivalent or address the same variable if they follow these rules: the first character of both are the same (case sensitive) both strings are the same (case i...

 
@trichoplax sandbox is NSP :P
 
Oh yeah... ignore me
 
@StepHen input validation is not required
Will address
 
2:10 AM
Dammit 05AB1E on TIO is inconsistent with the docs
Gah it's not just TIO; the interpreter itself does not match the docs >.<
Hey 2sable is consistent in that area though
 
@HyperNeutrino No surprised there, as TIO uses the official interpreter...
 
@HyperNeutrino speaking of docs, how's this for programmer-oriented docs? github.com/stestoltz/cQuents/blob/master/commands.txt
 
@Dennis Yeah. I figured it wasn't a TIO issue (even if so it would just be an unpulled commit)
@StepHen Is that a markdown file?
 
@HyperNeutrino no
 
okay
looks fairly easy to understand.
 
2:13 AM
(that's on purpose)
@HyperNeutrino thanks, though my syntax is still mega screwed up so good docs won't help that much xD
 
:P
Great. So I need 05AB1E's map for a solution, but I need 2sable's string subtraction as well. grr
If only the docs were actually correct...
 
@HyperNeutrino how do you like the look of this (CSS)? There's no functionality yet.
 
The contrast seems a bit too high in my opinion; the colors almost clash a little bit, in my opinion.
I'd suggest toning down the intensity of the blue a bit.
 
ok, thanks :)
 
No problem :)
Darn it!
05AB1E doesn't count brackets properly.
It doesn't match them so you can't nest quick-like things.
Forget it. Someone will figure it out.
 
2:25 AM
CnR?
 
No. The identifier challenge.
I'm trying to mimic my algorithm for Jelly but 05AB1E doesn't do brackets properly.
 
@HyperNeutrino ok, how's that blue? (might need to Ctrl-F5)
 
Looks much better :)
 
cool thanks
 
np
well I gtg now o/
 
2:27 AM
@HyperNeutrino gnight
 
2:52 AM
@StepHen ew black and white at the same time
 
In hexagony there are 6 memory cells, right?
 
@Poke IIRC there are an infinite number
 
ah...
that explains my issue
i think i misinterpreted
> Picture an infinite hexagonal grid (which is separate from the source code). Each edge of the grid has a value
that makes more sense
 
@Poke yeah in hexagony things are stored in edges for some reason
 
 
1 hour later…
4:06 AM
0
Q: Generating Fermat primes

poi830Given a number n, print the nth prime Fermat number, where the nth Fermat number is 22n+1. This code should theoretically work for any n (i.e. don't hardcode it), although it is not expected to terminate for n > 4. Test cases 0 -> 3 1 -> 5 2 -> 17 3 -> 257 4 -> 65537 Rules Standard loophole...

 
4:32 AM
Is there a mod currently online?
 
@HusnainRaza What do you need? Flags are the best way to bring something to moderator attention in the majority of cases.
 
I have flagged an answer that a mod deleted and requested an undelete
Yesterday
 
Did you check the status of your flag?
 
How do I do this
 
Go to your profile -> acticity -> __ flags
It should show a list of all the flags you raised and how moderators have responded
 
4:37 AM
0
A: Sandbox for Proposed Challenges

xyz123Challenge: Print on a numerical delay! What I have in mind is to print the following text to the screen: 1 2 3 4 5 6 7 8 9 10 That seems pretty easy until I add this constraint. Wait 1 second and then print 1. Wait 2 seconds and then print 2, wait 3 seconds and then print 3. Wait 4 seconds ...

0
A: Sandbox for Proposed Challenges

fireflame241Language of a Simple Context-Free Grammar code-golf grammars Given a list of production rules and start symbol of a proper context-free grammar (CFG) of printable characters, your program or function must output its formal language (the set of all sentences which can be constructed from it). ...

 
If you would like you could show me the answer. I'm not a mod but I have undeletion privileges.
 
I can't find the flags link
 
Thats a link
You can click it to bring you to the correct page
 
Okay thanks sorry I'm stupid
it sai
it says waiting for review
 
Ok then they haven't seen it
 
4:41 AM
Rip
 
As I said I can take a look if you would like.
I can't undelete it but I can vote to.
 
50
Q: One OEIS after another

caird coinheringaahingThis is an answer chaining question that uses sequences from OEIS, and the length of the previous submission. This answer chaining question will work in the following way: I will post the first answer. All other solutions must stem from that. The next user (let's call them userA) will find the...

So basically I wrote two answers, both hard coded the sequences
one got accepted, the other got deleted
im confused
 
@HusnainRaza Yeah you are in the right here
 
Yay
How do you format code in an answer
 
depends a bit
mostly four spaces before every line will do
to get it perfectly I just go to tio on a random language paste it in and hit get link, I steal the formatting from the pre formatted answer link.
 
4:49 AM
Ok cool
im new to the whole code golf scene
And not very good
 
Don't worry. Practice makes perfect. All of us were bad when we started
and I for one am still pretty bad at golfing.
 
Is there a discord for this stackexchange
just circus
curious
 
@HusnainRaza no
 
Don't know, most people chat here
 
> 21k rep
 
4:55 AM
@ASCII-only Most of its from asking code-golf questions not answering ;)
I'm good at brain-flak, and I used to be good at python. But I would not consider myself a good golfer
 
@WheatWizard used to?
 
I haven't golfed in python in a while. I've been off my game.
 
5:15 AM
hmm
should i mandate empty string handling?
 
pssst
No it would make my answer longer
 
I don't think it makes a lot of sense tbh. An identifier is never going to be empty
 
i'll just make it undefined behaviour
mm that too
ok there
now submit your answer lol
 
thanks ;)
 
5:22 AM
oh haskell ofc. still confuses me to this day lol
 
Haskell is so much fun
@totallyhuman Added an explanation. Hopefully that will make things clear. I'm always open to questions as well.
 
oh neat
 
> What is s it is a function that removes all the separators and converts to lower case
 
oops
 
haskell seems like one of those languages where you learn it and you get confused while writing code in other languages
 
5:28 AM
Yeah, I get frustrated when I can't pattern match in python
 
good morning
what´s the UTF code for coffee?
and why do so many ppl with 100 rep lecture me?
 
@Titus here, 2615
@Titus wait what? pls link
 
@totallyhuman isn't that how every language is?
 
1
A: Print Numbers from 1 to 10

TitusJavaScript with UnderscoreJS, 20 Bytes alert(_.range(1,11))

 
or how they generally are
 
5:37 AM
3
A: Stream of Letters to Words

TitusPHP, 94 bytes for(;$c=$argn[$k++];print$c." "[--$e])if(!$e)for($r=rand(0,71);$r>ord(x^"ywgSKAF:=?"[$e++]);); Run as pipe with -nR or try it online. breakdown for(;$c=$argn[$i++]; # loop $c through string print$c # 2. print current character, ." ...

what was that with the fruit?
 
@DestructibleLemon well you know there are a lot of languages that are similar to each other
 
hmm I guess
 
you could probably learn the c family and be fine
 
I'd say that I need my python list comprehensions
 
I know C, I just don´t work a lot with it. PHP is paying my bread and butter and rent and well about everything. :D
 
5:41 AM
ew
php
 
Maybe if I´d learned Java in time, I wouldn´t be paying a rent but a mortgage instead. hehe.
 
@DestructibleLemon PHP isn't that bad if you just ignore the parts that are PHP :P
 
0
Q: Sudden increase in number of complaints

bjanThere is a Call Center which records number of complaints against a service on daily basis. For example, below values show number of complaints for last 6 months for a service Jan, Feb, Mar, Apr, May, Jun 020, 030, 010, 030, 045, 065 How can one find sudden increase/decrease in complaints fo...

 
@NewMainPosts way too off-topic o0
 
^^
 
6:00 AM
o0 how are hotness points given
my question apparently has 96451 points
 
number of answers is a big factor
So is age
but that was probably obvious
 
yeah i understand that bit
but the number seems so odd
 
IIRC 96451 is odd :p
 
6:27 AM
<- is idiot
i forgot // was comment in charcoal verbose mode >_>
 
I wondered a couple of days ago why // doesn't work as integer division in Swift, where // is the comment syntax...
 
@WheatWizard Hi, one of your call(x) should be call(y). (Also one in the TIO.)
 
3
A: How high can you count?

DougJava, 1 :( public class P{ static{ System.out.println("1"); }}

 
>_<
 
@totallyhuman still cracks me up
 
6:32 AM
How does it have +3?
 
@ØrjanJohansen Yeah that and two or three other mistakes. Thanks for that its all fixed now
 
because people found it funny
 
6:45 AM
Everything is terrific to solve in Swift. replace("-"," ") in Python is replacingOccurrences(of:,with:) and you cannot just subscript a String, you must do String[String.index(after:String.startIndex)]...
 
lovely
 
Also, function parameters are constant. def f(a,b):a=sorted(a) in Python is like func f(a:String,b:String){var a=a.sorted()}...
It's killing me!
 
What is the length of the shortest JS code to calculate factorial?
 
wut
jelly doesn't have less than or equal to
 
@totallyhuman No golfing language does. It has greater or equal instead
@totallyhuman Want to give each other CMCs in JHT?
 
6:56 AM
ah no sorry don't wanna do jelly at 3 in the morning
 
@totallyhuman Ouch, 3 AM
In other words, you don't wanna play hide and seek at 3 AM :D
 
lol
but hey late night coding is best coding
but not jelly though :P
 
True ^
 
7:11 AM
hmm
need character for string replace
 
@totallyhuman In ASCII or any character in unicode?
 
unicode
 
@totallyhuman ✎
 
🔄
 
@totallyhuman ⟷
Or ⟺
 
7:19 AM
how about ☕ for delay?
 
> Push str3 with all instances of a string that match the regex str2 replaced with str1
 
I´d say something unidirectional for replace ... like ➡️ or →
 
clunky
 
GAAAH! I closed the tab with the Changes to Cthulhu! Now I have to start again!!!
 
8:00 AM
@Mr.Xcoder Cthulhu?
 
8:23 AM
@ASCII-only his own language
 
@Mr.Xcoder ok how could you lose the changes
looks for Android GitHub app
Crap I was supposed to write one oops
 
8:46 AM
@ASCII-only Simple. Exit the tab you were working on without pressing Commit.
Nice challenge @LuisMendo
 
2
Q: Float 754 to Hamming

Luis MendoYou will be given as input an integer k in the range from -4503599627370496 (-2^52) to 4503599627370496 (2^52). As is well known, integers in this range can be represented exactly as double-precision floating-point values. You should output the Hamming weight (number of ones) of the encoding of ...

 
@Mr.Xcoder Hey, thanks! I only fear the title reference will go unnoticed :-D
 
Since linking to other questions is quite common here, this might be of interest:
1
A: Do related linked questions really need to be linked twice?

trichoplaxMake room to show more related questions For many questions, the "Related" items are just a small selection from a much longer list. Showing items in both lists, "Linked" and "Related", means other related items have to be omitted. This means useful information is being lost. Since the two link...

 
9:04 AM
@Mr.Xcoder til you can commit tabs
 
3
A: Float 754 to Hamming

Leaky NunC (gcc), 82 bytes evil floating point bit level hacking s;f(long n){double d=n;unsigned long l=*(long*)&d;for(s=0;l;l/=2)s+=l%2;return s;} Try it online!

brownie points if you get the reference
 
@LuisMendo I have a question about MATL
What is the "equivalent" of quantizer from Matlab?
@LeakyNun Wikipedia code golfed?
 
9:29 AM
@Mr.Xcoder There is none. In fact I have never used quantizer in Matlab or know how it works. But, as a hint, Z% is an equivalent of typecast
 
I don't know what typecast is :)
I'll search though :)
 
It casts without changing the underlying binary representation
 
I am curious to see the shortest Python script for your challenge
 
9:52 AM
wow surprised nobody's cracked this yet, it's such a simple sequence
 
@Mr.Xcoder Thanks for the edit
 
@Mr.Xcoder 73 bytes :( looks like the easy way isn't the way to go
 
is there a general consensus on how should be scored?
 
wait :| fails for negatives
@Mayube Not really
 
10:16 AM
@LuisMendo Np
@ASCII-only That's 71 bytes, because f= is not needed
 
@Mr.Xcoder oh true
 
@ASCII-only Why don't you post your answer/suggest improvements to the existent Python answer?
That one is 81 bytes
 
10:31 AM
Mod team be like:
Dennis - The mod who locks posts and moves conversations to comments.
Martin Ender - The mod who enforces site policy really powerfully
Doorknob - The knob
 
Alex A. - M.I.A.
 
Alex A. -
 
@EriktheOutgolfer AlexA - The bird that flies around every now and then
 
I wish he didn't get hunted he's inactive lately
 
@EriktheOutgolfer Don't forget to add this to Dennis: The mod who locks posts, moves conversations to comments and adds the tag to the sandbox every time it gets removed by the dumb community
 
10:36 AM
@Mr.Xcoder it's not always him
 
@EriktheOutgolfer He often does that
 
yeah because he gets most of the flags or something but I've seen others do that too
 
@EriktheOutgolfer Now are you done with eating and sandbox (aka JHT?)
 
heh that was yesterday
it was late night
 
Who knows?
 
10:38 AM
not sure if I have time rn I might have to go to sea...my summer schedule is pretty full
 
@EriktheOutgolfer schedule in the same sentence with sea... Meh
 
it's not only sea
 
I got it :D
My first program in MATL... Double the divisors: Z\E :)
 
Did your question catch on fire, Luis?
 
10:49 AM
It seems so :-) PPCG always has an advantage in the SE Hot Network Questions
 
115.118 hotness points +1
@LuisMendo A couple of challenges of mine took the first place too, in the past :D
@LuisMendo How do you remove duplicates from a list in MATL?
 
can I have any more feedback on this one please? final call
(rn it seems pretty good)
 
Let me read it
 
heh of course you should read it...
@LuisMendo quite common...get used to that :p
 
It seems nice, as I've read it
 
10:53 AM
@Mr.Xcoder u
@EriktheOutgolfer Yes, it has happened in the past :-)
 
Thanks
 
@Mr.Xcoder thanks :) I'm posting it
 
MATL is very simple, as I can see
 
@Mr.Xcoder What's that "list" exactly? MATL doesn't actually have lists. Is it a vector of numbers?
I'm glad you find it simple, but it has its quirks, most inherited from Matlab ;-)
 
@LuisMendo The code is Yfu, get the prime factors only once.
 
10:56 AM
Ah, then yes, the output of Yf is a row vector (1xN matrix) with the N factors
 
@EriktheOutgolfer I didn't have time to write a Python implementation :(
 
2
Q: Skip like a rabbit!

Erik the OutgolferGiven a list of non-negative integers in any reasonable format, iterate over it, skipping as many elements as every integer you step on says. Here is a worked example: [0, 1, 0, 2, 5, 1, 3, 1, 6, 2] | [] ^ First element, always include it [0, 1, 0, 2, 5, 1, 3, 1, 6, 2] | [0] ^ Skip 0 ele...

 

« first day (2372 days earlier)      last day (2481 days later) »