nissy-classic

Stable branch of nissy
git clone https://git.tronto.net/nissy-classic
Download | Log | Files | Refs | README | LICENSE

nissy.1 (7256B)


      1 .Dd November 2021
      2 .Dt NISSY 1
      3 .Os
      4 .Sh NAME
      5 .Nm nissy
      6 .Nd a Rubik's cube solver and FMC assistant
      7 .
      8 .Sh SYNOPSIS
      9 .Nm
     10 .Op Fl b
     11 .Nm
     12 .Ar command
     13 .Op options...
     14 .
     15 .Sh DESCRIPTION
     16 .Nm
     17 is a Rubik's Cube solver. 
     18 It uses techniques from Herbert Kociemba's Cube Explorer and
     19 Tomas Rokicki's nxopt. With 4 cores at 2.5GHz and using about 3Gb
     20 of RAM, Nissy can find the optimal solution for a random Rubik's cube position
     21 in about a minute on average.
     22 Nissy can also solve different substeps of the Thistlethwaite's algorithm and more.
     23 .Pp
     24 When run without any argument an interactive shell is launched, otherwise
     25 the provided
     26 .Ar command
     27 is executed and nissy terminates. If the option
     28 .Fl b
     29 is given, every argument after it is ignored and the shell is launched without
     30 any prompt or welcome message. This can be used to run nissy in batch mode,
     31 for example writing a list of commands in a
     32 .Ar file
     33 (one per line) and running
     34 .Ar nissy -b < file
     35 .Pp
     36 The commands that can be run in the interactive shell are the same that can
     37 be run non-interactively and are provided below.
     38 .
     39 .Sh COMMANDS
     40 The available
     41 .Ar commands
     42 are the following:
     43 .
     44 .Bl -tag -width Ds
     45 .
     46 .It Nm cleanup Ar scramble
     47 Rewrites the given scramble using only the 18 base (HTM) moves and at most two
     48 rotations at the end. If
     49 Ar scramble
     50 uses NISS, all moves done on normal scramble are written first, followed by
     51 all moves done on inverse.
     52 .
     53 .It Nm commands
     54 List all available commands.
     55 .
     56 .It Nm freemem
     57 Release some large tables from memory. You can use this command in case
     58 you want to keep nissy open without using too much RAM.
     59 .
     60 .It Nm gen Op Fl t Ar N
     61 Generate all tables used by nissy. Run this to complete your installation.
     62 If
     63 .Ar N
     64 is specified,
     65 .Ar N
     66 CPU threads will be used (defaults to 64, use less only if you don't want
     67 nissy to use all of your CPU resources).
     68 .
     69 .It Nm help Op Ar command
     70 Display help. If no
     71 .Ar command
     72 is given, a generic help message is printed, otherwise a specific help
     73 relative to
     74 .Ar command
     75 is returned.
     76 .
     77 .It Nm invert Ar scramble
     78 Invert the given scramble.
     79 .
     80 .It Nm print Ar scramble
     81 Display a text-only description of the cube obtained after applying
     82 .Ar scramble .
     83 .
     84 .It Nm ptable Op Ar table
     85 Display information, such as the table distribution, on a pruning table.
     86 If no
     87 .Ar table
     88 is given, the available pruning tables are listed.
     89 This command is intended for advanced use only.
     90 .
     91 .It Nm quit
     92 Quit nissy.
     93 .
     94 .It Nm scramble Oo Fl n Ar N Oc Oo Ar type Oc
     95 Print a randomly-generated (random position) scramble
     96 .
     97 If
     98 .Ar N
     99 is given, it produces
    100 .Ar N
    101 scrambles.
    102 .Ar type
    103 can be specified to be one of the following:
    104 .Bl -tag -width Ds
    105 .It Ar corners
    106 Scramble with solved edges (only cornes are scrambled).
    107 .It Ar dr
    108 Scramble with solved DR on U/D.
    109 .It Ar edges
    110 Scramble with solved corners (only edges are scrambled).
    111 .It Ar eo
    112 Scramble with solved EO on F/B axis.
    113 .It Ar fmc
    114 Scramble the full cube and the resulting scramble starts and ends with
    115 the moves R\(aq U\(aq F.
    116 .It Ar htr
    117 Scramble with HTR solved.
    118 .El
    119 .
    120 .It Nm solve Ar step Oo Ar options Oc Ar scramble
    121 Solve the given
    122 .Ar step
    123 on the given
    124 .Ar scramble.
    125 By default it finds only one (shortest) solution, without using niss, and it
    126 displays the number of moves at the end of the line.
    127 .
    128 The options for the
    129 .Ar solve
    130 command are the following:
    131 .
    132 .Bl -tag -width Ds
    133 .
    134 .It Fl a
    135 Print all solutions: some solutions are filtered out by default for some
    136 steps, for examples EOs that finish with F\(aq, with this options they are not.
    137 .
    138 .It Fl c
    139 Display only the number of solutions found, not the solutions themselves.
    140 .It Fl L
    141 Look for solutions on both normal and inverse scramble, without NISS (linear).
    142 .
    143 .It Fl m Ar min
    144 Only look for solution that are at least
    145 .Ar min
    146 moves long.
    147 .
    148 .It Fl M Ar MAX
    149 Only look for solution that are at most
    150 .Ar MAX
    151 moves long.
    152 .
    153 .It Fl n Ar N
    154 Try to find
    155 .Ar N
    156 solutions. By default and unless the
    157 .Fl M
    158 or
    159 .Fl o
    160 options are used, at most one solution is returned. 
    161 If at least one of
    162 .Fl M
    163 and
    164 .Fl o
    165 is used, all the solutions found within the given bounds are returned.
    166 The option
    167 .Fl s
    168 overwrites these default behaviors and at most
    169 .Ar N
    170 solutions are returned, still satisfiyng the other constraints.
    171 .
    172 .It Fl N
    173 Allow use of NISS.
    174 .
    175 .It Fl o
    176 Only find solutions that require the minimum number of moves.
    177 .
    178 .It Fl O Ar N
    179 Only find solutions that require at most
    180 .Ar N
    181 moves more than the optimal solution. If
    182 .Ar N
    183 is 0, this is equivalent to
    184 .Fl o
    185 .
    186 .It Fl p
    187 Plain style: do not print the number of moves.
    188 .
    189 .It Fl t Ar N
    190 Use
    191 .Ar N
    192 CPU threads. By default nissy uses only 1 thread. Using more than one
    193 thread will improve performance, but the optimal number depends on your
    194 machine and operating system. Generally, using one less than the number
    195 of threads of your CPU works quite well.
    196 .
    197 .It Fl v
    198 Verbose mode: print some information during the search and print each solution
    199 as it is found instead of only printing them all together at the end.
    200 .
    201 .
    202 .El
    203 .
    204 .It Nm steps
    205 List all available
    206 .Ar steps
    207 for the
    208 .Ar solve
    209 command.
    210 .
    211 .It Nm twophase Ar scramble
    212 Find a solution using a two-phase method. This does not guarantee
    213 to return an optimal solution (and in fact most often it does not),
    214 but it is very fast.
    215 .
    216 .It Nm unniss Ar scramble
    217 Rewrite the scramble without using NISS.
    218 .
    219 .It Nm version
    220 Display version information.
    221 .
    222 .El
    223 .
    224 .Sh SCRAMBLES
    225 All the commands above that accept a scramble also accept a
    226 .Fl Nm i
    227 option with no arguments.
    228 If this option is given, multiple scrambles are read from standard
    229 input (one per line) until and EOF is found, at which point stdin is cleared.
    230 .
    231 .Sh ENVIRONMENT
    232 Data is stored in the folder pointed to by
    233 .Nm $NISSYDATA.
    234 If that variable is unset the folder
    235 .Nm $XDG_DATA_HOME/nissy
    236 or
    237 .Nm $HOME/.nissy
    238 is used instead. If none of this environment variables is defined
    239 (e.g. in a non-UNIX system), the current folder is used.
    240 .
    241 .Sh EXAMPLES
    242 .Pp
    243 The command:
    244 .Dl nissy solve -v -O 1 \(dqR\(aqU\(aqFD2L2FR2U2R2BD2LB2D\(aqB2L\(aqR\(aqBD2BU2LU2R\(aqU\(aqF\(dq
    245 Returns:
    246 .Dl Searching depth 0
    247 .Dl Searching depth 1
    248 .Dl (some more lines)
    249 .Dl Searching depth 16
    250 .Dl D2 F\(aq U2 D2 F\(aq L2 D R2 D F B2 R\(aq L2 F\(aq U\(aq D
    251 .Dl Searching depth 17
    252 .Dl D2 F\(aq U2 D2 F\(aq L2 D R2 D F B2 R\(aq L2 F\(aq U\(aq D (16)
    253 Notice that the solution is printed twice: the first time it is printed as soon
    254 as it is found as requested by the -v option.
    255 .Pp
    256 The command:
    257 .Dl nissy solve eofb -m 4 -M 5 -N -n 6 \(dqR\(aqU\(aqFD2L2 FR2 U2R2BD2 L B2 D\(aq B2 L\(aq R\(aq\(dq
    258 Returns:
    259 .Dl U B U\(aq B (4)
    260 .Dl U (B R\(aq B) (4)
    261 .Dl (U B R\(aq B) (4)
    262 .Dl U2 F R2 F (4)
    263 .Dl U2 B U2 B (4)
    264 .Dl (U2 B R\(aq B) (4)
    265 .Pp
    266 On a UNIX shell, the composite command
    267 .Dl nissy scramble -n 2 | nissy solve -i > file.txt
    268 Generates two random scrambles, solves them and saves the result to file.txt.
    269 The file will look something like this:
    270 .Dl >>> Line: D U2 F D B\(aq F L2 D\(aq F2 R2 L B2 L\(aq U2 B2 R F2 L\(aq D2
    271 .Dl U2 R2 F2 L B2 D\(aq R2 D\(aq F U L2 B\(aq U\(aq R2 D2 R2 U (17)
    272 .Dl >>> Line: D B R U\(aq B\(aq L2 U L U D2 R L B2 U2 L2 U2 R U2 B2 L F2
    273 .Dl D\(aq F R\(aq D B L2 B R2 L U L U2 B D\(aq U R U F2 (18)
    274 .
    275 .Sh AUTHORS
    276 .An Sebastiano Tronto Aq Mt sebastiano@tronto.net
    277 .
    278 .Sh SOURCE CODE
    279 Source code is available at
    280 .Lk https://nissy.tronto.net