3:09 PM
What app is this?
@0 ' IIRC, orlp is really good at it.

is this too similar to my current challenge to post separately? math.stackexchange.com/questions/2183085/…
I like to ask on math.se to make sure there really isn't a closed form formula which would ruin the challenge
@0 ' shamefully no

Does anyone have some feedback for meta.codegolf.stackexchange.com/a/11746/8478?

@Lembik it took me a while to understand your question

@PhiNotPi ah .. sorry about that
is it clear now?
which part was particularly unclear @PhiNotPi ?

Probably just that the output was the same as one of the inputs.

3:23 PM
@MartinEnder There's a (trivially) simple decision solution using ASCII values

Ughh I hate working with C

I'm trying to implement Smaz compression for Ohm, which is a C library, so I'm using a Ruby native extension
For some reason, the result keeps appending garbage data

@MartinEnder Add the char codes together and %2 -- all the allies are even, all the enemies are odd

Which doesn't make sense to me, since I know there's a NUL terminator

3:24 PM

thanks for spotting it.

Sorry. :-/ You're welcome.

@AdmBorkBork 82 + 71 is odd

3:26 PM
Nope, apparently I need more caffeine.

^^^ is W and G

Also 66+85 is odd

Yeah, nvm, I apparently can't read right.

I have a brute forcer for this stuff, let me give it a go.

3:37 PM
@Lembik Do you have some more terms to the sequence?
Right now I have 4,8,14,23,34,49,66,87

@Lembik do you have the actual lists of valid `P`? I'm not seeing how 14 different P can be valid for n=4, as I think none of 1100, 0110, 0011 can be realised with any T.
I feel like in general, only strings of the form `0*(10*)\1*(10*)?` are possible (that is, all the gaps between `1`s have to be the same)

@MartinEnder Röda, 30 bytes. Try it online!

3:54 PM
Hmmm, not finding any simple solutions based on character codes.

There are some similarities with character codes between the allies and enemies

I'll let a longer search run until tomorrow

@PhiNotPi No that's all I have

Porting my answer to V I get 20 bytes. Try it online!

@MartinEnder Yeah, sorry, I got myself confused.

3:59 PM
@MartinEnder [(0, 0, 0, 0), (0, 0, 0, 1), (0, 0, 1, 0), (0, 0, 1, 1), (0, 1, 0, 0), (0, 1, 0, 1), (0, 1, 1, 0), (0, 1, 1, 1), (1, 0, 0, 0), (1, 0, 0, 1), (1, 0, 1, 0), (1, 1, 0, 0), (1, 1, 1, 0), (1, 1, 1, 1)]

There are overlaps.

Actually, something seems to be wrong with my brute force search...

@Lembik I ask because this sequence has several near-misses (some values are off-by-one), so more terms would tell whether or not it was a coincidence.

@Lembik How is `(1, 1, 0, 0)` possible? What's the corresponding `T`?

@MartinEnder (1, 1, 1, 1) (1, 1, 1, 1, 1, 0, 0)

4:01 PM
oh, I see
misunderstood the question

@PhiNotPi very interesting.. more terms would be great!

I thought you were looking for results that matched P

they do have to match.. I am not sure what you mean
you just run an exact matching algorithm for that P and T
@PhiNotPi I could post it as a new challenge if people think that is suitable

you're looking for all possible `f(P,T)`

then we can get some more terms

4:03 PM
@Lembik I think he means that he thought that the output sequence had to match P

I thought you were looking only for those where `f(P,T) = P`

@MartinEnder aha!
that would be quite tricky :)

no, it seems to be quite trivial :P

^ I think this was the same confusion I had because you picked a bad example

well. tricky or trivial :)

4:04 PM
yeah, what phi said. maybe change the example in the question to one where the result doesn't match P

@Fatalize I should make a challenge in which "coming soon" is a test case.

changed the example

okay, first observation: if the string contains `11`, there can be only one run of `1`s
I think similar observations will be possible with each `10*1`, which should help us narrow things down
yeah, if the string contains `1.{n}1`, then all admissible P have period `n+1`. if there are more than two `1`s in the string, then all of these constraints need to be satisfied, so all admissible P have a period of the GCD of all those `n+1`. that should severely limit the possible T and therefore also the final results.

@MartinEnder Looks good!

4:25 PM
@Lembik another conjecture based on OEIS superseeker results: u(n)=2*u(n-1) - u(n-2) + d(n) where d(n) is oeis.org/A000005
(there might be an off-by-one error depending on how those sequences are indexed)

@AdmBorkBork @KritixiLithos found the bug in my brute force search. there are some interesting short expressions to solve the problem which are not obvious at all
(based on character codes)

What are they?

Pfft, spoilers :P

> wall: cannot get tty name: Inappropriate ioctl for device
wut
What do these words mean ;-;

@Lembik So the question (based on my imperial sequence stuff) is whether the next terms are closer to [110,140,172,210,252] or to [111,139,169,205,243]

4:35 PM
@Lembik I have a suspicion that in general the string can only contain one run of `(10*)\1*1`, surrounded by zeros, which curiously is almost the exact same thing I got earlier.
do you have the full lists for n = 5 and n = 6 at hand?

CMC: Given two sorted int arrays of potentially variable length, merge them into a single sorted array. (Merge as in Merge Sort)

12

Merge Sort In this challenge, you will implement the merge subroutine of merge sort. Specifically, you must create a function or program or verb or similar which takes two lists, each sorted in increasing order, and combines them into one list sorted in increasing order. Requirements: - Your a...

@fergusq [feature-request] Have Röda's `indexOf` work on arrays as well (right now it doesn't work for anything that is not a string)

CMC: Given two unsorted int arrays of potentially variable length, merge them into a single unsorted array. (Merge as in Merge Unsort)

Possibly unsorted or definitely unsorted?

4:43 PM
@BasicSunset it was actually a joke, but I'd say definitely unsorted

@PhiNotPi ಠ_ಠ

I figured it was a joke :P

@PhiNotPi `a->b->org.apache.commons.lang3.ArrayUtils.addAll(a,b)`
Returns an unsorted `Object[]` array in the shortest possible time.

Doesn't that just append `b` to `a`?

@BasicSunset if the inputs were unsorted isnt the merged one straight up going to be unsorted?

4:51 PM
@BasicSunset Yes. Which is the most efficient way.

@MartinEnder Then when are you going to post the challenge? Can't wait to see what these expressions are :)

Oh I missed that the inputs were unsorted too derp
Than Jelly, 1 byte: `;`

It would be slightly more interesting if you couldn't guarantee that they were unsorted

Yeah
Let's do that one
Must run in no more than O(NlogN)

You can always do somehting like append, sort, and reverse

4:54 PM
But can you do better than that?

`a[0] + b + a[1:-1]`

Does powershell require the spaces around `+`?

@AdmBorkBork why do you need the `-1`?

pseudocode

@KritixiLithos there you go

4:55 PM
Ooh

append, if(a[0] < a[1]){switch a[1] and a[0]}

@betseg Just to get my point across. Actual implementation is left as an exercise for the reader.

lol

@MartinEnder Seems fun!
@KritixiLithos that was fast.

@KritixiLithos Done.

5:02 PM
4

In the card game Magic: the Gathering there are five different colours, which represent loose affiliations of cards, White (W), Blue (U), Black (B), Red (R) and Green (G). These are often arranged in a pentagon as follows: W G U R B Both in the lore of MtG as well as in many card mechanic...

I'm taking bets how long it will take until the first non-boring solution. ;)

@fergusq So `_` pulls the value on the stream?

27 views and 4 answers is pretty good

0

Dyalog's APL team is looking to hire, and we are more interested in golfers than regular programmers, as the former are more likely to have the right mindset. Since codegolf.stackexchange.com/jobs doesn't exist, could it be created?

It pulls as many values it can and runs the function for all of them. It's like a map operation: `push(1, 2, 3, 4) | [2*_]` creates a stream of 2, 4, 6 and 8. `push(1,2,3,4) | [_*_]` creates a stream of 2 and 12.

5:06 PM
0

Make a Jewel code-golf March 13 is recognized as National Jewel Day, which is the theme of this challenge. So, given an integer n where n is greater than 0, create an ASCII jewel. For example: n = 1 n = 2 n = 3 ______ ...

So it's multi-purpose. Can be used in loops and can pull values

@NewMetaPosts But... why?

It's equivalent to a loop: `[2*_]` is same as `[2*x] for x`. It's just that for loops pull values from the stream.

Java's beating Roda and Powershell ^-^

I got 2 different 23 byte Retina solutions

5:10 PM
yeah, I've also got 23

@ГригорийПерельман I thought this day would never come ;◡;

@BasicSunset nvm, got 18

Oi wut Roda got golfed
;-;

@fergusq Now I changed my submission to take the input as a two-char string so I could drop the concatenation

@BasicSunset posting, if you don't mind

5:12 PM

@KritixiLithos I saw. It now beats every submission (except CJam). :D

@ГригорийПерельман Check again :)

1 min ago, by Григорий Перельман
Oi wut Roda got golfed
I noticed ;-;

@KritixiLithos Btw, per rules you don't have to include the function name (as it can be anonymous), so you can still save one byte.

Roda seems like a cool language, but the documentation is in Swedish.

5:15 PM
*Finnish
But there's also an English documentation

Finnish and Swedish look the same to me, even though I know they're actually totally different
@KritixiLithos Where?

@ГригорийПерельман btw, the diacritic on the o

Yeah I can't type that.

It should be Röda, not Roda, but noone even cares :P

5:17 PM
@ГригорийПерельман Trust me, they look totally different ;)

Surprisingly, phones make that easier, not harder

ö sounds more like 'oe' than 'o'

@ГригорийПерельман kaivos.org/~iikka/r%C3%B6da/doc

@KritixiLithos I know, but I can't tell the difference. All I knew is that ö is only a thing in Swedish and Finnish iirc, and Swedish is more common.
@KritixiLithos thanks

So probs the correct pronunciation for Röda is 'Roeda' not 'Roda'

5:19 PM
@KritixiLithos I agree. See the difference: Ohjelmointi on hauskaa! (Finnish) Det är roligt att programmera! (Swedish)

@fergusq You do both Finnish and Swedish? wow.

Those don't look like different languages to someone who doesn't speak either.
@MatthewRoh Most people in Finland do.

@ГригорийПерельман Ah. makes sense then.

@MatthewRoh Have to. Swedish is an obligatory school subject in Finland. Also IMO the easiest language in the world.

Sweden has the highest rate of English proficiency in the world out of non-English-speaking countries.

5:21 PM
I don't know Swedish, but Danish is similar to Swedish so I can recognise some words like `Det` and `roligt` (same in Danish I believe) and `är` and `att` (like `er` and `at` in Danish).

@ГригорийПерельман The difference to non-Swedish/Finnish speaking people: [Some words I don't understand](Finnish)[Some words I also don't understand](Swedish)

@MatthewRoh Röda is pronounced with a similar sound like in the word "burn". Maybe. I'm not good in English pronunciation.

@fergusq thanks for the tip, I thought `::` notation required a class on the left, like `Integer::compare`. TIL!

@fergusq So, somewhere between `oe` and `ue`?

@fergusq That's hardly an `oe` at all, unless you lot pronounce `oe` differently from English.

5:25 PM
@KritixiLithos Kan du förstå svenska text? Jag kan förstå skriftlig norska och danska ganska väl (tycker jag). De är så likadana språk.

That's Swedish?

BTW if TIO had an api, everyone would use that on the interpreter challenge

@MatthewRoh Standard Loophole, and it does have an API

@fergusq Jeg kan forstår meste af de første 2 sætninger men ikke den sidste en. (btw My Danish is not so good)

@ГригорийПерельман it does?

5:27 PM

@KritixiLithos How well do you speak Danish? Are you fluent?

@MatthewRoh I'm not sure. In German OE is the same as Ö (very similar to the sound in Swedish), but I don't know how English people pronounce it.

I want to move to Sweden, progress learning Swedish has been... not great.

English is not my mother's tongue but 9 years of learning english is pretty much near-native

@KritixiLithos The last sentence means "They are so similar languages."

5:29 PM
anyone familiar with `java.security` or `java.policy` files

@fergusq It should be somewhere between like 'oe', 'ue', and 'uh'

@DJMcMayhem Not fluent. In my old school, I was in intermediate level Danish, but now in this school there are no compulsory Danish lessons and so my Danish has become rusty again. And I can understand well more than I can speak.

@MatthewRoh What is your native tongue? (Out of curiosity)

@Poke All I know is that Java OpenJDK, Oracle SE, and Oracle EE have wildly different implementations of those, so be careful.

@MatthewRoh Röda is pronounced like here: en.wiktionary.org/wiki/röd
Just append A to the end.

5:30 PM
@DJMcMayhem I bet it's C++ :P

@fergusq What does the language name mean?

@fergusq Ah, I can see the resemblance

@KritixiLithos I'm not sure if that should be pitied or envied...

@ГригорийПерельман "Red" in its definite form.

@DJMcMayhem Korean.

5:32 PM
Is there a short way to absolute value in befunge?

To convert it to Danish, you drop the `a` and transform the `ö` to `ø`

btw I found something cool about SE
go to stackexchange.com/questions?tab=realtime and see questions pop out

@KritixiLithos Isn't it "røde"?

Should I read it as "rude"?

Afaik you add the e at the end if you are using red to describe a plural word, but then again I'm not a native speaker so I'm not entirely sure.
@JanDvorak The "d" is soft, it sounds more like an "l"

5:36 PM
@JanDvorak I think its more like "rued"
but its not that different
@KritixiLithos So... Röda => Röia => Rueia => Lua?
xd

@KritixiLithos At least Wiktionary calls it the "definite" form like in Swedish. Can you say "Den røde bogen" (The red book) in Danish?

Yes, I think. `rød` doesn't sound right in this case

Am I the only one who thinks of pi when you see Ø

5:52 PM
I think I got second?? This is the first time I've really came close to winning

@MistahFiggins Why not just `.@` instead of `k@.`?
@KritixiLithos reading characters as char codes or reading integers is the same byte count in Befunge

...Yeah.

Can't you remove the `!` and have `1` for allies and `0` for enemies?

I assume that he's getting both 1 and 2 for allies

6:10 PM
^ just surreal (source)

the house next door looks fine, though

I just noticed something weird about capslock on my keyboard

that it's not remapped to Ctrl?

Something else
So I use QWERTZ
and to the right of 0 there is a key for ß
Shift + ß is ?

0

This challenge is to code golf a program that proves that the next number in a pattern is 42 based on the website Actually it's 42. In your program, the user inputs a pattern of numbers and it has to output the equation that proves that the next number is 42. For example, the user inputs the pa...

6:20 PM
but if I activate capslock, that key doesn't give me a question mark
instead, I get the unnecessary capital ẞ
and shift + ß gives me ? still

> In other cases the key may only affect letters, so that the "5" key always generates "5" unless the shift key is pressed.
Caps Lock is a button on a computer keyboard that, when pressed, causes all letters to be generated in capitals until deactivated. It is located in the position of a similar Shift lock key (and sometimes a Ctrl key) found in some other keyboard layouts. It is usually a toggle key: each press reverses its action. Exactly what Caps Lock does depends on the operating system and driver, and the keyboard layout implemented. On non-IBM PC-compatible computers it may also depend on the keyboard hardware. Usually the effect is the same as pressing keys with the shift key depressed; letters are capitalised...

@ivzem Apparently, according to the bot, Shift + ß is 42.

I mapped my caps lock to ctrl and life's much better. You should try the same

@MartinEnder Yes, but it does affect the key. ßẞßẞßẞßẞ

It bugs me when I find a golf within five minutes of posting an answer, so I edit it but it doesn't get added to the revision history

6:23 PM
oh cool you get the capital sz

That means that ß has five different characters, ß\ẞ?¿

Is `¿` standard? I was under the impression that QWERTZ doesn't make use of Alt Gr+Shift+...
Can't test right now though

Mine does, e.g Alt Gr + Shift + Q is Ω
nope, I retract that statement

Hm, interesting. A few years ago I customised my QWERTZ and put tons of Greek letters and maths symbols on Alt Gr and Alt Gr+Shift and I don't remember any of them already being there.

ÆẞÐªŊĦŁ æſðđŋħł wait on the second line it does
third line too... what?

6:34 PM
that's one crazy QWERTZ layout :D ... what OS are you on?

Xubuntu

maybe that's why

I'm not complaining
Not that I need them

Oh man this challenge is a sucker for Cinnamon Gum. Not sure why I didn't see it before.

6:36 PM
he

Gah, this computer doesn't have Zopfli

@MartinEnder why does it have mu

I have no clue
maybe because it's the only one that is required to write all SI prefixes
(I think?)

yeah all latin except micro
oh altgr+m is mu in trq too

@WheatWizard CMC: What's the shortest way to push `(2, 11)` to the stack? The obvious approach is 22 bytes, but abusing the `[]` nilad, I can get it down to twenty in two different ways: `(((()())())({}[]){})` and `(((()()))[][][](){})`. Is there an 18 byter?
Of course, the CMC is open to anyone who knows enough bflak and is interested :)
TIL it's really fun to golf sequences in bflak, especially cause of how many approaches there are

6:43 PM
I'm predicting at least one more game-changing arithmetic solution for the MtG challenge.

6:55 PM
I just made a 12 byte golf, I'm really happy with this new approach

Every mathematical approach I've tried has resulted in longer PowerShell than just `.indexof()`

7:07 PM
@PhiNotPi 111 is the next number
@MartinEnder For n = 5 [(0, 0, 0, 0, 0), (0, 0, 0, 0, 1), (0, 0, 0, 1, 0), (0, 0, 0, 1, 1), (0, 0, 1, 0, 0), (0, 0, 1, 0, 1), (0, 0, 1, 1, 0), (0, 0, 1, 1, 1), (0, 1, 0, 0, 0), (0, 1, 0, 0, 1), (0, 1, 0, 1, 0), (0, 1, 1, 0, 0), (0, 1, 1, 1, 0), (0, 1, 1, 1, 1), (1, 0, 0, 0, 0), (1, 0, 0, 0, 1), (1, 0, 0, 1, 0), (1, 0, 1, 0, 0), (1, 0, 1, 0, 1), (1, 1, 0, 0, 0), (1, 1, 1, 0, 0), (1, 1, 1, 1, 0), (1, 1, 1, 1, 1)]
for n= 6 it is [(0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 1), (0, 0, 0, 0, 1, 0), (0, 0, 0, 0, 1, 1), (0, 0, 0, 1, 0, 0), (0, 0, 0, 1, 0, 1), (0, 0, 0, 1, 1, 0), (0, 0, 0, 1, 1, 1), (0, 0, 1, 0, 0, 0), (0, 0, 1, 0, 0, 1), (0, 0, 1, 0, 1, 0), (0, 0, 1, 1, 0, 0), (0, 0, 1, 1, 1, 0), (0, 0, 1, 1, 1, 1), (0, 1, 0, 0, 0, 0), (0, 1, 0, 0, 0, 1), (0, 1, 0, 0, 1, 0), (0, 1, 0, 1, 0, 0), (0, 1, 0, 1, 0, 1), (0, 1, 1, 0, 0, 0), (0, 1, 1, 1, 0, 0), (0, 1, 1, 1, 1, 0),
(0, 1, 1, 1, 1, 1), (1, 0, 0, 0, 0, 0), (1, 0, 0, 0, 0, 1), (1, 0, 0, 0, 1, 0), (1, 0, 0, 1, 0, 0), (1, 0, 1, 0, 0, 0), (1, 0, 1, 0, 1, 0), (1, 1, 0, 0, 0, 0), (1, 1, 1, 0, 0, 0), (1, 1, 1, 1, 0, 0), (1, 1, 1, 1, 1, 0), (1, 1, 1, 1, 1, 1)]

@fergusq I wanted to try out the http_server bilar package, so I did. I ran the sample http_server program in the README.md, and I got an error saying that the file could not be loaded. So I provided the full path to http_server.röd. But afterwards, I get another error stating that `[UnknownNameError] variable not found: exportType`. Do I need to get another package to get this working?

It has to be loaded with `require`. What is the exact first error you get?

That is the first error I get. Wait, so something like `{require "full/path/to/http_server.röd"}`?

It has to be `http := require("http_server")`. Does that give you errors?

7:23 PM
@MartinEnder I feel this might have a closed form solution after all
@MartinEnder not that I know what that is

Now I get `[TypeMismatchError] can't execute a value of type string\ncalling http_server with no arguments`

What stack trace? What is the exact code you use?

```{
http:=require "http_server";
}

main {
import "http_server.röd"
server := http_server(8080)
server.controllers["/"] = controller({ |request|
})
while true; do
server.update
done
}```

You must use parentheses: `http := require("http_server")`
Now it interprets that like `http := require; "http_server"();`
And take that `import` statement away.
The `master` branch contains an outdated version of the http_server-program that uses the `http_server.röd` in the examples-folder, not the bilar version. (Because Bilar was introduced in version 0.12)

Ah, I see
I think it works now, how do I connect to it?

7:29 PM
Go to `localhost:8080` in your web browser.

Thanks, it works! \o/

Btw how can I use a multiline code block in chat?

```Type your code block
Using Shift+Enter for newlines
And then press Ctrl+k to format text as code```

Thanks!

@Lembik thanks I'll have a look

7:40 PM
Hi, hi. I’m noticing a very funny pattern among novice code golfers that I’m slowly being convinced should be written down as a tip somewhere.

what is that?
@Lembik those confirm my hypothesis

Someone wrote this:

`l:m9 5Z]:%!`

and I saved one byte just doing this:

`l:m9%5%3%!`

but this isn’t a very egregious example.
Oh jeez, I’ve forgotten how to do monospace on here.

ctrl+K

But this reminded me of a far funnier time when the leading answer to print nibbles 0–10 in C was

m=11,n,o;f(){for(;m--;)for(n=m,o=5;o--;n*=2)putchar(o?n&8?49:48:9);}

and I outgolfed it with:

f(){puts("0000 0001 0010 0011 0100 0101 0110 0111 1001 1010");}

and yeah I saw that... I'm not sure that's limited to novice golfers though... I still sometimes try to be too clever :P

7:43 PM
This is hilarious: arxiv.org/pdf/1703.02528.pdf

Backticks work, but chat refuses most markup when you have newlines in the message

Here’s another great example (see comment).
But then there’s another comment that confuses me: kind of takes the fun out of it, doesn't it?

@quartata let me guess, you were reading the academia.SE post about joke papers on the arXiv? ;)

@Lynn isn't your 0-10 missing 8

@MartinEnder Of course
But I figured just linking to the PDF would let people skip a couple seconds of link clicking and get to the part that matters

7:45 PM
Ideally challenges would be written in a way that hardcoding the result isn't the best way

@fəˈnɛtɪk Oh wow, it is

there's always a chance that it will be the best way in some languages. that doesn't make it a bad challenge.

> We warm-start the network with toy data taken from the latest Lego catalog to nurture the right kind of learning environment
lost it
woops
This feels like it's from an XKCD almost

@Lembik @PhiNotPi `2, 4, 8, 14, 23, 34, 49, 66, 87, 111, 139, 169, 205, 243, 285, 331, 382, 435, 494, 555`
`f(N) = 2f(N-1) - f(N-2) + σ_0(N-1)`
where `σ_0` is a beat-up disapproval face, or the divisor count, your choice
now I just need to actually prove it...