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
The original implementation (the mirror in https://gitlab.com/nuald-grp/bf-2) has the range check and properly handles the out of bound access. Some of the existing tests don't have it, thus may have the unfair advantage because of it.
The text was updated successfully, but these errors were encountered:
* Update the Rust's brainfuck implementation
More idiomatic code, and formatting with `rustfmt`. The most important change was in the `Tape` impl:
* `mov()` reallocs only once per call;
* `get()` and `inc()` uses unchecked indexing because the check is already done in `mov()`
* Pass String as reference
* Use more specific enum variants
Because of the strong typing, the `mov()` was doing many lossy
casts which the C and C++ versions don't; the D version uses
specific variants too.
Besides, the value was always -1 or 1, so it is more idiomatic
this way.
The original implementation (the mirror in https://gitlab.com/nuald-grp/bf-2) has the range check and properly handles the out of bound access. Some of the existing tests don't have it, thus may have the unfair advantage because of it.
The text was updated successfully, but these errors were encountered: