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
let first:i8 = rng.gen_range(0, board_size - ship_length + 1);
first is chosen to be in [0, board_size - ship_length] ignoring orientation -- later we appear to be doing rejection sampling in L101-L104 based on orientation. however, at L111 when orientation is false (horizontal, if first coordinate is row and second coordinate is column) we use (first, second + tile), which means that we will never see a randomly placed ship in the last ship_length rows in an horizontal orientation.
not a framework security bug.
The text was updated successfully, but these errors were encountered:
battleship-demo/core/game/src/lib.rs
Line 99 in 3b44b0e
first
is chosen to be in[0, board_size - ship_length]
ignoringorientation
-- later we appear to be doing rejection sampling in L101-L104 based on orientation. however, at L111 whenorientation
is false (horizontal, if first coordinate is row and second coordinate is column) we use(first, second + tile)
, which means that we will never see a randomly placed ship in the lastship_length
rows in an horizontal orientation.not a framework security bug.
The text was updated successfully, but these errors were encountered: