1- use crate :: solution :: SolutionMultiset ;
1+ use crate :: board :: Idx ;
22use crate :: dir:: Dir ;
33use crate :: par;
4- use crate :: board :: Idx ;
4+ use crate :: solution :: SolutionMultiset ;
55use crate :: { Board , Move } ;
66use crate :: { HashMap , HashSet , Solution } ;
7+ use rustc_hash:: FxHashSet ;
78use std:: collections:: BTreeMap ;
89use std:: num:: NonZero ;
9- use rustc_hash:: FxHashSet ;
1010
1111/// Dense slot for a move, keyed by its starting bit and direction: 64 positions x 4
1212/// directions. Sparse - only 76 of the 256 are reachable - but it makes the occurrence
@@ -248,7 +248,6 @@ impl ZobristTable {
248248 }
249249}
250250
251-
252251/// Upper bound on the moves available from one board.
253252///
254253/// The cross holds 38 collinear triples and each can be jumped from either end, so no
@@ -386,7 +385,10 @@ fn successors_of(board: Board, buffer: &mut [Board; MAX_MOVES], kind: PathKind)
386385 let mut len = 0 ;
387386 for dir in Dir :: enumerate ( ) {
388387 for idx in board. mov_pattern_mask ( dir) {
389- debug_assert ! ( len < MAX_MOVES , "more than {MAX_MOVES} moves from one board" ) ;
388+ debug_assert ! (
389+ len < MAX_MOVES ,
390+ "more than {MAX_MOVES} moves from one board"
391+ ) ;
390392 buffer[ len] = Board :: normalize_after_move ( & syms, idx, dir) ;
391393 len += 1 ;
392394 }
@@ -412,15 +414,16 @@ fn successors_of(board: Board, buffer: &mut [Board; MAX_MOVES], kind: PathKind)
412414/// The search uses the former for every edge, so they had better agree.
413415#[ test]
414416fn test_move_at_matches_get_legal_moves ( ) {
415- let boards = [
416- Board :: default ( ) ,
417- Board ( Board :: full ( ) . 0 & !Board :: solved ( ) . 0 ) ,
418- Board :: solved ( ) ,
419- ]
420- . into_iter ( )
421- . chain ( ( 0 ..500 ) . map ( |_| {
422- Board :: from_compressed_repr ( rand:: random :: < u64 > ( ) & ( ( 1 << Board :: SLOTS ) - 1 ) )
423- } ) ) ;
417+ let boards =
418+ [
419+ Board :: default ( ) ,
420+ Board ( Board :: full ( ) . 0 & !Board :: solved ( ) . 0 ) ,
421+ Board :: solved ( ) ,
422+ ]
423+ . into_iter ( )
424+ . chain ( ( 0 ..500 ) . map ( |_| {
425+ Board :: from_compressed_repr ( rand:: random :: < u64 > ( ) & ( ( 1 << Board :: SLOTS ) - 1 ) )
426+ } ) ) ;
424427
425428 let mut checked = 0usize ;
426429 for board in boards {
0 commit comments