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 also added Array#swap(index0, index1) that should be faster if you care about performance (if that's your bottleneck). This only does two bounds check. The other way:
./bin/crystal -e 'a = [1,2]; a[0], a[1] = a[1], a[0]; p a'
Syntax error in -:1: Impossible
./bin/crystal -e 'a = [1,2]; t = a[1]; a[1] = a[0]; a[0] = t; p a'
[2, 1]
The text was updated successfully, but these errors were encountered: