isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

`>` and `<` broken? #182

Closed jakobkogler closed 8 years ago

jakobkogler commented 8 years ago

I'm speaking of the case > number string and < number string.

It works as expected, if the length of the string is bigger than the number. E.g. >3G gives xyz, the last 3 chars. But whenever this is not the case, than weird effects are happening. E.g. >4"xyz gives z. The last four chars of "xyz" are "z".

The reason is, that the implementation of >AB translates to B[len(B)-A:], so in the example case "xyz"[-1:]. Everything up from the last element.

I guess we should fix this. It bugged me today (could have saved the two reverse operations), and I think it bugged me previously (few months before).

isaacg1 commented 8 years ago

Fixed.