« first day (852 days earlier)      last day (412 days later) » 

05:25
So, I'm trying to compare some strings with Jelly. Basically, read from STDIN, if it equals some text then return 1. Otherwise, keep reading the STDIN until the text is equal to what I want
ɠ⁼“this is some text”¿
This is what I'm trying as of now
tl;dr psuedo code

if STDIN is equal to "this is some text"
then return 1
otherwise
recurse and try again
 
6 hours later…
12:04
@TristanWiley I'm guessing that's not working for you? I can help you get a solution if you like, but I'll move to a different room if so. FWIW, there is also a gallery room for learning Jelly, in case you're interested
If you could I'd really appreciate it! My bad, didn't realize there was a separate room
Actually, we might as well talk here, it's Jelly related and Dennis can move the messages if he decides it necessary.
@TristanWiley I'm guessing that when you run that, it just loops forever?
That's because ¿ takes the two previous atoms as body and condition tokens. ɠ⁼“this is some text” is three tokens: ɠ, and “this is some text”, so it's parsed as “this is some text” being the condition for ¿, and as the body
You need to combine the ⁼“this is some text” into one token. There is two ways we can do this
The easiest is by defining another link, by placing the condition on the line above, and replacing it with Ç like so
(I'll address why it's returning 0 in a second)
@cairdcoinheringaahing actually, this room is more on-topic for such a discussion
12:14
The other way is by using the 'combining' quicks: $ƊƲ, which combine 2, 3 and 4 links, respectively like so
@TristanWiley Following?
Definitely
Now, we need to take a look at why it's returning 0, instead of 1. ¿ loops until it's condition returns false, and as the first line doesn't equal this is some text, the loop breaks, and the return value from ⁼“this is some text” is printed (0)
So we have to use the not atom?
Either the not atom after the ⁼“this is some text”, or the not equal atom, instead of
Oh gotcha
12:19
We've almost finished. If we use one of those two atoms, it returns this is some text, instead of 1
So now we need to replace the return value with 1
This is where the right and left atoms come into play. <x>ṛ<y> will always return y, no matter what x is, so we simply append ṛ1: Try it online!
And now, it returns 1 instead! (Although it does loop forever if this is some text isn't in STDIN)
Perfect! This was for some joke with my class TAs and I figured I'd finally learn what Jelly was. I've always been interested in Code Golf but never had the will to try.
Really appreciate it :)
No problem, good to see someone else getting interested in Jelly
12:37
Out of curiosity, what's the difference in purposes for the two jelly rooms?
This room is more about discussing Jelly, such as feature requests. The other one is more of a learning environment to improve your skills at Jelly
Oh gotcha!
 
1 hour later…
13:50
I was looking through, is there any way to Base64 encode a String?
14:48
@TristanWiley to be exact, the other one has kind of a classroom-like structure, while this one is more general
14:59
Ah, I understandd

« first day (852 days earlier)      last day (412 days later) »