|
| 1 | +/* This file is part of "Algorithm Master" |
| 2 | + |
| 3 | + Copyright (C) 2018 Germán Ramos Rodríguez |
| 4 | +
|
| 5 | + This program is free software: you can redistribute it and/or modify |
| 6 | + it under the terms of the GNU General Public License as published by |
| 7 | + the Free Software Foundation, either version 3 of the License, or |
| 8 | + (at your option) any later version. |
| 9 | +
|
| 10 | + This program is distributed in the hope that it will be useful, |
| 11 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + GNU General Public License for more details. |
| 14 | +
|
| 15 | + You should have received a copy of the GNU General Public License |
| 16 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | +
|
| 18 | + Germán Ramos Rodríguez |
| 19 | + Vigo, Spain |
| 20 | + grvigo@hotmail.com |
| 21 | +*/ |
| 22 | + |
| 23 | +namespace Algorithm_Master |
| 24 | +{ |
| 25 | + /// <summary> |
| 26 | + /// Enum with all possible steps |
| 27 | + /// </summary> |
| 28 | + public enum Steps |
| 29 | + { |
| 30 | + NONE = 0, |
| 31 | + |
| 32 | + // Single layer |
| 33 | + U = 1, Up = 2, U2 = 3, U2p = 4, |
| 34 | + D = 5, Dp = 6, D2 = 7, D2p = 8, |
| 35 | + F = 9, Fp = 10, F2 = 11, F2p = 12, |
| 36 | + B = 13, Bp = 14, B2 = 15, B2p = 16, |
| 37 | + R = 17, Rp = 18, R2 = 19, R2p = 20, |
| 38 | + L = 21, Lp = 22, L2 = 23, L2p = 24, |
| 39 | + |
| 40 | + // Double layer, adjacent layers, same direction |
| 41 | + Uw = 25, Uwp = 26, Uw2 = 27, Uw2p = 28, |
| 42 | + Dw = 29, Dwp = 30, Dw2 = 31, Dw2p = 32, |
| 43 | + Fw = 33, Fwp = 34, Fw2 = 35, Fw2p = 36, |
| 44 | + Bw = 37, Bwp = 38, Bw2 = 39, Bw2p = 40, |
| 45 | + Rw = 41, Rwp = 42, Rw2 = 43, Rw2p = 44, |
| 46 | + Lw = 45, Lwp = 46, Lw2 = 47, Lw2p = 48, |
| 47 | + |
| 48 | + // Double layer, adjacent layers, opposite direction |
| 49 | + Uo = 49, Uop = 50, Uo2 = 51, Uo2p = 52, |
| 50 | + Do = 53, Dop = 54, Do2 = 55, Do2p = 56, |
| 51 | + Fo = 57, Fop = 58, Fo2 = 59, Fo2p = 60, |
| 52 | + Bo = 61, Bop = 62, Bo2 = 63, Bo2p = 64, |
| 53 | + Ro = 65, Rop = 66, Ro2 = 67, Ro2p = 68, |
| 54 | + Lo = 69, Lop = 70, Lo2 = 71, Lo2p = 72, |
| 55 | + |
| 56 | + // Double layer, opposite layers, same direction |
| 57 | + Us = 73, Usp = 74, Us2 = 75, Us2p = 76, |
| 58 | + Ds = 77, Dsp = 78, Ds2 = 79, Ds2p = 80, |
| 59 | + Fs = 81, Fsp = 82, Fs2 = 83, Fs2p = 84, |
| 60 | + Bs = 85, Bsp = 86, Bs2 = 87, Bs2p = 88, |
| 61 | + Rs = 89, Rsp = 90, Rs2 = 91, Rs2p = 92, |
| 62 | + Ls = 93, Lsp = 94, Ls2 = 95, Ls2p = 96, |
| 63 | + |
| 64 | + // Double layer, opposite layers, opposite direction |
| 65 | + Ua = 97, Uap = 98, Ua2 = 99, Ua2p = 76, |
| 66 | + Da = 101, Dap = 102, Da2 = 103, Da2p = 104, |
| 67 | + Fa = 105, Fap = 106, Fa2 = 107, Fa2p = 108, |
| 68 | + Ba = 109, Bap = 110, Ba2 = 111, Ba2p = 112, |
| 69 | + Ra = 113, Rap = 114, Ra2 = 115, Ra2p = 116, |
| 70 | + La = 117, Lap = 118, La2 = 119, La2p = 120, |
| 71 | + |
| 72 | + // Middle layers |
| 73 | + E = 121, Ep = 122, E2 = 123, E2p = 124, |
| 74 | + S = 125, Sp = 126, S2 = 127, S2p = 128, |
| 75 | + M = 129, Mp = 130, M2 = 131, M2p = 132, |
| 76 | + |
| 77 | + // Full cube |
| 78 | + x = 133, xp = 134, x2 = 135, x2p = 136, |
| 79 | + y = 137, yp = 138, y2 = 139, y2p = 140, |
| 80 | + z = 141, zp = 142, z2 = 143, z2p = 144, |
| 81 | + |
| 82 | + // Parentheses |
| 83 | + OPEN_PARENTHESIS = 145, // Step is open parenthesis |
| 84 | + CLOSE_PARENTHESIS_1_REP = 146, // Step is close parenthesis |
| 85 | + CLOSE_PARENTHESIS_2_REP = 147, // Step is close parenthesis with two repetitions |
| 86 | + CLOSE_PARENTHESIS_3_REP = 148, // Step is close parenthesis with three repetitions |
| 87 | + CLOSE_PARENTHESIS_4_REP = 149, // Step is close parenthesis with four repetitions |
| 88 | + CLOSE_PARENTHESIS_5_REP = 150, // Step is close parenthesis with five repetitions |
| 89 | + CLOSE_PARENTHESIS_6_REP = 151, // Step is close parenthesis with six repetitions |
| 90 | + CLOSE_PARENTHESIS_7_REP = 152, // Step is close parenthesis with seven repetitions |
| 91 | + CLOSE_PARENTHESIS_8_REP = 153, // Step is close parenthesis with eight repetitions |
| 92 | + CLOSE_PARENTHESIS_9_REP = 154 // Step is close parenthesis with nine repetitions |
| 93 | + } |
| 94 | + |
| 95 | + /// <summary> |
| 96 | + /// Enumeration of 3x3x3 cube layers: up, down, front, back, right, left, equator, standing, middle |
| 97 | + /// </summary> |
| 98 | + public enum Layers : int |
| 99 | + { |
| 100 | + NONE = -1, U = 0, D = 1, F = 2, B = 3, R = 4, L = 5, E = 6, S = 7, M = 8 |
| 101 | + } |
| 102 | + |
| 103 | + /// <summary> |
| 104 | + /// Enumeration of layer movements: none, 90 degrees clock wise rotation, |
| 105 | + /// 180 degrees clock wise rotation, 90 degrees counter clock wise rotation and |
| 106 | + /// 180 degrees counter clock wise rotation |
| 107 | + /// </summary> |
| 108 | + public enum Movements : int |
| 109 | + { |
| 110 | + NONE = 0, ROT90CW = 90, ROT180CW = 180, ROT90CCW = -90, ROT180CCW = -180 |
| 111 | + } |
| 112 | + |
| 113 | + /// <summary> |
| 114 | + /// Enumeration of layer modifiers and parentheses |
| 115 | + /// </summary> |
| 116 | + public enum Modifiers : int |
| 117 | + { |
| 118 | + SINGLE_LAYER = 0, // { U, D, F, B, R, L, E, S, M } |
| 119 | + DOUBLE_ADJACENT_LAYERS_SAME_DIRECTION = 1, // { Uw, Dw, Fw, Bw, Rw, Lw } or { u, d, f, b, r, l } |
| 120 | + DOUBLE_ADJACENT_LAYERS_OPPOSITE_DIRECTION = 2, // { Uo, Do, Fo, Bo, Ro, Lo } VERY UNUSUAL!!! |
| 121 | + DOUBLE_OPPOSITE_LAYERS_SAME_DIRECTION = 3, // { Us, Ds, Fs, Bs, Rs, Ls } |
| 122 | + DOUBLE_OPPOSITE_LAYERS_OPPOSITE_DIRECTION = 4, // { Ua, Da, Fa, Ba, Ra, La } UNUSUAL |
| 123 | + FULL_CUBE = 5, // { x, y, z } |
| 124 | + OPEN_PARENTHESIS = 10, // Step is open parenthesis |
| 125 | + CLOSE_PARENTHESIS_1_REP = 11, // Step is close parenthesis |
| 126 | + CLOSE_PARENTHESIS_2_REP = 12, // Step is close parenthesis with two repetitions |
| 127 | + CLOSE_PARENTHESIS_3_REP = 13, // Step is close parenthesis with three repetitions |
| 128 | + CLOSE_PARENTHESIS_4_REP = 14, // Step is close parenthesis with four repetitions |
| 129 | + CLOSE_PARENTHESIS_5_REP = 15, // Step is close parenthesis with five repetitions |
| 130 | + CLOSE_PARENTHESIS_6_REP = 16, // Step is close parenthesis with six repetitions |
| 131 | + CLOSE_PARENTHESIS_7_REP = 17, // Step is close parenthesis with seven repetitions |
| 132 | + CLOSE_PARENTHESIS_8_REP = 18, // Step is close parenthesis with eight repetitions |
| 133 | + CLOSE_PARENTHESIS_9_REP = 19 // Step is close parenthesis with nine repetitions |
| 134 | + } |
| 135 | + |
| 136 | + /// <summary> |
| 137 | + /// Rubik's cube faces: Up, Down, Front, Back, Right, Left |
| 138 | + /// </summary> |
| 139 | + public enum Faces : int |
| 140 | + { |
| 141 | + U = 0, D = 1, F = 2, B = 3, R = 4, L = 5 |
| 142 | + } |
| 143 | + |
| 144 | + /// <summary> |
| 145 | + /// Rubik's cube edge stickers positions |
| 146 | + /// </summary> |
| 147 | + public enum EdgeStickersPositions : int |
| 148 | + { |
| 149 | + UF_U = 0, UF_F = 1, UR_U = 2, UR_R = 3, UB_U = 4, UB_B = 5, UL_U = 6, UL_L = 7, // Upper layer edges |
| 150 | + FR_F = 8, FR_R = 9, RB_R = 10, RB_B = 11, BL_B = 12, BL_L = 13, LF_L = 14, LF_F = 15, // Middle layer edges |
| 151 | + DF_D = 16, DF_F = 17, DR_D = 18, DR_R = 19, DB_D = 20, DB_B = 21, DL_D = 22, DL_L = 23 // Lower layer edges |
| 152 | + } |
| 153 | + |
| 154 | + /// <summary> |
| 155 | + /// Rubik's cube corner stickers positions |
| 156 | + /// </summary> |
| 157 | + public enum CornerStickersPositions : int |
| 158 | + { |
| 159 | + UFR_U = 0, UFR_F = 1, UFR_R = 2, UBR_U = 3, UBR_B = 4, UBR_R = 5, |
| 160 | + UBL_U = 6, UBL_B = 7, UBL_L = 8, UFL_U = 9, UFL_F = 10, UFL_L = 11, // Upper layer corners |
| 161 | + DFR_D = 12, DFR_F = 13, DFR_R = 14, DBR_D = 15, DBR_B = 16, DBR_R = 17, |
| 162 | + DBL_D = 18, DBL_B = 19, DBL_L = 20, DFL_D = 21, DFL_F = 22, DFL_L = 23 // Lower layer corners |
| 163 | + } |
| 164 | + |
| 165 | + /// <summary> |
| 166 | + /// Rubik's cube all sticker positions |
| 167 | + /// </summary> |
| 168 | + public enum StickerPositions : int |
| 169 | + { |
| 170 | + U = 0, D = 1, F = 2, B = 3, R = 4, L = 5, // Centers |
| 171 | + UF_U = 6, UF_F = 7, UR_U = 8, UR_R = 9, UB_U = 10, UB_B = 11, UL_U = 12, UL_L = 13, // Upper layer edges |
| 172 | + FR_F = 14, FR_R = 15, RB_R = 16, RB_B = 17, BL_B = 18, BL_L = 19, LF_L = 20, LF_F = 21, // Middle layer edges |
| 173 | + DF_D = 22, DF_F = 23, DR_D = 24, DR_R = 25, DB_D = 26, DB_B = 27, DL_D = 28, DL_L = 29, // Lower layer edges |
| 174 | + UFR_U = 30, UFR_F = 31, UFR_R = 32, UBR_U = 33, UBR_B = 34, UBR_R = 35, UBL_U = 36, UBL_B = 37, UBL_L = 38, UFL_U = 39, UFL_F = 40, UFL_L = 41, // Upper layer corners |
| 175 | + DFR_D = 42, DFR_F = 43, DFR_R = 44, DBR_D = 45, DBR_B = 46, DBR_R = 47, DBL_D = 48, DBL_B = 49, DBL_L = 50, DFL_D = 51, DFL_F = 52, DFL_L = 53 // Lower layer corners |
| 176 | + } |
| 177 | + |
| 178 | + /// <summary> |
| 179 | + /// Rubik's cube U layer stickers positions |
| 180 | + /// </summary> |
| 181 | + public enum StickersULayer : int |
| 182 | + { |
| 183 | + U = 0, // Center |
| 184 | + UF_U = 6, UF_F = 7, UR_U = 8, UR_R = 9, UB_U = 10, UB_B = 11, UL_U = 12, UL_L = 13, // Upper layer edges |
| 185 | + UFR_U = 30, UFR_F = 31, UFR_R = 32, UBR_U = 33, UBR_B = 34, UBR_R = 35, UBL_U = 36, UBL_B = 37, UBL_L = 38, UFL_U = 39, UFL_F = 40, UFL_L = 41, // Upper layer corners |
| 186 | + } |
| 187 | + |
| 188 | + /// <summary> |
| 189 | + /// Rubik's cube D layer stickers positions |
| 190 | + /// </summary> |
| 191 | + public enum StickersDLayer : int |
| 192 | + { |
| 193 | + D = 1, // Center |
| 194 | + DF_D = 22, DF_F = 23, DR_D = 24, DR_R = 25, DB_D = 26, DB_B = 27, DL_D = 28, DL_L = 29, // Lower layer edges |
| 195 | + DFR_D = 42, DFR_F = 43, DFR_R = 44, DBR_D = 45, DBR_B = 46, DBR_R = 47, DBL_D = 48, DBL_B = 49, DBL_L = 50, DFL_D = 51, DFL_F = 52, DFL_L = 53 // Lower layer corners |
| 196 | + } |
| 197 | + |
| 198 | + /// <summary> |
| 199 | + /// Rubik's cube F layer stickers positions |
| 200 | + /// </summary> |
| 201 | + public enum StickersFLayer : int |
| 202 | + { |
| 203 | + F = 2, // Center |
| 204 | + UF_U = 6, UF_F = 7, // Upper layer edges |
| 205 | + FR_F = 14, FR_R = 15, LF_L = 20, LF_F = 21, // Middle layer edges |
| 206 | + DF_D = 22, DF_F = 23, // Lower layer edges |
| 207 | + UFR_U = 30, UFR_F = 31, UFR_R = 32, UFL_U = 39, UFL_F = 40, UFL_L = 41, // Upper layer corners |
| 208 | + DFR_D = 42, DFR_F = 43, DFR_R = 44, DFL_D = 51, DFL_F = 52, DFL_L = 53 // Lower layer corners |
| 209 | + } |
| 210 | + |
| 211 | + /// <summary> |
| 212 | + /// Rubik's cube B layer stickers positions |
| 213 | + /// </summary> |
| 214 | + public enum StickersBLayer : int |
| 215 | + { |
| 216 | + B = 3, // Center |
| 217 | + UB_U = 10, UB_B = 11, // Upper layer edges |
| 218 | + RB_R = 16, RB_B = 17, BL_B = 18, BL_L = 19, // Middle layer edges |
| 219 | + DB_D = 26, DB_B = 27, // Lower layer edges |
| 220 | + UBR_U = 33, UBR_B = 34, UBR_R = 35, UBL_U = 36, UBL_B = 37, UBL_L = 38, // Upper layer corners |
| 221 | + DBR_D = 45, DBR_B = 46, DBR_R = 47, DBL_D = 48, DBL_B = 49, DBL_L = 50 // Lower layer corners |
| 222 | + } |
| 223 | + |
| 224 | + /// <summary> |
| 225 | + /// Rubik's cube R layer stickers positions |
| 226 | + /// </summary> |
| 227 | + public enum StickersRLayer : int |
| 228 | + { |
| 229 | + R = 4, // Center |
| 230 | + UR_U = 8, UR_R = 9, // Upper layer edges |
| 231 | + FR_F = 14, FR_R = 15, RB_R = 16, RB_B = 17, // Middle layer edges |
| 232 | + DR_D = 24, DR_R = 25, // Lower layer edges |
| 233 | + UFR_U = 30, UFR_F = 31, UFR_R = 32, UBR_U = 33, UBR_B = 34, UBR_R = 35, // Upper layer corners |
| 234 | + DFR_D = 42, DFR_F = 43, DFR_R = 44, DBR_D = 45, DBR_B = 46, DBR_R = 47 // Lower layer corners |
| 235 | + } |
| 236 | + |
| 237 | + /// <summary> |
| 238 | + /// Rubik's cube L layer stickers positions |
| 239 | + /// </summary> |
| 240 | + public enum StickersLLayer : int |
| 241 | + { |
| 242 | + L = 5, // Center |
| 243 | + UL_U = 12, UL_L = 13, // Upper layer edges |
| 244 | + BL_B = 18, BL_L = 19, LF_L = 20, LF_F = 21, // Middle layer edges |
| 245 | + DL_D = 28, DL_L = 29, // Lower layer edges |
| 246 | + UBL_U = 36, UBL_B = 37, UBL_L = 38, UFL_U = 39, UFL_F = 40, UFL_L = 41, // Upper layer corners |
| 247 | + DBL_D = 48, DBL_B = 49, DBL_L = 50, DFL_D = 51, DFL_F = 52, DFL_L = 53 // Lower layer corners |
| 248 | + } |
| 249 | + |
| 250 | + /// <summary> |
| 251 | + /// Rubik's cube E layer sticker positions |
| 252 | + /// </summary> |
| 253 | + public enum StickersELayer : int |
| 254 | + { |
| 255 | + F = 2, B = 3, R = 4, L = 5, // Centers |
| 256 | + FR_F = 14, FR_R = 15, RB_R = 16, RB_B = 17, BL_B = 18, BL_L = 19, LF_L = 20, LF_F = 21 // Middle layer edges |
| 257 | + } |
| 258 | + |
| 259 | + /// <summary> |
| 260 | + /// Rubik's cube S layer sticker positions |
| 261 | + /// </summary> |
| 262 | + public enum StickersSLayer : int |
| 263 | + { |
| 264 | + U = 0, D = 1, R = 4, L = 5, // Centers |
| 265 | + UR_U = 8, UR_R = 9, UL_U = 12, UL_L = 13, // Upper layer edges |
| 266 | + DR_D = 24, DR_R = 25, DL_D = 28, DL_L = 29 // Lower layer edges |
| 267 | + } |
| 268 | + |
| 269 | + /// <summary> |
| 270 | + /// Rubik's cube M layer sticker positions |
| 271 | + /// </summary> |
| 272 | + public enum StickersMLayer : int |
| 273 | + { |
| 274 | + U = 0, D = 1, F = 2, B = 3, // Centers |
| 275 | + UF_U = 6, UF_F = 7, UB_U = 10, UB_B = 11, // Upper layer edges |
| 276 | + DF_D = 22, DF_F = 23, DB_D = 26, DB_B = 27 // Lower layer edges |
| 277 | + } |
| 278 | + |
| 279 | + /// <summary> |
| 280 | + /// Rubik's cube U Face stickers positions |
| 281 | + /// </summary> |
| 282 | + public enum StickersUFace : int |
| 283 | + { |
| 284 | + U = 0, // Center |
| 285 | + UF_U = 6, UR_U = 8, UB_U = 10, UL_U = 12, // Face edges |
| 286 | + UFR_U = 30, UBR_U = 33, UBL_U = 36, UFL_U = 39 // Face corners |
| 287 | + } |
| 288 | + |
| 289 | + /// <summary> |
| 290 | + /// Rubik's cube D Face stickers positions |
| 291 | + /// </summary> |
| 292 | + public enum StickersDFace : int |
| 293 | + { |
| 294 | + D = 1, // Center |
| 295 | + DF_D = 22, DR_D = 24, DB_D = 26, DL_D = 28, // Face edges |
| 296 | + DFR_D = 42, DBR_D = 45, DBL_D = 48, DFL_D = 51 // Face corners |
| 297 | + } |
| 298 | + |
| 299 | + /// <summary> |
| 300 | + /// Rubik's cube F Face stickers positions |
| 301 | + /// </summary> |
| 302 | + public enum StickersFFace : int |
| 303 | + { |
| 304 | + F = 2, // Center |
| 305 | + UF_F = 7, FR_F = 14, LF_F = 21, DF_F = 23, // Face edges |
| 306 | + UFR_F = 31, UFL_F = 40, DFR_F = 43, DFL_F = 52 // Face corners |
| 307 | + } |
| 308 | + |
| 309 | + /// <summary> |
| 310 | + /// Rubik's cube B Face stickers positions |
| 311 | + /// </summary> |
| 312 | + public enum StickersBFace : int |
| 313 | + { |
| 314 | + B = 3, // Center |
| 315 | + UB_B = 11, RB_B = 17, BL_B = 18, DB_B = 27,// Face edges |
| 316 | + UBR_B = 34, UBL_B = 37, DBR_B = 46, DBL_B = 49 // Face corners |
| 317 | + } |
| 318 | + |
| 319 | + /// <summary> |
| 320 | + /// Rubik's cube R Face stickers positions |
| 321 | + /// </summary> |
| 322 | + public enum StickersRFace : int |
| 323 | + { |
| 324 | + R = 4, // Center |
| 325 | + UR_R = 9, FR_R = 15, RB_R = 16, DR_R = 25, // Face edges |
| 326 | + UFR_R = 32, UBR_R = 35, DFR_R = 44, DBR_R = 47 // Face corners |
| 327 | + } |
| 328 | + |
| 329 | + /// <summary> |
| 330 | + /// Rubik's cube L Face stickers positions |
| 331 | + /// </summary> |
| 332 | + public enum StickersLFace : int |
| 333 | + { |
| 334 | + L = 5, // Center |
| 335 | + UL_L = 13, BL_L = 19, LF_L = 20, DL_L = 29, // Face edges |
| 336 | + UBL_L = 38, UFL_L = 41, DBL_L = 50, DFL_L = 53 // Lower Face corners |
| 337 | + } |
| 338 | + |
| 339 | + /// <summary> |
| 340 | + /// All cube possible spins as faces oriented to up and front |
| 341 | + /// </summary> |
| 342 | + public enum CubeSpins : int |
| 343 | + { |
| 344 | + UF = 0, UR = 1, UB = 2, UL = 3, |
| 345 | + DF = 4, DR = 5, DB = 6, DL = 7, |
| 346 | + FU = 8, FR = 9, FD = 10, FL = 11, |
| 347 | + BU = 12, BR = 13, BD = 14, BL = 15, |
| 348 | + RU = 16, RF = 17, RD = 18, RB = 19, |
| 349 | + LU = 20, LF = 21, LD = 22, LB = 23 |
| 350 | + } |
| 351 | + |
| 352 | + /// <summary> |
| 353 | + /// All cube pieces |
| 354 | + /// </summary> |
| 355 | + public enum Pieces : int |
| 356 | + { |
| 357 | + U = 0, D = 1, F = 2, B = 3, R = 4, L = 5, // Centers |
| 358 | + UF = 6, UR = 7, UB = 8, UL = 9, // Up layer edges |
| 359 | + FR = 10, RB = 11, BL = 12, LF = 13, // Equator layer edges |
| 360 | + DF = 14, DR = 15, DB = 16, DL = 17, // Down layer edges |
| 361 | + UFR = 18, UBR = 19, UBL = 20, UFL = 21, // Up layer corners |
| 362 | + DFR = 22, DBR = 23, DBL = 24, DFL = 25 // Down layer corners |
| 363 | + } |
| 364 | +} |
0 commit comments