picross-python 0.1.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.
File without changes
picross_python/cli.py ADDED
@@ -0,0 +1,1022 @@
1
+ from turtle import *
2
+ from time import *
3
+ from math import *
4
+ import keyboard
5
+ #5x5 grid with grid(5,5,150)
6
+
7
+ #size in 5x5 = 100*5px
8
+ #size in 10x10 = 50x10px
9
+ #size in 15x15 = 33x15px
10
+ #size in 20x20 = 25x20px
11
+ #size in 25x25 = 20x25px
12
+
13
+ # all need to be 500 by 500 px
14
+ hideturtle()
15
+ screen = Screen()
16
+ screen.setup(width=1100, height=1100)
17
+
18
+
19
+ Picross_list=[[[[1,0,1,0,1],
20
+ [1,1,1,1,1],
21
+ [0,1,1,1,0],
22
+ [1,1,1,1,1],
23
+ [1,1,1,1,1]],'Castle'],
24
+
25
+ [[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
26
+ [1,1,0,0,0,0,0,0,0,0,0,0,0,1,1],
27
+ [1,1,0,1,1,1,1,1,1,1,1,1,0,1,1],
28
+ [1,1,0,1,1,0,0,0,0,0,1,1,0,1,1],
29
+ [1,1,0,1,1,0,0,0,0,0,1,1,0,1,1],
30
+ [1,1,0,1,1,0,0,0,0,0,1,1,0,1,1],
31
+ [1,1,0,1,1,0,0,0,0,0,1,1,0,1,1],
32
+ [1,1,0,1,1,1,1,1,1,1,1,1,0,1,1],
33
+ [1,1,0,0,0,0,0,0,0,0,0,0,0,1,1],
34
+ [1,1,0,0,1,0,0,0,0,0,0,0,0,1,1],
35
+ [1,1,0,1,1,1,0,0,0,0,0,0,0,1,1],
36
+ [1,1,0,0,1,0,0,0,0,1,1,1,0,1,1],
37
+ [1,1,0,0,0,0,0,0,0,0,0,0,0,1,1],
38
+ [1,1,0,0,0,0,0,0,0,0,0,0,1,1,1],
39
+ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]],'Game Boy'],
40
+
41
+ [[[1,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0,1,1,1,0,1,1,1,1,0],
113
+ [0,1,1,1,1,1,0,0,0,1,1,1,1,1,0],
114
+ [0,1,1,1,1,1,1,1,1,1,1,1,1,1,0],
115
+ [0,1,1,1,1,1,1,1,1,1,1,1,1,1,0]],'Phone'],
116
+
117
+ [[[0,1,1,1,1],
118
+ [0,0,1,0,1],
119
+ [0,0,1,1,1],
120
+ [0,0,1,0,0],
121
+ [0,1,1,1,0]],'P like picross ;)']] #List of all curent picross [LIST[Picross[rows0[Column0,Column1,ect]],Name]]
122
+ Solution_list=[] #Current playing picross
123
+ Player_list=[] #Squares placed by player
124
+ Numbers_list=[[[[1,1,1],[5],[3],[5],[5]],[[2,2],[4],[5],[4],[2,2]]],
125
+ [[[15],[2,2],[2,9,2],[2,2,2,2],[2,2,2,2],[2,2,2,2],[2,2,2,2],[2,9,2],[2,2],[2,1,2],[2,3,2],[2,1,3,2],[2,2],[2,3],[15]],[[15],[15],[1,1],[1,6,1,1],[1,6,3,1],[1,1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1,1],[1,6,1,1],[1,6,1,1],[1,2],[15],[15]]],
126
+ [[[1,1,4],[1,1,6],[3,2,2],[1,2,2,1],[1,2,1,1],[1,5,1],[1,1,2],[1,5],[1],[7]],[[5],[1,3],[3,1],[3,1],[6,1],[3,1,1,1],[2,1,1,1,1],[2,3,1,1],[3,2,1],[7,1]]],
127
+ [[[1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[7],[2,7],[10],[9],[8],[6]],[[2],[3],[3],[10],[6],[10],[6],[10],[6],[8]]],
128
+ [[[2],[4],[4],[10],[2,7],[2,5],[1,4],[8],[3,3],[3,3]],[[2,1],[3,3],[1,5],[4,2],[8],[8],[8],[7],[3,3],[2,1]]],
129
+ [[[2],[4],[6],[8],[10],[10],[10],[2,2,2],[4],[6]],[[3],[5],[6,1],[6,2],[10],[10],[6,2],[6,1],[5],[3]]],
130
+ [[[0],[7],[3,4],[2,5],[1,6],[15],[1,1],[1,1,2,2],[12],[11],[1,5],[1,6],[2,7],[11],[0]],[[2],[3,1,3],[2,1,2,2],[1,1,2,1],[2,1,3,1],[1,1,2,1],[1,1,2,1],[1,1,2,2],[1,2,3,3],[5,7],[5,6],[4,6],[4,7],[3,2,3],[2]]],
131
+ [[[9],[13],[15],[5,5],[4,1,1,4],[4,1,1,4],[7],[9],[3,3],[3,3,3],[3,3,3],[4,3,4],[5,5],[13],[13]],[[4],[5,4],[5,6],[6,8],[4,9],[3,5,3],[3,2,3,2],[3,2,3,2],[3,2,3,2],[3,5,3],[4,9],[6,8],[5,6],[5,4],[4]]],
132
+ [[[4],[1,1],[3],[1],[3]],[[0],[1,1],[5],[1,1,1],[3]]]] #[Picross[[Rows1],[Rows2]],[Columns1]]]
133
+
134
+
135
+
136
+
137
+
138
+
139
+ def start_player_list(size):
140
+ P_list=[]
141
+ for i in range (size):
142
+ P_list.append([])
143
+ for i in range (size):
144
+ P_list[-1].append(0)
145
+ return P_list
146
+
147
+
148
+ hideturtle()
149
+
150
+
151
+ def choose (picross_size):
152
+ if picross_size == 5:
153
+ grid(5,5,100)
154
+ if picross_size == 10:
155
+ grid(10,10,50)
156
+ if picross_size == 15:
157
+ grid(15,15,33)
158
+ if picross_size == 20:
159
+ grid(20,20,25)
160
+ if picross_size == 25:
161
+ grid(25,25,20)
162
+
163
+ def grid(rows,columns,size) : #set a grid of rows and columns with square
164
+ if size == 100: #give the number of px to move to be aligned with the grid
165
+ mult=5
166
+ if size == 50:
167
+ mult=10
168
+ if size == 33:
169
+ mult=15
170
+ if size == 25:
171
+ mult=20
172
+ if size == 20:
173
+ mult=25
174
+ setheading(90)
175
+ color('grey')
176
+ for a in range (columns+1):
177
+ if a+1 == 6 or a+1 == 11 or a+1 == 16 or a+1 == 21 or a+1 == 26 :
178
+ if a+1 != mult+1:
179
+ pensize(2)
180
+ color('coral2')
181
+ penup()
182
+ goto(a*size,0)
183
+ pendown()
184
+ forward(size*(rows))
185
+ pendown()
186
+ color('grey')
187
+ pensize(1)
188
+
189
+ setheading(0)
190
+ for b in range (rows+1):
191
+ if b+1 == 6 or b+1 == 11 or b+1 == 16 or b+1 == 21 or b+1 == 26 :
192
+ if b+1 != mult+1:
193
+ color('coral2')
194
+ pensize(2)
195
+ penup()
196
+ goto(0,b*size)
197
+ pendown()
198
+ forward(size*(columns))
199
+ color('grey')
200
+ pensize(1)
201
+ color('black')
202
+
203
+ def arrow(x,y,orientation,size): #make an arrow of size of the block ex: for box of 50x50px. arrow is 50 in size
204
+ size=size/4
205
+ size=sqrt(size*size+size*size)
206
+ penup()
207
+ goto(x,y)
208
+ pendown()
209
+ if orientation == 'down' :
210
+ setheading(135)
211
+ forward(size)
212
+ forward(-size)
213
+ setheading(45)
214
+ forward(size)
215
+ forward(-size)
216
+ if orientation == 'right' :
217
+ setheading(135)
218
+ forward(size)
219
+ forward(-size)
220
+ setheading(225)
221
+ forward(size)
222
+ forward(-size)
223
+ penup()
224
+
225
+
226
+ def square(x,y,size): #make a square of side length = size at x,y cordinate
227
+ penup()
228
+ goto(x,y)
229
+ pendown()
230
+ setheading(0)
231
+ for i in range (4):
232
+ forward(size)
233
+ right(90)
234
+ penup()
235
+
236
+
237
+ def cross (x,y,size): #draw a cross to show the cursor location on grid proportional to grid size
238
+ pensize(3)
239
+ color ('grey')
240
+ penup()
241
+ goto(x,y)
242
+ setheading(90)
243
+ forward ((size/2)*0.8)
244
+ setheading(-45)
245
+ pendown()
246
+ for i in range (4):
247
+ forward (sqrt((size/2*0.8)**2+(size/2*0.8)**2))
248
+ right(90)
249
+ penup()
250
+ color('black')
251
+ pensize(1)
252
+
253
+ def X_mark(x,y,size,X_list,xlist,ylist,square_list):
254
+ if square_list[ylist][xlist]==1 or X_list[ylist][xlist]==1 :
255
+ square_list[ylist][xlist]=0
256
+ X_list[ylist][xlist]=0
257
+
258
+
259
+ elif square_list[ylist][xlist]==0:
260
+ X_list[ylist][xlist]=1
261
+
262
+
263
+
264
+
265
+ def show_X (size,X_list): #draws squares on picross with the player_list
266
+
267
+ if size == 5: #give the number of px to move to be aligned with the grid
268
+ mult=100
269
+ if size == 10:
270
+ mult=50
271
+ if size == 15:
272
+ mult=33
273
+ if size == 20:
274
+ mult=25
275
+ if size == 25:
276
+ mult=20
277
+
278
+ pensize(3)
279
+ penup()
280
+ setheading(0)
281
+ for y in range (len(X_list[-1])):
282
+ for x in range (len(X_list[-1])):
283
+ if X_list[y][x]==1:
284
+ color('chocolate')
285
+
286
+ goto(x*mult,-y*mult+((size-1)*mult))
287
+ setheading(45)
288
+ pendown()
289
+ forward(sqrt(mult**2+mult**2))
290
+ penup()
291
+ setheading(0)
292
+ forward(-mult)
293
+ setheading(-45)
294
+ pendown()
295
+ forward(sqrt(mult**2+mult**2))
296
+ penup()
297
+ setheading(0)
298
+ setheading(0)
299
+ pensize(1)
300
+ color('black')
301
+
302
+
303
+
304
+ def square (x,y,size,square_list,xlist,ylist,X_list): #draw a square at coordinate to place a square on the picross
305
+ penup()
306
+ setheading(0)
307
+ goto(x-size/2,y-size/2)
308
+ pendown()
309
+ begin_fill()
310
+ for i in range (4):
311
+ forward(size)
312
+ left(90)
313
+ end_fill()
314
+ penup()
315
+ if square_list[ylist][xlist]==1 or X_list[ylist][xlist]==1 :
316
+ square_list[ylist][xlist]=0
317
+ X_list[ylist][xlist]=0
318
+
319
+
320
+ elif X_list[ylist][xlist]==0:
321
+ square_list[ylist][xlist]=1
322
+
323
+
324
+
325
+
326
+
327
+ def show_square (size,square_list): #draws squares on picross with the player_list
328
+
329
+ if size == 5: #give the number of px to move to be aligned with the grid
330
+ mult=100
331
+ if size == 10:
332
+ mult=50
333
+ if size == 15:
334
+ mult=33
335
+ if size == 20:
336
+ mult=25
337
+ if size == 25:
338
+ mult=20
339
+
340
+
341
+ penup()
342
+ setheading(0)
343
+ for y in range (len(square_list[-1])):
344
+ for x in range (len(square_list[-1])):
345
+ if square_list[y][x]==1:
346
+ color('black')
347
+ goto(x*mult,-y*mult+((size-1)*mult))
348
+ pendown()
349
+ begin_fill()
350
+ for i in range (4):
351
+ forward(mult)
352
+ left(90)
353
+ end_fill()
354
+ penup()
355
+ else:
356
+ color('white')
357
+ goto(x*mult,-y*mult+((size-1)*mult))
358
+ pendown()
359
+ begin_fill()
360
+ for i in range (4):
361
+ forward(mult)
362
+ left(90)
363
+ end_fill()
364
+ penup()
365
+ color('black')
366
+
367
+
368
+ def Picross_selection(List,completed):
369
+ selected=0
370
+ list_size=[]
371
+
372
+
373
+ for i in range(len(List)):
374
+ list_size.append(len(List[i][0]))
375
+
376
+ tracer(0,0)
377
+ pensize(10)
378
+ setheading(45)
379
+ for i in range (10):
380
+ penup()
381
+ goto(500+(-i*40),-600)
382
+ pendown()
383
+ forward(1100)
384
+ penup()
385
+ pensize(5)
386
+ setheading(225)
387
+ goto(-700,700)
388
+ pendown()
389
+ for i in range (25):
390
+ circle(30+(i*10))
391
+ setheading(0)
392
+ pensize(1)
393
+
394
+
395
+
396
+ penup()
397
+ goto(-300,200)
398
+ write("Press 1 to 9 on ", align="left", font=("Courier", 16, "bold"))
399
+ goto(-300,175)
400
+ write("your keyboard", align="left", font=("Courier", 16, "bold"))
401
+ goto(-300,150)
402
+ write("to select a Picross", align="left", font=("Courier", 16, "bold"))
403
+
404
+
405
+
406
+
407
+
408
+ grid(3,3,100)
409
+ penup()
410
+ goto(5,275)
411
+ pendown()
412
+ write("Picross 1", align="left", font=("Courier", 16, "bold"))
413
+ if completed[0]==1:
414
+ penup()
415
+ goto(5,250)
416
+ pendown()
417
+ write("Castle", align="left", font=("Courier", 12, "bold"))
418
+ penup()
419
+ goto(5,225)
420
+ pendown()
421
+ write('5X5', align="left", font=("Courier", 16, "bold"))
422
+
423
+
424
+ penup()
425
+ goto(105,275)
426
+ pendown()
427
+ write("Picross 2", align="left", font=("Courier", 16, "bold"))
428
+ if completed[1]==1:
429
+ penup()
430
+ goto(105,250)
431
+ pendown()
432
+ write("Game Boy", align="left", font=("Courier", 12, "bold"))
433
+ penup()
434
+ goto(105,225)
435
+ pendown()
436
+ write('15X15', align="left", font=("Courier", 16, "bold"))
437
+
438
+ penup()
439
+ goto(205,275)
440
+ pendown()
441
+ write("Picross 3", align="left", font=("Courier", 16, "bold"))
442
+ if completed[2]==1:
443
+ penup()
444
+ goto(205,250)
445
+ pendown()
446
+ write("Snail", align="left", font=("Courier", 12, "bold"))
447
+ penup()
448
+ goto(205,225)
449
+ pendown()
450
+ write('10X10', align="left", font=("Courier", 16, "bold"))
451
+
452
+ penup()
453
+ goto(5,175)
454
+ pendown()
455
+ write("Picross 4", align="left", font=("Courier", 16, "bold"))
456
+ if completed[3]==1:
457
+ penup()
458
+ goto(5,150)
459
+ pendown()
460
+ write("Glove", align="left", font=("Courier", 12, "bold"))
461
+ penup()
462
+ goto(5,125)
463
+ pendown()
464
+ write('10X10', align="left", font=("Courier", 16, "bold"))
465
+
466
+ penup()
467
+ goto(105,175)
468
+ pendown()
469
+ write("Picross 5", align="left", font=("Courier", 16, "bold"))
470
+ if completed[4]==1:
471
+ penup()
472
+ goto(105,150)
473
+ pendown()
474
+ write("Star", align="left", font=("Courier", 12, "bold"))
475
+ penup()
476
+ goto(105,125)
477
+ pendown()
478
+ write('10X10', align="left", font=("Courier", 16, "bold"))
479
+
480
+ penup()
481
+ goto(205,175)
482
+ pendown()
483
+ write("Picross 6", align="left", font=("Courier", 16, "bold"))
484
+ if completed[5]==1:
485
+ penup()
486
+ goto(205,150)
487
+ pendown()
488
+ write("Spike", align="left", font=("Courier", 12, "bold"))
489
+ penup()
490
+ goto(205,125)
491
+ pendown()
492
+ write('10X10', align="left", font=("Courier", 16, "bold"))
493
+
494
+ penup()
495
+ goto(5,75)
496
+ pendown()
497
+ write("Picross 7", align="left", font=("Courier", 16, "bold"))
498
+ if completed[6]==1:
499
+ penup()
500
+ goto(5,50)
501
+ pendown()
502
+ write("Burger", align="left", font=("Courier", 12, "bold"))
503
+ penup()
504
+ goto(5,25)
505
+ pendown()
506
+ write('15X15', align="left", font=("Courier", 16, "bold"))
507
+
508
+ penup()
509
+ goto(105,75)
510
+ pendown()
511
+ write("Picross 8", align="left", font=("Courier", 16, "bold"))
512
+ if completed[7]==1:
513
+ penup()
514
+ goto(105,50)
515
+ pendown()
516
+ write("Phone", align="left", font=("Courier", 12, "bold"))
517
+ penup()
518
+ goto(105,25)
519
+ pendown()
520
+ write('15X15', align="left", font=("Courier", 16, "bold"))
521
+
522
+ penup()
523
+ goto(205,75)
524
+ pendown()
525
+ write("Picross 9", align="left", font=("Courier", 16, "bold"))
526
+ if completed[8]==1:
527
+ penup()
528
+ goto(205,50)
529
+ pendown()
530
+ write("P like Picross", align="left", font=("Courier", 12, "bold"))
531
+ penup()
532
+ goto(205,25)
533
+ pendown()
534
+ write('5X5', align="left", font=("Courier", 16, "bold"))
535
+
536
+
537
+
538
+ tracer(1,0)
539
+
540
+
541
+ while selected==0:
542
+ if keyboard.is_pressed('1'):
543
+ selected=1
544
+ size=5
545
+
546
+ if keyboard.is_pressed('2'):
547
+ selected=2
548
+ size=15
549
+
550
+ if keyboard.is_pressed('3'):
551
+ selected=3
552
+ size=10
553
+
554
+ if keyboard.is_pressed('4'):
555
+ selected=4
556
+ size=10
557
+
558
+ if keyboard.is_pressed('5'):
559
+ selected=5
560
+ size=10
561
+
562
+ if keyboard.is_pressed('6'):
563
+ selected=6
564
+ size=10
565
+
566
+ if keyboard.is_pressed('7'):
567
+ selected=7
568
+ size=15
569
+
570
+ if keyboard.is_pressed('8'):
571
+ selected=8
572
+ size=15
573
+
574
+ if keyboard.is_pressed('9'):
575
+ selected=9
576
+ size=5
577
+
578
+ clearscreen()
579
+ return(selected-1,size)
580
+
581
+
582
+ def Title_screen():
583
+ tracer(0,0)
584
+ penup()
585
+ goto(0,-400)
586
+ pendown()
587
+ write('Made By C3A5M7', align="center", font=("Courier", 22, "normal"))
588
+ penup()
589
+ goto(0,0)
590
+ pendown()
591
+ write('Picross - Py', align="center", font=("Courier", 56, "normal"))
592
+ penup()
593
+ goto(0,-100)
594
+ pendown()
595
+ write('Press C to continue ', align="center", font=("Courier", 26, "normal"))
596
+ pensize(10)
597
+ setheading(45)
598
+ for i in range (10):
599
+ penup()
600
+ goto(500+(-i*40),-600)
601
+ pendown()
602
+ forward(1100)
603
+ penup()
604
+ pensize(5)
605
+ setheading(225)
606
+ goto(-700,700)
607
+ pendown()
608
+ for i in range (30):
609
+ circle(30+(i*10))
610
+ setheading(0)
611
+ pensize(1)
612
+
613
+
614
+
615
+
616
+
617
+
618
+ setheading(0)
619
+ tracer(1,0)
620
+
621
+
622
+
623
+
624
+ def Numbers(size,selected,List_num):
625
+ if size == 5: #give the number of px to move to be aligned with the grid and is also used in the arrow size
626
+ move=100
627
+ if size == 10:
628
+ move=50
629
+ if size == 15:
630
+ move=33
631
+ if size == 20:
632
+ move=25
633
+ if size == 25:
634
+ move=20
635
+
636
+ Current_picross=List_num[selected] # current list --->. [ [[N,N] , [N] , [N,N,N,N] ] , [[N,N] , [N] , [N,N,N,N] ] ]
637
+
638
+ # starting position for horizontal text y=-30 and add -20 per supplementary lines and x is at first move/2 and + move * actual columns
639
+
640
+ # starting position for Vertical text x=-30 and add -20 per supplementary lines and y is at first move/2 and + move * actual rows
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+ for a in range (len(Current_picross[0])):
649
+ for b in range (len(Current_picross[0][a])):
650
+ penup()
651
+ goto((-30+(-20*len(Current_picross[0][a])))+b*20,488-(move/2+(move*a)))
652
+ pendown()
653
+ write(Current_picross[0][a][b], align="center", font=("Courier", 22, "normal"))
654
+
655
+
656
+ for a in range (len(Current_picross[1])):
657
+ for b in range (len(Current_picross[1][a])):
658
+ penup()
659
+ goto((move/2+(move*a))+0,(-30+(-20*len(Current_picross[1][a])))+b*20)
660
+ pendown()
661
+ write(Current_picross[1][a][(len(Current_picross[1][a])-1)-b], align="center", font=("Courier", 22, "normal"))
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+
670
+
671
+
672
+
673
+ def control (size,square_list,Solve_list,select,Num_list,X_list):
674
+
675
+ if size == 5: #give the number of px to move to be aligned with the grid and is also used in the arrow size
676
+ move=100
677
+ frame_limit=20
678
+ if size == 10:
679
+ move=50
680
+ frame_limit=10
681
+ if size == 15:
682
+ move=33
683
+ frame_limit=5
684
+ if size == 20:
685
+ move=25
686
+ frame_limit=3
687
+ if size == 25:
688
+ move=20
689
+ frame_limit=2
690
+
691
+ cursor_row=move/2 #set the starting position of the arrows
692
+ cursor_column=move/2+(move*size)-move
693
+
694
+ xlistpos=0 #position in the player list
695
+ ylistpos=0
696
+
697
+ Victory=0
698
+
699
+ Frame_counter=0 #something to count the number of drawed frame since last clear (this help to be less flashing)
700
+ #timestart=round(time(),0)
701
+ #elaspsed=0
702
+
703
+
704
+ tracer(0,0) #show the screen
705
+ choose(size)
706
+ Numbers(size,select,Num_list)
707
+ #arrow(cursor_row,500,'down',move)
708
+ #arrow(0,cursor_column,'right',move)
709
+ cross(cursor_row,cursor_column,move)
710
+ tracer(1,0)
711
+
712
+ while Victory==0:
713
+ if keyboard.is_pressed('up'):
714
+ if (cursor_column/move)+0.5 == size :
715
+ cursor_column=move/2
716
+ #clearscreen()
717
+ tracer(0,0)
718
+ #arrow(cursor_row,500,'down',move)
719
+ #arrow(0,cursor_column,'right',move)
720
+ show_square(size,square_list)
721
+ show_X(size,X_list)
722
+ cross(cursor_row,cursor_column,move)
723
+ choose(size)
724
+ #Numbers(size,select,Num_list)
725
+ ylistpos=size-1
726
+ Frame_counter+=1
727
+ tracer(1,0)
728
+ sleep(0.1)
729
+
730
+
731
+ else:
732
+ cursor_column=cursor_column+move
733
+ #clearscreen()
734
+ tracer(0,0)
735
+ #arrow(cursor_row,500,'down',move)
736
+ #arrow(0,cursor_column,'right',move)
737
+ show_square(size,square_list)
738
+ show_X(size,X_list)
739
+ cross(cursor_row,cursor_column,move)
740
+ choose(size)
741
+ #Numbers(size,select,Num_list)
742
+ ylistpos-=1
743
+ Frame_counter+=1
744
+ tracer(1,0)
745
+ sleep(0.1)
746
+
747
+
748
+
749
+ elif keyboard.is_pressed('down'):
750
+ if (cursor_column/move)+0.5 == 1 :
751
+ cursor_column=move/2+(move*size)-move
752
+ #clearscreen()
753
+ tracer(0,0)
754
+ #arrow(cursor_row,500,'down',move)
755
+ #arrow(0,cursor_column,'right',move)
756
+ show_square(size,square_list)
757
+ show_X(size,X_list)
758
+ cross(cursor_row,cursor_column,move)
759
+ choose(size)
760
+ #Numbers(size,select,Num_list)
761
+ ylistpos=0
762
+ Frame_counter+=1
763
+ tracer(1,0)
764
+ sleep(0.1)
765
+
766
+ else:
767
+
768
+ cursor_column=cursor_column-move
769
+ #clearscreen()
770
+ tracer(0,0)
771
+ #arrow(cursor_row,500,'down',move)
772
+ #arrow(0,cursor_column,'right',move)
773
+ show_square(size,square_list)
774
+ show_X(size,X_list)
775
+ cross(cursor_row,cursor_column,move)
776
+ choose(size)
777
+ #Numbers(size,select,Num_list)
778
+ ylistpos+=1
779
+ Frame_counter+=1
780
+ tracer(1,0)
781
+ sleep(0.1)
782
+
783
+ elif keyboard.is_pressed('right'):
784
+ if (cursor_row/move)+0.5 == size :
785
+ cursor_row=move/2
786
+ #clearscreen()
787
+ tracer(0,0)
788
+ #arrow(cursor_row,500,'down',move)
789
+ #arrow(0,cursor_column,'right',move)
790
+ show_square(size,square_list)
791
+ show_X(size,X_list)
792
+ cross(cursor_row,cursor_column,move)
793
+ choose(size)
794
+ #Numbers(size,select,Num_list)
795
+ xlistpos=0
796
+ Frame_counter+=1
797
+ tracer(1,0)
798
+ sleep(0.1)
799
+
800
+
801
+ else:
802
+ cursor_row=cursor_row+move
803
+ #clearscreen()
804
+ tracer(0,0)
805
+ #arrow(cursor_row,500,'down',move)
806
+ #arrow(0,cursor_column,'right',move)
807
+ show_square(size,square_list)
808
+ show_X(size,X_list)
809
+ cross(cursor_row,cursor_column,move)
810
+ choose(size)
811
+ #Numbers(size,select,Num_list)
812
+ xlistpos+=1
813
+ Frame_counter+=1
814
+ tracer(1,0)
815
+ sleep(0.1)
816
+
817
+ elif keyboard.is_pressed('left'):
818
+ if (cursor_row/move)+0.5 == 1 :
819
+
820
+ cursor_row=move/2+(move*size)-move
821
+ #clearscreen()
822
+ tracer(0,0)
823
+ #arrow(cursor_row,500,'down',move)
824
+ #arrow(0,cursor_column,'right',move)
825
+ show_square(size,square_list)
826
+ show_X(size,X_list)
827
+ cross(cursor_row,cursor_column,move)
828
+ choose(size)
829
+ #Numbers(size,select,Num_list)
830
+ xlistpos=size-1
831
+ Frame_counter+=1
832
+ tracer(1,0)
833
+ sleep(0.1)
834
+
835
+ else:
836
+
837
+ cursor_row=cursor_row-move
838
+ #clearscreen()
839
+ tracer(0,0)
840
+ #arrow(cursor_row,500,'down',move)
841
+ #arrow(0,cursor_column,'right',move)
842
+ show_square(size,square_list)
843
+ show_X(size,X_list)
844
+ cross(cursor_row,cursor_column,move)
845
+ choose(size)
846
+ #Numbers(size,select,Num_list)
847
+ xlistpos-=1
848
+ Frame_counter+=1
849
+ tracer(1,0)
850
+ sleep(0.1)
851
+
852
+
853
+ elif keyboard.is_pressed('c'):
854
+ #clearscreen()
855
+ tracer(0,0)
856
+ #arrow(cursor_row,500,'down',move)
857
+ #arrow(0,cursor_column,'right',move)
858
+ square(cursor_row,cursor_column,move,square_list,xlistpos,ylistpos,X_list)
859
+ show_square(size,square_list)
860
+ show_X(size,X_list)
861
+ cross(cursor_row,cursor_column,move)
862
+ choose(size)
863
+ #Numbers(size,select,Num_list)
864
+ Frame_counter+=1
865
+
866
+ if square_list == Solve_list[0]:
867
+ Victory=1
868
+ tracer(1,0)
869
+ sleep(0.1)
870
+
871
+ elif keyboard.is_pressed('x'):
872
+ #clearscreen()
873
+ tracer(0,0)
874
+ #arrow(cursor_row,500,'down',move)
875
+ #arrow(0,cursor_column,'right',move)
876
+ X_mark(cursor_row,cursor_column,move,X_list,xlistpos,ylistpos,square_list)
877
+ show_square(size,square_list)
878
+ show_X(size,X_list)
879
+ cross(cursor_row,cursor_column,move)
880
+ choose(size)
881
+ #Numbers(size,select,Num_list)
882
+ Frame_counter+=1
883
+
884
+ if square_list == Solve_list[0]:
885
+ Victory=1
886
+ tracer(1,0)
887
+ sleep(0.1)
888
+
889
+ """ if timestart<=round(time()-1,0):
890
+ tracer(0,0)
891
+ elaspsed+=1
892
+ penup()
893
+ goto(-300,200)
894
+ pendown()
895
+ begin_fill()
896
+ color('white')
897
+ goto(-100,200)
898
+ goto(-100,0)
899
+ goto(-300,0)
900
+ goto(-300,200)
901
+ end_fill()
902
+ if elaspsed%10==1:
903
+ Frame_counter==100 #for make the screen clear
904
+ color('black')
905
+ tracer(1,0)
906
+ penup()
907
+ goto(-250,150)
908
+ write('Time : ', align="center", font=("Courier", 16, "normal"))
909
+ goto(-200,150)
910
+ write(round(elaspsed/60,0), align="center", font=("Courier", 16, "normal"))
911
+ goto(-150,150)
912
+ write(elaspsed%60, align="center", font=("Courier", 16, "normal"))
913
+ timestart=round(time(),0)
914
+ color('black')
915
+ tracer(1,0) """
916
+
917
+
918
+ if Frame_counter > frame_limit :
919
+ clearscreen()
920
+ tracer(0,0)
921
+ show_square(size,square_list)
922
+ show_X(size,X_list)
923
+ cross(cursor_row,cursor_column,move)
924
+ choose(size)
925
+ Numbers(size,select,Num_list)
926
+ Frame_counter=0
927
+ tracer(1,0)
928
+
929
+
930
+ sleep(0.01)
931
+
932
+ tracer(0,0)
933
+ setheading(45)
934
+ for i in range(2000):
935
+ penup()
936
+ goto(1000-i*4,-1000)
937
+ pendown()
938
+ forward(3000)
939
+
940
+ setheading(0)
941
+ penup()
942
+ goto(-400,400)
943
+ color('white')
944
+ begin_fill()
945
+ pendown()
946
+ for i in range(4):
947
+ forward(800)
948
+ right(90)
949
+ end_fill()
950
+ penup()
951
+ color('black')
952
+ goto(0,100)
953
+ pendown()
954
+ write('You win', align="center", font=("Courier", 48, "normal"))
955
+ penup()
956
+ goto(0,-50)
957
+ pendown()
958
+ write('Picross name :', align="center", font=("Courier", 28, "normal"))
959
+ penup()
960
+ goto(0,-100)
961
+ pendown()
962
+ write(Solve_list[1], align="center", font=("Courier", 22, "normal"))
963
+ penup()
964
+ goto(0,-350)
965
+ pendown()
966
+ write('Press c to exit', align="center", font=("Courier", 16, "normal"))
967
+ penup()
968
+ goto(0,-400)
969
+ pendown()
970
+ write('Or, Press X to go back to main menu', align="center", font=("Courier", 16, "normal"))
971
+ hideturtle()
972
+ tracer(1,0)
973
+
974
+
975
+ exit=0
976
+
977
+ while exit==0:
978
+ if keyboard.is_pressed('c'):
979
+ exit=1
980
+ if keyboard.is_pressed('x'):
981
+ exit=2
982
+ return 1
983
+
984
+ completed_list=[0,0,0,0,0,0,0,0,0]
985
+ title=0
986
+ size=5
987
+ Title_screen()
988
+ while title==0:
989
+ if keyboard.is_pressed('c'):
990
+ title=1
991
+
992
+ clearscreen()
993
+ select,size=Picross_selection(Picross_list,completed_list)
994
+
995
+ def start_player_list(size):
996
+ P_list=[]
997
+ for i in range (size):
998
+ P_list.append([])
999
+ for i in range (size):
1000
+ P_list[-1].append(0)
1001
+ return P_list
1002
+
1003
+ reset=0
1004
+ Player_list=start_player_list(size)
1005
+ X_Player_list=start_player_list(size)
1006
+ reset=control(size,Player_list,Picross_list[select],select,Numbers_list,X_Player_list) #launch game
1007
+ completed_list[select]=1
1008
+ while reset==1:
1009
+ clearscreen()
1010
+ title=0
1011
+ Title_screen()
1012
+ while title==0:
1013
+ if keyboard.is_pressed('c'):
1014
+ title=1
1015
+ clearscreen()
1016
+ select,size=Picross_selection(Picross_list,completed_list)
1017
+ Player_list=start_player_list(size)
1018
+ X_Player_list=start_player_list(size)
1019
+ reset=control(size,Player_list,Picross_list[select],select,Numbers_list,X_Player_list) #launch game again
1020
+ completed_list[select]=1
1021
+
1022
+
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.5
2
+ Name: picross-python
3
+ Version: 0.1.0
4
+ Summary: A short description of what picross-python does
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.9
7
+ Requires-Dist: keyboard
8
+ Description-Content-Type: text/markdown
9
+
10
+ <h1 align="center">Picross python</h1>
11
+
12
+ <p align="center">
13
+ <img src="https://img.shields.io/badge/Python-%233670A0.svg?logo=python&logoColor=ffdd54" />
14
+ <img src="https://img.shields.io/badge/Linux-FCC000?logo=linux&logoColor=black" />
15
+ <img src="https://img.shields.io/badge/macOS-000000?logo=apple&logoColor=F0F0F0" />
16
+ <img src="https://custom-icon-badges.demolab.com/badge/Windows-0078D6?logo=windows11&logoColor=white" />
17
+ <img src="https://img.shields.io/badge/License-MIT-green.svg?style=flat&logo=open-source-initiative&logoColor=white" />
18
+ <img src="https://hackatime-badge.hackclub.com/
19
+ U0BJM7Z8MRT/Picross-Python" />
20
+ <br />
21
+ A Picross made in Python with Turtle
22
+ </p>
23
+
24
+ Picross From Mario's Picross On Game Boy and various picross S games from nintendo switch
25
+
26
+
27
+ >[!WARNING]
28
+ >For MacOs must be run as admin with Sudo and accessibility
29
+
30
+
31
+
32
+ >[!NOTE]
33
+ > Some Picross like 2,7,8 are large (15x15) and can be quite
34
+ > slow for more representative and playable Picross try the 10x10 and 5x5 ones
35
+
36
+ ## Base of game
37
+
38
+ ### Controls
39
+
40
+ This is a Picross game so you need to know the basics of Picross:
41
+
42
+ You can :
43
+ - Move
44
+ - Place Block (1) and Diamonds(2)
45
+
46
+ (1) - The Block is what you need to place on precise coordinate to make the shape of the Picross and finish the Picross
47
+
48
+ (2) - Technically, the diamond is optional but basically the diamond can helps you figuring out where to place the remainings blocks
49
+
50
+ ### Goal of the game
51
+
52
+ In Picross, you have a shape (generally a square) of X*X blocks with numbers on the sides.
53
+
54
+ Each numbers is how many block you have in the line for example :
55
+
56
+ 2 3 1
57
+
58
+ This mean in first you 2 consecutives blocks and a void(diamond) of 1 or more after you get 3 consecutives blocks and a void or more and finally one block.
59
+
60
+ ### Tips
61
+
62
+ if your grid is for example 10 by 10 and you need just to place 6 blocks , what you can do is count the number of block from each side, and then place block at the overlapping coordinate
63
+
64
+ 6 | # # # # # # _ _ _ _ | from left to right
65
+
66
+ 6 | _ _ _ _ # # # # # # | from right to left
67
+
68
+ 6 | + + + + X X + + + + | only the two at center are overlapping
69
+
70
+ X= blocks (overlapping ones)
71
+ += non-overlapping blocks
72
+ #= counting block from each side.
73
+ _= No blocks
74
+
75
+
76
+ Take your time you are not limited by time
77
+
78
+
79
+ ## Features
80
+
81
+ - Teleport cursor when on the side to get to the other side
82
+ - Blocks and Diamonds
83
+ - Various Picross from 5x5 to 15x15
84
+ - Main menu
85
+ - Selection Menu after finishing a Picross
86
+
87
+ ## Included Picross
88
+
89
+ <ol>
90
+ <li>Castle from Picross S (5X5)</li>
91
+ <li>Game Boy from Mario's Picross (15X15)</li>
92
+ <li>Snail from Mario's Picross (10x10)</li>
93
+ <li>Glove from Mario's Picross (10x10)</li>
94
+ <li>Star from Mario's Picross (10x10)</li>
95
+ <li>Spike from Mario's Picross (10x10)</li>
96
+ <li>Burger from Mario's Picross (15X15)</li>
97
+ <li>Phone from Mario's Picross (15X15)</li>
98
+ <li>P like Picross made by myself (5X5)</li>
99
+ </ol>
100
+
101
+ ## Quick Start
102
+
103
+ ### From source
104
+
105
+ The first way to use my project is to clone the repo and launch it with :
106
+
107
+ ```bash
108
+ git clone https://github.com/C3A5M7/Picross-py.git
109
+ cd Picross-py
110
+ ```
111
+
112
+ then install turtle and keyboard:
113
+
114
+ ```bash
115
+ pip install turtle keyboard
116
+ ```
117
+
118
+ then you can just launch the program with:
119
+
120
+ ```bash
121
+ sudo python3 Picross-gamr-in-py.py
122
+ ```
123
+
124
+ ## AI use
125
+
126
+ - As mention above AI was used to help me port picross into list because it would take a lot of time (i still made the plan of list but the value are from the AI and tested after to see if everything was correct)
127
+
128
+ - No other part of the code was made by or assisted by AI
129
+
130
+ - only 2,3,4,5,6,7,8 are ported by AI 1 and 9 are by me
131
+
132
+ ## License
133
+
134
+ This project use the [MIT License](./LICENSE), and deserve credit if used in any kind
@@ -0,0 +1,7 @@
1
+ picross_python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ picross_python/cli.py,sha256=c-qiKh4DfpznbshTMadrHJ2rxxEk5xlDYn6B6ApN0Nw,29493
3
+ picross_python-0.1.0.dist-info/METADATA,sha256=sgAxUMg34_j2spSOSursKVypvnbr-XJBD-LhTZ0-u_k,3958
4
+ picross_python-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
5
+ picross_python-0.1.0.dist-info/entry_points.txt,sha256=6W7lsgghIeGB5lKVFOkGwZFQBInV95aP18jAQhcNNiE,59
6
+ picross_python-0.1.0.dist-info/licenses/LICENSE,sha256=N_GKMQAJf5OddvZ4H7ofGbMM9uE4X2qYQhhmDLZUUeE,1060
7
+ picross_python-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ picross-python = picross_python.cli:main
@@ -0,0 +1,7 @@
1
+ Copyright 2026 Jules Lesniak
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.