scramble_generator 1.19.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. scramble_generator/__init__.py +2 -0
  2. scramble_generator/app.py +189 -0
  3. scramble_generator/resources/PYPI_README.md +14 -0
  4. scramble_generator/resources/configs/config.yaml +38 -0
  5. scramble_generator/resources/configs/themes.yaml +15 -0
  6. scramble_generator/resources/gifs/app_showcase.gif +0 -0
  7. scramble_generator/resources/images/scramble_generator-128.png +0 -0
  8. scramble_generator/resources/images/scramble_generator-16.png +0 -0
  9. scramble_generator/resources/images/scramble_generator-256.png +0 -0
  10. scramble_generator/resources/images/scramble_generator-32.png +0 -0
  11. scramble_generator/resources/images/scramble_generator-512.png +0 -0
  12. scramble_generator/resources/images/scramble_generator-64.png +0 -0
  13. scramble_generator/resources/images/scramble_generator_with_text-128.png +0 -0
  14. scramble_generator/resources/images/scramble_generator_with_text-16.png +0 -0
  15. scramble_generator/resources/images/scramble_generator_with_text-256.png +0 -0
  16. scramble_generator/resources/images/scramble_generator_with_text-32.png +0 -0
  17. scramble_generator/resources/images/scramble_generator_with_text-512.png +0 -0
  18. scramble_generator/resources/images/scramble_generator_with_text-64.png +0 -0
  19. scramble_generator/scramble_generator.py +507 -0
  20. scramble_generator/yaml_file_handler.py +18 -0
  21. scramble_generator-1.19.0.dist-info/METADATA +28 -0
  22. scramble_generator-1.19.0.dist-info/RECORD +25 -0
  23. scramble_generator-1.19.0.dist-info/WHEEL +4 -0
  24. scramble_generator-1.19.0.dist-info/entry_points.txt +2 -0
  25. scramble_generator-1.19.0.dist-info/licenses/LICENSE +19 -0
@@ -0,0 +1,2 @@
1
+ def main() -> None:
2
+ print("Hello from scramble-generator!")
@@ -0,0 +1,189 @@
1
+ """
2
+ Python app for generating scrambles for twisty puzzles.
3
+ """
4
+
5
+ import sys
6
+
7
+ from PySide6.QtCore import Qt, QTimer, QTime
8
+ from PySide6.QtWidgets import (
9
+ QApplication,
10
+ QMainWindow,
11
+ QWidget,
12
+ QPushButton,
13
+ QLabel,
14
+ QComboBox,
15
+ QSpinBox,
16
+ QGridLayout,
17
+ )
18
+
19
+ from scramble_generator.scramble_generator import ScrambleGenerator as SG
20
+ from scramble_generator.yaml_file_handler import YamlFileHandler
21
+
22
+ config_file = YamlFileHandler("resources/configs/config.yaml")
23
+ config = config_file.load_yaml_file()
24
+
25
+ themes_file = YamlFileHandler("resources/configs/themes.yaml")
26
+ themes = themes_file.load_yaml_file()
27
+
28
+
29
+ class ScrambleGenerator(QMainWindow):
30
+ def __init__(self):
31
+ super().__init__()
32
+ self.init_ui()
33
+
34
+ def init_ui(self):
35
+ self.show()
36
+
37
+ # * Set window default settings
38
+ self.setWindowTitle("Scramble Generator")
39
+ self.setFixedSize(
40
+ config["window_size"]["width"], config["window_size"]["height"]
41
+ )
42
+
43
+ # * Define normal variables
44
+ self.is_running = False
45
+ self.elapsed_time = QTime(0, 0)
46
+ self.puzzle_type_list = [puzzle for puzzle in config["puzzle_type_list"]]
47
+ self.theme_list = [theme for theme in list(themes)[:-1]]
48
+
49
+ # * Create end user widgets and apply settings to them
50
+ self.scramble_button = QPushButton("Generate Scramble")
51
+
52
+ self.puzzle_type = QComboBox()
53
+ self.puzzle_type.addItems(self.puzzle_type_list)
54
+ self.puzzle_type.setCurrentText(config["defaults"]["puzzle_type"])
55
+
56
+ self.num_moves = QSpinBox()
57
+ self.num_moves.setRange(
58
+ config["num_moves_range"]["min"], config["num_moves_range"]["max"]
59
+ )
60
+ self.num_moves.setValue(config["defaults"]["num_moves"])
61
+
62
+ self.theme_toggle = QPushButton(config["defaults"]["theme"])
63
+
64
+ self.scramble = QLabel(
65
+ " ", alignment=Qt.AlignmentFlag.AlignCenter, wordWrap=True
66
+ )
67
+ self.scramble.setFixedWidth(config["scramble_widget_width"])
68
+
69
+ self.timer_button = QPushButton("Start Timer")
70
+
71
+ self.timer_output = QLabel(
72
+ "00:00.0", alignment=Qt.AlignmentFlag.AlignCenter, maximumHeight=22
73
+ )
74
+
75
+ self.timer = QTimer()
76
+ self.timer.interval = 10 # * Milliseconds
77
+
78
+ # * Define button connections and/or actions
79
+ self.scramble_button.pressed.connect(self.get_moves)
80
+ self.puzzle_type.currentTextChanged.connect(self.set_default_num_moves)
81
+ self.theme_toggle.pressed.connect(self.toggle_theme)
82
+ self.timer_button.pressed.connect(self.toggle_timer)
83
+ self.timer.timeout.connect(self.update_time)
84
+
85
+ # * Create layouts
86
+ self.page = QGridLayout()
87
+ self.left_side = QGridLayout()
88
+ self.left_side.setVerticalSpacing(5)
89
+ self.right_side = QGridLayout()
90
+
91
+ # * Add widgets to layouts
92
+ self.left_side.addWidget(self.scramble_button, 0, 0, 1, 2)
93
+ self.left_side.addWidget(self.puzzle_type, 1, 0, 1, 1)
94
+ self.left_side.addWidget(self.num_moves, 1, 1, 1, 1)
95
+ self.left_side.addWidget(self.timer_button, 2, 0, 1, 2)
96
+ self.left_side.addWidget(self.timer_output, 3, 0, 1, 2)
97
+ self.left_side.addWidget(self.theme_toggle, 4, 0, 1, 2)
98
+
99
+ self.right_side.addWidget(self.scramble, 0, 0, 1, 2)
100
+
101
+ # * Setup overall page layout and set default window theme
102
+ self.page.addLayout(self.left_side, 0, 0)
103
+ self.page.addLayout(self.right_side, 0, 1)
104
+
105
+ self.gui = QWidget()
106
+ self.gui.setLayout(self.page)
107
+
108
+ self.setCentralWidget(self.gui)
109
+
110
+ self.apply_theme(self.theme_toggle.text().lower())
111
+
112
+ def toggle_theme(self):
113
+ if self.theme_toggle.text() == "Dark":
114
+ self.theme_toggle.setText("Light")
115
+ theme = self.theme_toggle.text()
116
+ else:
117
+ self.theme_toggle.setText("Dark")
118
+ theme = self.theme_toggle.text()
119
+
120
+ self.apply_theme(theme.lower())
121
+
122
+ def apply_theme(self, theme):
123
+ self.main_stylesheet = f"""
124
+ background-color: {themes[theme]["background-color"]};
125
+ color: {themes[theme]["color"]};
126
+ border: {themes[theme]["border"]};
127
+ border-radius: {themes["general"]["border-radius"]};
128
+ padding: {themes["general"]["padding"]};
129
+ """
130
+ self.widget_stylesheet = f"""
131
+ background-color: {themes[theme]["widget-background-color"]};
132
+ """
133
+ self.setStyleSheet(self.main_stylesheet)
134
+ self.scramble_button.setStyleSheet(self.widget_stylesheet)
135
+ self.puzzle_type.setStyleSheet(self.widget_stylesheet)
136
+ self.num_moves.setStyleSheet(self.widget_stylesheet)
137
+ self.theme_toggle.setStyleSheet(self.widget_stylesheet)
138
+ self.scramble.setStyleSheet(self.widget_stylesheet)
139
+ self.timer_button.setStyleSheet(self.widget_stylesheet)
140
+ self.timer_output.setStyleSheet(self.widget_stylesheet)
141
+
142
+ (
143
+ self.theme_toggle.setText("Dark")
144
+ if theme == "dark"
145
+ else self.theme_toggle.setText("Light")
146
+ )
147
+
148
+ def get_moves(self):
149
+ scramble = SG()
150
+ self.scramble.setText(
151
+ scramble.generate_scramble(
152
+ self.puzzle_type.currentText().lower(), self.num_moves.value()
153
+ )
154
+ )
155
+
156
+ def set_default_num_moves(self):
157
+ self.num_moves.setValue(
158
+ config["puzzle_default_moves"][self.puzzle_type.currentText().lower()]
159
+ )
160
+
161
+ def toggle_timer(self):
162
+ if not self.is_running:
163
+ self.timer.start(100) # * Update display every 100 milliseconds
164
+ self.timer_button.setText("Stop Timer")
165
+ self.is_running = True
166
+ else:
167
+ self.timer.stop()
168
+ self.timer_button.setText("Start Timer")
169
+ self.is_running = False
170
+ self.update_time()
171
+
172
+ def update_time(self):
173
+ self.elapsed_time = self.elapsed_time.addMSecs(
174
+ 100
175
+ ) # * Increment time by 100 milliseconds
176
+ self.timer_output.setText(self.elapsed_time.toString("mm:ss.z"))
177
+
178
+ if not self.is_running:
179
+ self.elapsed_time = QTime(0, 0)
180
+
181
+
182
+ def main():
183
+ app = QApplication(sys.argv)
184
+ main_window = ScrambleGenerator() # noqa: F841
185
+ sys.exit(app.exec())
186
+
187
+
188
+ if __name__ == "__main__":
189
+ main()
@@ -0,0 +1,14 @@
1
+ ## Donations
2
+
3
+ - [Buy Me A Coffee](https://www.buymeacoffee.com/KingKairos)
4
+ - [GitHub Sponsors](https://github.com/sponsors/melvinquick)
5
+
6
+ ## Purpose
7
+
8
+ The general purpose of this app is to give people an easy way to generate scrambles for standard twisty puzzles.
9
+
10
+ ## Useful Information
11
+
12
+ - [Project Goals](https://codeberg.org/melvinquick/scramble_generator/projects/11195)
13
+ - [Latest Release](https://codeberg.org/melvinquick/scramble_generator/releases/latest)
14
+ - [Releases](https://codeberg.org/melvinquick/scramble_generator/releases)
@@ -0,0 +1,38 @@
1
+ defaults:
2
+ num_moves: 25
3
+ puzzle_type: 3x3
4
+ theme: Dark
5
+ num_moves_range:
6
+ min: 10
7
+ max: 150
8
+ puzzle_default_moves:
9
+ 2x2: 10
10
+ 3x3: 25
11
+ 4x4: 40
12
+ 5x5: 60
13
+ 6x6: 80
14
+ 7x7: 90
15
+ 8x8: 100
16
+ 9x9: 110
17
+ 10x10: 120
18
+ 11x11: 130
19
+ pyraminx: 15
20
+ skewb: 25
21
+ puzzle_type_list:
22
+ - 2x2
23
+ - 3x3
24
+ - 4x4
25
+ - 5x5
26
+ - 6x6
27
+ - 7x7
28
+ - 8x8
29
+ - 9x9
30
+ - 10x10
31
+ - 11x11
32
+ - Pyraminx
33
+ - Skewb
34
+ window_title: "Scramble Generator"
35
+ window_size:
36
+ width: 660
37
+ height: 160
38
+ scramble_widget_width: 480
@@ -0,0 +1,15 @@
1
+ light:
2
+ background-color: "#d8dee9"
3
+ color: "#2e3440"
4
+ border: 1px solid '#e5e9f0'
5
+ widget-background-color: "#eceff4"
6
+
7
+ dark:
8
+ background-color: "#2e3440"
9
+ color: "#eceff4"
10
+ border: 1px solid '#434c5e'
11
+ widget-background-color: "#4c566a"
12
+
13
+ general:
14
+ border-radius: "4px"
15
+ padding: "2px 4px"
@@ -0,0 +1,507 @@
1
+ import secrets
2
+
3
+
4
+ class ScrambleGenerator:
5
+ def __init__(self, puzzle_type="3x3"):
6
+ self.puzzle_type = puzzle_type
7
+ self.opposite_moves = {
8
+ "U ": "U' ",
9
+ "U' ": "U ",
10
+ "u ": "u' ",
11
+ "u' ": "u ",
12
+ "U2 ": "U2' ",
13
+ "U2' ": "U2 ",
14
+ "U3 ": "U3' ",
15
+ "U3' ": "U3 ",
16
+ "U4 ": "U4' ",
17
+ "U4' ": "U4 ",
18
+ "U5 ": "U5' ",
19
+ "U5' ": "U5 ",
20
+ "D ": "D' ",
21
+ "D' ": "D ",
22
+ "D2 ": "D2' ",
23
+ "D2' ": "D2 ",
24
+ "D3 ": "D3' ",
25
+ "D3' ": "D3 ",
26
+ "D4 ": "D4' ",
27
+ "D4' ": "D4 ",
28
+ "D5 ": "D5' ",
29
+ "D5' ": "D5 ",
30
+ "L ": "L' ",
31
+ "L' ": "L ",
32
+ "l ": "l' ",
33
+ "l' ": "l ",
34
+ "L2 ": "L2' ",
35
+ "L2' ": "L2 ",
36
+ "L3 ": "L3' ",
37
+ "L3' ": "L3 ",
38
+ "L4 ": "L4' ",
39
+ "L4' ": "L4 ",
40
+ "L5 ": "L5' ",
41
+ "L5' ": "L5 ",
42
+ "R ": "R' ",
43
+ "R' ": "R ",
44
+ "r ": "r' ",
45
+ "r' ": "r ",
46
+ "R2 ": "R2' ",
47
+ "R2' ": "R2 ",
48
+ "R3 ": "R3' ",
49
+ "R3' ": "R3 ",
50
+ "R4 ": "R4' ",
51
+ "R4' ": "R4 ",
52
+ "R5 ": "R4' ",
53
+ "R5' ": "R4 ",
54
+ "F ": "F' ",
55
+ "F' ": "F ",
56
+ "F2 ": "F2' ",
57
+ "F2' ": "F2 ",
58
+ "F3 ": "F3' ",
59
+ "F3' ": "F3 ",
60
+ "F4 ": "F4' ",
61
+ "F4' ": "F4 ",
62
+ "F5 ": "F5' ",
63
+ "F5' ": "F5 ",
64
+ "B ": "B' ",
65
+ "B' ": "B ",
66
+ "b ": "b' ",
67
+ "b' ": "b ",
68
+ "B2 ": "B2' ",
69
+ "B2' ": "B2 ",
70
+ "B3 ": "B3' ",
71
+ "B3' ": "B3 ",
72
+ "B4 ": "B4' ",
73
+ "B4' ": "B4 ",
74
+ "B5 ": "B5' ",
75
+ "B5' ": "B5 ",
76
+ }
77
+
78
+ def generate_scramble(self, puzzle_type="3x3", num_moves=25):
79
+ puzzle_type = puzzle_type
80
+ moves = self.get_valid_moves(puzzle_type)
81
+ scramble_order = []
82
+ counter = 0
83
+
84
+ while counter < num_moves:
85
+ if counter == 0:
86
+ scramble_order.append(secrets.choice(moves))
87
+ else:
88
+ filtered_moves = [
89
+ move
90
+ for move in moves
91
+ if move != self.opposite_moves[scramble_order[-1]]
92
+ ]
93
+ scramble_order.append(secrets.choice(filtered_moves))
94
+
95
+ counter += 1
96
+
97
+ return "".join(map(str, scramble_order))
98
+
99
+ def get_valid_moves(self, puzzle_type):
100
+ match self.puzzle_type:
101
+ case "2x2":
102
+ return ["U ", "U' ", "R ", "R' ", "F ", "F' "]
103
+ case "3x3":
104
+ return [
105
+ "U ",
106
+ "U' ",
107
+ "D ",
108
+ "D' ",
109
+ "L ",
110
+ "L' ",
111
+ "R ",
112
+ "R' ",
113
+ "F ",
114
+ "F' ",
115
+ "B ",
116
+ "B' ",
117
+ ]
118
+ case "4x4":
119
+ return [
120
+ "U ",
121
+ "U' ",
122
+ "U2 ",
123
+ "U2' ",
124
+ "D ",
125
+ "D' ",
126
+ "D2 ",
127
+ "D2' ",
128
+ "L ",
129
+ "L' ",
130
+ "L2 ",
131
+ "L2' ",
132
+ "R ",
133
+ "R' ",
134
+ "R2 ",
135
+ "R2' ",
136
+ "F ",
137
+ "F' ",
138
+ "F2 ",
139
+ "F2' ",
140
+ "B ",
141
+ "B' ",
142
+ "B2 ",
143
+ "B2' ",
144
+ ]
145
+ case "5x5":
146
+ return [
147
+ "U ",
148
+ "U' ",
149
+ "U2 ",
150
+ "U2' ",
151
+ "D ",
152
+ "D' ",
153
+ "D2 ",
154
+ "D2' ",
155
+ "L ",
156
+ "L' ",
157
+ "L2 ",
158
+ "L2' ",
159
+ "R ",
160
+ "R' ",
161
+ "R2 ",
162
+ "R2' ",
163
+ "F ",
164
+ "F' ",
165
+ "F2 ",
166
+ "F2' ",
167
+ "B ",
168
+ "B' ",
169
+ "B2 ",
170
+ "B2' ",
171
+ ]
172
+ case "6x6":
173
+ return [
174
+ "U ",
175
+ "U' ",
176
+ "U2 ",
177
+ "U2' ",
178
+ "U3 ",
179
+ "U3' ",
180
+ "D ",
181
+ "D' ",
182
+ "D2 ",
183
+ "D2' ",
184
+ "D3 ",
185
+ "D3' ",
186
+ "L ",
187
+ "L' ",
188
+ "L2 ",
189
+ "L2' ",
190
+ "L3 ",
191
+ "L3' ",
192
+ "R ",
193
+ "R' ",
194
+ "R2 ",
195
+ "R2' ",
196
+ "R3 ",
197
+ "R3' ",
198
+ "F ",
199
+ "F' ",
200
+ "F2 ",
201
+ "F2' ",
202
+ "F3 ",
203
+ "F3' ",
204
+ "B ",
205
+ "B' ",
206
+ "B2 ",
207
+ "B2' ",
208
+ "B3 ",
209
+ "B3' ",
210
+ ]
211
+ case "7x7":
212
+ return [
213
+ "U ",
214
+ "U' ",
215
+ "U2 ",
216
+ "U2' ",
217
+ "U3 ",
218
+ "U3' ",
219
+ "D ",
220
+ "D' ",
221
+ "D2 ",
222
+ "D2' ",
223
+ "D3 ",
224
+ "D3' ",
225
+ "L ",
226
+ "L' ",
227
+ "L2 ",
228
+ "L2' ",
229
+ "L3 ",
230
+ "L3' ",
231
+ "R ",
232
+ "R' ",
233
+ "R2 ",
234
+ "R2' ",
235
+ "R3 ",
236
+ "R3' ",
237
+ "F ",
238
+ "F' ",
239
+ "F2 ",
240
+ "F2' ",
241
+ "F3 ",
242
+ "F3' ",
243
+ "B ",
244
+ "B' ",
245
+ "B2 ",
246
+ "B2' ",
247
+ "B3 ",
248
+ "B3' ",
249
+ ]
250
+ case "8x8":
251
+ return [
252
+ "U ",
253
+ "U' ",
254
+ "U2 ",
255
+ "U2' ",
256
+ "U3 ",
257
+ "U3' ",
258
+ "U4 ",
259
+ "U4' ",
260
+ "D ",
261
+ "D' ",
262
+ "D2 ",
263
+ "D2' ",
264
+ "D3 ",
265
+ "D3' ",
266
+ "D4 ",
267
+ "D4' ",
268
+ "L ",
269
+ "L' ",
270
+ "L2 ",
271
+ "L2' ",
272
+ "L3 ",
273
+ "L3' ",
274
+ "L4 ",
275
+ "L4' ",
276
+ "R ",
277
+ "R' ",
278
+ "R2 ",
279
+ "R2' ",
280
+ "R3 ",
281
+ "R3' ",
282
+ "R4 ",
283
+ "R4' ",
284
+ "F ",
285
+ "F' ",
286
+ "F2 ",
287
+ "F2' ",
288
+ "F3 ",
289
+ "F3' ",
290
+ "F4 ",
291
+ "F4' ",
292
+ "B ",
293
+ "B' ",
294
+ "B2 ",
295
+ "B2' ",
296
+ "B3 ",
297
+ "B3' ",
298
+ "B4 ",
299
+ "B4' ",
300
+ ]
301
+ case "9x9":
302
+ return [
303
+ "U ",
304
+ "U' ",
305
+ "U2 ",
306
+ "U2' ",
307
+ "U3 ",
308
+ "U3' ",
309
+ "U4 ",
310
+ "U4' ",
311
+ "D ",
312
+ "D' ",
313
+ "D2 ",
314
+ "D2' ",
315
+ "D3 ",
316
+ "D3' ",
317
+ "D4 ",
318
+ "D4' ",
319
+ "L ",
320
+ "L' ",
321
+ "L2 ",
322
+ "L2' ",
323
+ "L3 ",
324
+ "L3' ",
325
+ "L4 ",
326
+ "L4' ",
327
+ "R ",
328
+ "R' ",
329
+ "R2 ",
330
+ "R2' ",
331
+ "R3 ",
332
+ "R3' ",
333
+ "R4 ",
334
+ "R4' ",
335
+ "F ",
336
+ "F' ",
337
+ "F2 ",
338
+ "F2' ",
339
+ "F3 ",
340
+ "F3' ",
341
+ "F4 ",
342
+ "F4' ",
343
+ "B ",
344
+ "B' ",
345
+ "B2 ",
346
+ "B2' ",
347
+ "B3 ",
348
+ "B3' ",
349
+ "B4 ",
350
+ "B4' ",
351
+ ]
352
+ case "10x10":
353
+ return [
354
+ "U ",
355
+ "U' ",
356
+ "U2 ",
357
+ "U2' ",
358
+ "U3 ",
359
+ "U3' ",
360
+ "U4 ",
361
+ "U4' ",
362
+ "U5 ",
363
+ "U5' ",
364
+ "D ",
365
+ "D' ",
366
+ "D2 ",
367
+ "D2' ",
368
+ "D3 ",
369
+ "D3' ",
370
+ "D4 ",
371
+ "D4' ",
372
+ "D5 ",
373
+ "D5' ",
374
+ "L ",
375
+ "L' ",
376
+ "L2 ",
377
+ "L2' ",
378
+ "L3 ",
379
+ "L3' ",
380
+ "L4 ",
381
+ "L4' ",
382
+ "L5 ",
383
+ "L5' ",
384
+ "R ",
385
+ "R' ",
386
+ "R2 ",
387
+ "R2' ",
388
+ "R3 ",
389
+ "R3' ",
390
+ "R4 ",
391
+ "R4' ",
392
+ "R5 ",
393
+ "R5' ",
394
+ "F ",
395
+ "F' ",
396
+ "F2 ",
397
+ "F2' ",
398
+ "F3 ",
399
+ "F3' ",
400
+ "F4 ",
401
+ "F4' ",
402
+ "F5 ",
403
+ "F5' ",
404
+ "B ",
405
+ "B' ",
406
+ "B2 ",
407
+ "B2' ",
408
+ "B3 ",
409
+ "B3' ",
410
+ "B4 ",
411
+ "B4' ",
412
+ "B5 ",
413
+ "B5' ",
414
+ ]
415
+ case "11x11":
416
+ return [
417
+ "U ",
418
+ "U' ",
419
+ "U2 ",
420
+ "U2' ",
421
+ "U3 ",
422
+ "U3' ",
423
+ "U4 ",
424
+ "U4' ",
425
+ "U5 ",
426
+ "U5' ",
427
+ "D ",
428
+ "D' ",
429
+ "D2 ",
430
+ "D2' ",
431
+ "D3 ",
432
+ "D3' ",
433
+ "D4 ",
434
+ "D4' ",
435
+ "D5 ",
436
+ "D5' ",
437
+ "L ",
438
+ "L' ",
439
+ "L2 ",
440
+ "L2' ",
441
+ "L3 ",
442
+ "L3' ",
443
+ "L4 ",
444
+ "L4' ",
445
+ "L5 ",
446
+ "L5' ",
447
+ "R ",
448
+ "R' ",
449
+ "R2 ",
450
+ "R2' ",
451
+ "R3 ",
452
+ "R3' ",
453
+ "R4 ",
454
+ "R4' ",
455
+ "R5 ",
456
+ "R5' ",
457
+ "F ",
458
+ "F' ",
459
+ "F2 ",
460
+ "F2' ",
461
+ "F3 ",
462
+ "F3' ",
463
+ "F4 ",
464
+ "F4' ",
465
+ "F5 ",
466
+ "F5' ",
467
+ "B ",
468
+ "B' ",
469
+ "B2 ",
470
+ "B2' ",
471
+ "B3 ",
472
+ "B3' ",
473
+ "B4 ",
474
+ "B4' ",
475
+ "B5 ",
476
+ "B5' ",
477
+ ]
478
+ case "pyraminx":
479
+ return [
480
+ "U ",
481
+ "U' ",
482
+ "u ",
483
+ "u' ",
484
+ "L ",
485
+ "L' ",
486
+ "l ",
487
+ "l' ",
488
+ "R ",
489
+ "R' ",
490
+ "r ",
491
+ "r' ",
492
+ "B ",
493
+ "B' ",
494
+ "b ",
495
+ "b' ",
496
+ ]
497
+ case "skewb":
498
+ return [
499
+ "L ",
500
+ "L' ",
501
+ "R ",
502
+ "R' ",
503
+ "F ",
504
+ "F' ",
505
+ "B ",
506
+ "B' ",
507
+ ]
@@ -0,0 +1,18 @@
1
+ import os
2
+ import yaml
3
+
4
+
5
+ class YamlFileHandler:
6
+ def __init__(self, filename):
7
+ self.filename = filename
8
+
9
+ def load_yaml_file(self):
10
+ with open(self.get_file_path(), "r") as f:
11
+ return yaml.safe_load(f)
12
+
13
+ def save_yaml_file(self, configs):
14
+ with open(self.get_file_path(), "w") as f:
15
+ return yaml.safe_dump(configs, f, default_flow_style=False)
16
+
17
+ def get_file_path(self):
18
+ return os.path.join(os.path.dirname(__file__), self.filename)
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.4
2
+ Name: scramble_generator
3
+ Version: 1.19.0
4
+ Summary: Python app for generating scrambles for twisty puzzles.
5
+ Project-URL: repository, https://codeberg.org/melvinquick/scramble_generator
6
+ Project-URL: issues, https://codeberg.org/melvinquick/scramble_generator/issues
7
+ Author-email: Melvin Quick <melvinquick@proton.me>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Requires-Python: >=3.12
11
+ Requires-Dist: pyside6>=6.8.2.1
12
+ Requires-Dist: pyyaml>=6.0.2
13
+ Description-Content-Type: text/markdown
14
+
15
+ ## Donations
16
+
17
+ - [Buy Me A Coffee](https://www.buymeacoffee.com/KingKairos)
18
+ - [GitHub Sponsors](https://github.com/sponsors/melvinquick)
19
+
20
+ ## Purpose
21
+
22
+ The general purpose of this app is to give people an easy way to generate scrambles for standard twisty puzzles.
23
+
24
+ ## Useful Information
25
+
26
+ - [Project Goals](https://codeberg.org/melvinquick/scramble_generator/projects/11195)
27
+ - [Latest Release](https://codeberg.org/melvinquick/scramble_generator/releases/latest)
28
+ - [Releases](https://codeberg.org/melvinquick/scramble_generator/releases)
@@ -0,0 +1,25 @@
1
+ scramble_generator/__init__.py,sha256=z26QEW36AWqhpHAGQGQ5EYuOm3jfRclX2OdLAKw6u8E,64
2
+ scramble_generator/app.py,sha256=VzFvDrK6Zf_ihXUVH4f0HZ_3fbvhRJrHNGpXXAynIdk,6347
3
+ scramble_generator/scramble_generator.py,sha256=nEpf1to_fU1hgH10vnBii2IUr_UdoPzCtlf_qm_e1ac,14155
4
+ scramble_generator/yaml_file_handler.py,sha256=Dy3r39zFYZqFc8iWaAkp3uNp9Ap8ws91A5Ph9yNLZuU,514
5
+ scramble_generator/resources/PYPI_README.md,sha256=ReVdr0rY8V1Yku1HFRA8bt2yDpBIaWyRKl9XTQnPdes,549
6
+ scramble_generator/resources/configs/config.yaml,sha256=QdIOtkwPPc4O2ihUm8IryD4PvDGqr0DIdnlho9srTMg,519
7
+ scramble_generator/resources/configs/themes.yaml,sha256=uPacMWV5khSlnA0w_TddAo9sMFZwv6q8K9SRGlIiNBQ,315
8
+ scramble_generator/resources/gifs/app_showcase.gif,sha256=flZPtNYY2uOzjL4SqNR7INW97sEbRvS3TyWrVUzGuQA,5262674
9
+ scramble_generator/resources/images/scramble_generator-128.png,sha256=uTicc8PDmUCx4Lzrp4AnDKx9JzbhasPjbhRIvT9VRZw,4000
10
+ scramble_generator/resources/images/scramble_generator-16.png,sha256=hxMzJsvGV3p-osfRPnh4Fq4tvuucX-TN-Tr9uWIkBtg,392
11
+ scramble_generator/resources/images/scramble_generator-256.png,sha256=4RycPQQiHLEAFaZnEdeRzTUHd-NtQUVPDJgQXKJtZcM,9781
12
+ scramble_generator/resources/images/scramble_generator-32.png,sha256=tlkrsN2K-fdZQm58AtxQq8l3KsLxg_127vtYthFdYXQ,840
13
+ scramble_generator/resources/images/scramble_generator-512.png,sha256=00umRQRHel5ka3vBEDKgaTOKErldHvGWm73HTAcT-Ww,20935
14
+ scramble_generator/resources/images/scramble_generator-64.png,sha256=-6II5qE1T5W8_NqGRk8CWF0QEa3yPNNCGAdLjEC0YGU,1841
15
+ scramble_generator/resources/images/scramble_generator_with_text-128.png,sha256=Rbb9GbbCT84PoD_mEnYg1BpgPtiuDaHmZggABcIG-iw,4427
16
+ scramble_generator/resources/images/scramble_generator_with_text-16.png,sha256=rtI-3q2dCUcu6yUFAFWXZBZ973A5EsnFP0fNHIpFem8,459
17
+ scramble_generator/resources/images/scramble_generator_with_text-256.png,sha256=AtGSXSiW3T97oGddsNn3wHwkJ0ICpt2T5AUcCMr3yuE,11664
18
+ scramble_generator/resources/images/scramble_generator_with_text-32.png,sha256=fhpMXfBYbwOn0itjRtAe1Tlj5wgNv6TEz7KG9l-g6NY,944
19
+ scramble_generator/resources/images/scramble_generator_with_text-512.png,sha256=FHUxe5KKkQbnB60LmEiyCcTl40mBN7FeSF793sPZ_ho,25575
20
+ scramble_generator/resources/images/scramble_generator_with_text-64.png,sha256=Cc-RbDEGf7vq7K4c48i6tspfiFgdTOWkYeCzRc9Kc38,2171
21
+ scramble_generator-1.19.0.dist-info/METADATA,sha256=KXrzucxFcjb2-_g9n2B2JkVPRvwCfqyl6P0XGyq25hs,1043
22
+ scramble_generator-1.19.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ scramble_generator-1.19.0.dist-info/entry_points.txt,sha256=rsxbXcrpkHgVaDOt8w9TSLPT4959igrNSW_63eOUMKY,63
24
+ scramble_generator-1.19.0.dist-info/licenses/LICENSE,sha256=NpFlK17Ep1MDHT5BkEGROCdNzNouam7L2cXcaQnmx8I,1057
25
+ scramble_generator-1.19.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [gui_scripts]
2
+ scramble-generator = scramble_generator.app:main
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2023, Melvin Quick
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.