@Seggan that doesnt imply the orderings of each list though
ive got "All suffixes (ordered longest to shortest) of all prefixes (ordered shortest to longest) of the positive integers.", is any of that redundant?
for a second i thought you meant the language in floop, and then ten seconds later i realized that's what the name is a pun on i knew it was some kind of pun but TOTALLY forgot what
Come November 1, Programming Puzzles and Code Golf will graduate, so in the next 11 months, we'll want to save some memories from when we were ungraduated.
Write a program that produces the PPCG favicon, seen below.
The image must be at least 64x64 pixels.
The blue must be the color #62B0DF....
CMQ: Say I have a hypothetical language which, rather than directly outputting to stdout, internally stores a buffer of output and prints that when the program terminates. (forgoing making it output as a stream) can I use this language on challenges requiring infinite output?
@emanresuA If you rely on your program doing a finite amount of stuff in a challenge involving an infinite amount of output in order for that stuff to work correctly, I don't think that's valid
And since you can pretty much write anything you can write in any other language in C given that it's so low level, that would mean it's impossible for any language to do that, which wouldn't really make sense (plus that sort of hidden buffering doesn't seem very C-y to me)
@emanresuA tbh i sort of like seeinmg the graphic output challenges where its like "make it look like this but it doesnt actaully have to be exact" but theyre better as popcons where you can just vote to decide whether it really looks like the thing or not, like that "make a forest" challenge
@mousetail Here is how I did it in Pip. Basically, the unpaired values are included in the result unchanged. I'm not 100% sure that's the best approach for subtraction; perhaps the last result should be [6;15;24;-7] instead.
@thejonymyster Currently, since it's a proof-of-concept rather than a full-fledged language, there's a very rudimentary parser. Tokens are any run of non-spaces. Tokens that start with a letter are functions or modifiers; tokens that start with ' or " are character or string literals; there's a few miscellanous tokens that start with symbols; and anything else is an integer literal.
I originally thought of N for natural numbers and N+ for positive integers, but that would start with a letter, so I stuck a symbol in front of it.
If this ends up turning into a golfing language, all of those tokens except string/char/int literals would be one byte each.
subjective cmc idea: solve (some problem) in a golfing lang but the code has to be pronounceable :P
@thejonymyster followup CMC: given N, output the Nth iteration of prefix/suffixing the positive integers ( about to explain)
(index however oyu like) 0 steps: just the postitive integers 1 steps: all prefixes of the positive integers 2 steps: all suffixes of all prefixes of the positive integers 3 steps: all prefixes of all suffixes of all prefixes of the positive integers...
which translates to: - For each number in the list, pick a nonnegative integer and multiply it by 10. Call the resulting list L. - Consider possible assignments of elements to L in increasing order of L's sum. - Add each element of L to the corresponding element of the input list. - Assert that the result is strictly increasing.
Fun fact: to run an infinite loop over the positive integers in QBasic, you can just write FOR i = 1 TO 1/0, since 1/0 gives 1.INF rather than an error.
(In theory, anyway. In practice, numbers are floats rather than unbounded ints, so you'll run out of floating-point precision at some point and start repeating the same number over and over.)
Aw, dang, it's not true for actual QBasic, just QB64. :P
@thejonymyster QB64, 52 bytes:
FOR i=1TO 1/0
FOR j=1TO i
FOR k=j TO i
?k
NEXT k,j,i
@thejonymyster btw, the JS code you put there is quite bad practice lol. normally, you initialize variables, not just set them (which writes them globally). people only do that in golfing :P
@thejonymyster you need to find the first one. The rest are ascii
@RadvylfPrograms you are quite close. I had to write some C that read in and wrote out unicode characters a few years ago and it was so painful I want to share the pain :)
If you need UTF-8 handling though, I'd really encourage using a library, and there absolutely has to be a good one out there given that it's like, 2022
"there are also some very rarely-used characters in the "CJK Unified Ideographs Extension B" and "CJK Compatibility Ideographs Supplement" blocks, which take 4 bytes in UTF-8.
Also be aware that Chinese text often contains ASCII characters like the digits 0-9."
@thejonymyster you could add some mathematica code, people on OEIS like mathematica lol: Print @ Flatten @ (Reverse@FoldList[Join[#2,#]&, {#}&/@Reverse@#]& /@ FoldList[Join, Table[{n},{n,1,10}]])
or haskell: import Data.List; main = print $ take 50 $ concat $ concatMap tails $ inits [1..]
Generalist is currently impossible to get, as it requires each of the top 40 tags to have 100 questions in. Tenacious/Unsung Hero will never happen, as they require multiple zero score accepted answers, and, by nature of the site, that never happens. Illuminator, is my badge goal :P
This badge, which I'd nominate as a silver, would be awarded for every 5 accepted answers a user has with no votes. There should probably be a 24-hour window after acceptance before this badge is awarded.
Why do this, you ask? Well, one of the much-belabored issues of the SO model is that rep ...