We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
op pal x = t = '%d' text x; (rot t) *.== t
Is an attempt at palindrome, and it almost works:
pal 1001 1 pal 98 0
I expected:
pal 1001 1002 1 0
But I get
pal 1001 1002 0
The text operator seems to include spaces, so maybe that's part of the problem?
rho "%d" text 1 2 3 5
The text was updated successfully, but these errors were encountered:
This is related to #69, the lack of a way to force an operator on a vector to run an element at a time.
In the meantime, you can write a recursive loop:
op pal x = (rho x) <= 1: (rot t) *.== t = '%d' text x (pal x[1]), pal 1 drop x pal 1 1 pal 234 0 pal 202 1 pal 202 301 1 0
Sorry, something went wrong.
Oh nice!
Oh right @rsc mentions "tail recursion" in #69.
In light of this personal lesson and #69, I'll close.
Thanks
No branches or pull requests
Is an attempt at palindrome, and it almost works:
I expected:
But I get
The text operator seems to include spaces, so maybe that's part of the problem?
The text was updated successfully, but these errors were encountered: