You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wouldn't quite call my answer recent, but this could be a nice change.
However, I'd recommend keeping the old behavior on one of the two permutations (preferably * <num> <seq>, so that we can hack a check for floats with .x*TG (where we're checking T for floatiness, and G is the current global value of "abc...yz".)
I think we shouldn't go with rounding, because it can be rather confusing. Honestly, I think it should floor the argument. Regarding float check, it's not too hard to do it without a dedicated command (!sI). I think this functionality can be extended to:
Indexing (@).
Get first N (<)
Remove first N (>)
Cyclic rotations (.< and .>)
And perhaps even more. Another version for @ would be to return the elements at indices floor(argument) and ceil(argument), similar to how Jelly does it. What do you think?
An answer to a recent challenge had to floor a float in order to multiply by a string. If a floor is not explicitly provided, Pyth simply errors out.
There are two directions that this can go:
round/floor before multiplying:
*c5 2"ab"
->abab
append that fraction (rounded/floored) of the string/list:
*c5 2"ab"
->ababa
I don't know which way would be better, but either way shouldn't cause any regressions.
The text was updated successfully, but these errors were encountered: