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
@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
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
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)
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.