@@ -101,7 +101,7 @@ impl<'a, T> Iterator<&'a T> for ListIterator<'a, T> {
101
101
// every possible transformations (the 6 rotations with their
102
102
// corresponding mirrored piece), with, as minimum coordinates, (0,
103
103
// 0). If all is false, only generate half of the possibilities (used
104
- // to break the symetry of the board).
104
+ // to break the symmetry of the board).
105
105
fn transform ( piece : Vec < ( int , int ) > , all : bool ) -> Vec < Vec < ( int , int ) > > {
106
106
let mut res: Vec < Vec < ( int , int ) > > =
107
107
// rotations
@@ -124,9 +124,9 @@ fn transform(piece: Vec<(int, int)> , all: bool) -> Vec<Vec<(int, int)>> {
124
124
res
125
125
}
126
126
127
- // A mask is a piece somewere on the board. It is represented as a
127
+ // A mask is a piece somewhere on the board. It is represented as a
128
128
// u64: for i in the first 50 bits, m[i] = 1 if the cell at (i/5, i%5)
129
- // is occuped . m[50 + id] = 1 if the identifier of the piece is id.
129
+ // is occupied . m[50 + id] = 1 if the identifier of the piece is id.
130
130
131
131
// Takes a piece with minimum coordinate (0, 0) (as generated by
132
132
// transform). Returns the corresponding mask if p translated by (dy,
@@ -159,7 +159,7 @@ fn make_masks() -> Vec<Vec<Vec<u64> > > {
159
159
vec!( ( 0 i, 0 i) , ( 0 , 1 ) , ( 0 , 2 ) , ( 1 , 2 ) , ( 1 , 3 ) ) ,
160
160
vec!( ( 0 i, 0 i) , ( 0 , 1 ) , ( 0 , 2 ) , ( 0 , 3 ) , ( 1 , 2 ) ) ) ;
161
161
162
- // To break the central symetry of the problem, every
162
+ // To break the central symmetry of the problem, every
163
163
// transformation must be taken except for one piece (piece 3
164
164
// here).
165
165
let transforms: Vec < Vec < Vec < ( int , int ) > > > =
@@ -263,7 +263,7 @@ impl Data {
263
263
// Records a new found solution. Returns false if the search must be
264
264
// stopped.
265
265
fn handle_sol ( raw_sol : & List < u64 > , data : & mut Data ) {
266
- // because we break the symetry , 2 solutions correspond to a call
266
+ // because we break the symmetry , 2 solutions correspond to a call
267
267
// to this method: the normal solution, and the same solution in
268
268
// reverse order, i.e. the board rotated by half a turn.
269
269
data. nb += 2 ;
@@ -298,7 +298,7 @@ fn search(
298
298
for id in range ( 0 u, 10 ) . filter ( |id| board & ( 1 << ( id + 50 ) ) == 0 ) {
299
299
// for each mask that fits on the board
300
300
for m in masks_at. get ( id) . iter ( ) . filter ( |& m| board & * m == 0 ) {
301
- // This check is too costy .
301
+ // This check is too costly .
302
302
//if is_board_unfeasible(board | m, masks) {continue;}
303
303
search ( masks, board | * m, i + 1 , Cons ( * m, & cur) , data) ;
304
304
}
0 commit comments