This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| salt_pattern='0-9a-zA-Z./' | |
| randompwd() { LC_CTYPE=C tr -dc ${2:-'A-Za-z0-9_!@%^&*/-+=.?'} < /dev/urandom | head -c ${1:-16} | xargs; } | |
| rand_salt() { | |
| randompwd 16 "salt_pattern" | |
| } | |
| round= | |
| salt=/SSSSSS/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def from(initial: Stream[(Block, List[Move])], | |
| explored: Set[Block]): Stream[(Block, List[Move])] = initial.headOption.map { | |
| case (block, _) if done(block) => initial.head #:: from(initial.tail, explored) | |
| case (block, history) => | |
| val newMoreBlocks = newNeighborsOnly(neighborsWithHistory(block, history), explored) | |
| val newExploredBlocks = Set(block.left, block.down, block.right, block.up).filter(_.isLegal).filterNot(done) | |
| (block, history) #:: from(initial.tail ++ newMoreBlocks, explored | newExploredBlocks) | |
| }.getOrElse(Stream()) |