last day (19 days later) » 

15:24
18
A: It's Hip to be Square

OkxNeim, 2 bytes q𝕚 Explanation: q Push an infinite list of squares 𝕚 Is the input in that list? When I say 'infinite' I mean up until we hit the maximum value of longs (2^63-1). However, Neim is (slowly) transitioning to theoretically infinitely large BigIntegers. Try it!

Do you know what kind of algorithm it's using behind the scenes (including if its N, log(N), N*log(N), etc.)? When I run it in your TIO-link it states it only takes about 255-265 ms. Quite fast for something with a list of ALL squares up until 64 bits, AND checking if the input is part of it, imho. Then again, I'm used to Java, which isn't exactly known for its fast algorithms. :)
@KevinCruijssen Umm, Neim is actually written in Java.
@EriktheOutgolfer Really?.. Not in JVM but Java itself? Hmm.. I almost want to delete my comment and ask only the first part again: "Do you know what kind of algorithm it's using behind the scenes (including if its N, log(N), Nlog(N), etc.)? When I run it in your TIO-link it states it only takes about 255-265 ms. Quite fast for something with a list of ALL squares up until 64 bits, AND checking if the input is part of it, imho.*" :)
This might be the shortest answer, but probably the one that requires the most space
@TheDarkKnight I think mine uses more
Okx
Okx
15:24
@KevinCruijssen It runs very fast because the webserver itself is made using Java. Additionally, it doesn't calculate the full list, but only as much of it as needed. A program with q on its own will time out.
@Okx Ah ok, that indeed makes a lot more sense. Some kind of lazy-loading principle. Still pretty cool that there is a one-byte command for getting all squares.
Okx
Okx
@KevinCruijssen Behind the scenes, q is a shortcut for 4p, which means generate an infinite list of polygonal numbers with side length 4 which happen to be the square numbers.
@Okx I understand. It's usually that way with one-byte shortcuts for golfing. That single byte translates to a few more bytes, which in turn translates to the actual compiler-code. But it's still cool q is a single-byte command for it. I doubt even some of the other golfing languages like Jelly, 05AB1E, Pyth, CJam, Japt, etc. have a single-byte command to accomplish the same. Although they've got others in return that Neim has not. Ah well, now we are kinda having a chat.. TL;DR: +1, right tool for the right job. :)
@KevinCruijssen: "I doubt even some of the other golfing languages like Jelly, 05AB1E, Pyth, CJam, Japt, etc. have a single-byte command to accomplish the same" Unfortunately.... codegolf.stackexchange.com/a/125239/7017 ^^ (and I'm sure others in your list are there too)
Okx
Okx
@OlivierDulac By the same, he means 'push an infinite list of square numbers'.
15:24
lol, doesn't it feel like cheating to use languages just wrap more complex code? Don't get me wrong, it's neat - but it just feels like all of the PPCG answers now are "I used this language that has this already built in, therefore my answer is two characters long", but the "language" is just a wrapper of shortcuts that call very complex java code.
Okx
Okx
@RobertPetz Well, not really. First, you have to create the language, which takes a bit of effort. And, everyone else is doing it, how else do you expect me to win? :P
@Okx haha - to the language author it is definitely effort to make the language. But in reality the answer's length in bytes should be the length in bytes of the Java code it's referencing. I do agree though, it's pretty much spread through the entirety of here now so it's impossible to win without these code golfing languages haha. This comes to mind lol
Okx
Okx
@RobertPetz This is getting a bit chatty. If you want to continue, we can do so in a chat room.
@RobertPetz Almost all golfing languages are wrappers of other languages. What I like about most of these golfing languages like Jelly and 05AB1E is that they don't compete some challenges in low byte-count, but all of them. The designers of these languages really put some thought into them about which functionality to reduce to single-bytes (keep in mind there are only 256 single-bytes available). And with some challenges it's also the art of finding the perfect programming language for the challenge (from a list of existing programming languages).
@KevinCruijssen oh I definitely am not saying that they are illegitimate languages in their own right, and they definitely offer some seriously clever perspectives to certain problems. But once you get to a two byte answer where one byte just calls a Java method that has been pre-written in a way that basically answers the whole question then it's not clever. That's not golfing, that's just hitting the ball once and then asking someone else to put it in the hole for you when no one else is looking - sure you can technically put one stroke on your card, but did you really play the game?
but agreed about the length of this chat - too long for comments haha
Okx
Okx
15:24
@RobertPetz If you wish to continue, chat.stackexchange.com/rooms/60200/…
Once the BigInteger switch happens, will this still work?
Okx
Okx
@user2357112 Probably, and you'll be able to check higher numbers.
 
2 hours later…
17:20
This answer is like a slap on the face
Okx
Okx
Why?
"Oh boy, I cant wait to try my hand on this.."

Someone has already posted a -4 byte answer.
Okx
Okx
Well, it's a competition between languages
like, a different competition for each language
I know I am wrong but it seems a little bullshit that some god forsaken language from the deepest pits of programming magically has a one lettered function that does exactly what the OP asked.
Okx
Okx
and everyone seems to be talking about my answer because it's the highest vote on a hot network question ^_^
17:32
may i see it?
Okx
Okx
19
A: It's Hip to be Square

OkxNeim, 2 bytes q𝕚 Explanation: q Push an infinite list of squares 𝕚 Is the input in that list? When I say 'infinite' I mean up until we hit the maximum value of longs (2^63-1). However, Neim is (slowly) transitioning to theoretically infinitely large BigIntegers. Try it!

"Push an infinite list of squares"

Totally rage inducing
Okx
Okx
xD
lol
on that note. what's stopping me for creating a language which just conveniently has a function which does what op asked? and then submitting the answer.
Okx
Okx
it'll be non-competing and won't be able to win
17:36
but it IS a language
wait wait
P*

P = Push an infinite list of prime numbers
* = check if the input is in the list
Okx
Okx
hm?

  last day (19 days later) »