package project

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2026-05-30 18:45:26 +02:00
parent c1d44534f3
commit ed03b40325
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
25 changed files with 91 additions and 65 deletions

1
.python-version Normal file
View file

@ -0,0 +1 @@
3.13

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

53
main.py
View file

@ -1,53 +0,0 @@
#!/usr/bin/env python3
#coding: utf-8
'''
Created on 5 mai 2017
Copyright 2017 Jean-Marie Mineau, Maxime Keller
This file is part of "ISN's Cube".
"ISN's Cube" is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
"ISN's Cube" is distributed in the hope that it will be useful and
recreative, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with "ISN's Cube". If not, see <http://www.gnu.org/licenses/>.
@author: <mineau.jean.marie@gmail.com>, Maxime Keller
https://www.python.org/ (c'est le language, donc important)
Module principale du programme de Rubicks cube.
'''
import this # (c'est important aussi)
import pygame
from Cube import Cube
from InterfaceBoutons import InterfaceBoutons
if __name__ == "__main__":
pygame.init()
surfaceCube = pygame.Surface((500, 500))
screen = pygame.display.set_mode((700, 700))
pygame.display.set_caption("ISN's Cube")
cube = Cube(surfaceCube)
interfaceBoutons = InterfaceBoutons(screen, cube)
while True:
surfaceCube.fill((255,255,255))
screen.fill((255,255,255))
cube.run()
screen.blit(surfaceCube, (100,100))
interfaceBoutons.run()
pygame.display.flip()
pygame.time.wait(25)

21
pyproject.toml Normal file
View file

@ -0,0 +1,21 @@
[project]
name = "isn-s-cube"
version = "0.1.0"
description = "A 3D Rubik's Cube with a solver. It's a french A-level Project."
readme = "README.md"
requires-python = ">=3.13"
authors = [
{name = "Jean-Marie Mineau", email = "isn-cube-1UJE@jean-marie.mineau.eu"},
{name = "Maxime Keller"},
]
license = "GPL-3.0-or-later"
dependencies = [
"pygame==2.6.1",
]
[project.scripts]
isn-s-cube = "isn_s_cube:main"
[build-system]
requires = ["uv_build>=0.11.15,<0.12.0"]
build-backend = "uv_build"

View file

@ -22,8 +22,8 @@ This file is part of "ISN's Cube".
"""
import pygame
from pygame.locals import *
from ConstanteTouche import *
from Action import Action
from .ConstanteTouche import *
from .Action import Action
#pygame.init()
@ -101,4 +101,4 @@ class Commande:
# self.orientation[2] = 45
# elif event.key == K_LEFT :
# self.orientation[2] = 45
# self.orientation[0] = 45
# self.orientation[0] = 45

View file

@ -25,11 +25,11 @@ This file is part of "ISN's Cube".
import pygame
from operator import itemgetter
from random import choice
from Cube1x1 import Cubie3D
from Action import Action
from CubeGetteur import CubeGetteur
from Commande import Commande
from Solveur import Solver
from .Cube1x1 import Cubie3D
from .Action import Action
from .CubeGetteur import CubeGetteur
from .Commande import Commande
from .Solveur import Solver
ROUGE, ORANGE, JAUNE, BLANC, VERT, BLEU = (255,0,0), (255,130,20), (255,255,20), (255,255,255), (0,255,0), (0,0,255)
@ -183,4 +183,4 @@ if __name__ == "__main__":
pygame.image.save(screen,"./img/pasDeTrie.png")
prendreImage = False

View file

@ -24,7 +24,10 @@ Interface de boutons fait à la va vite.
"""
import pygame
from Bouton import Boutons
from .Bouton import Boutons
from pathlib import Path
IMG_FOLDER = Path(__file__).parent / "img"
def addAction(cube, action):
@ -32,8 +35,8 @@ def addAction(cube, action):
cube.action.actions.append(action)
CARACTS_BOUTONS = [[(100,30), "img/B1.png", addAction, ["ALEA"]],
[(400,30), "img/B2.png", addAction, ["SOLVE"]],
CARACTS_BOUTONS = [[(100,30), IMG_FOLDER / "B1.png", addAction, ["ALEA"]],
[(400,30), IMG_FOLDER / "B2.png", addAction, ["SOLVE"]],
[(100,600), None, addAction, ["B CW"]],
[(500,600), None, addAction, ["B ACW"]],
[(200,600), None, addAction, ["AV CW"]],

View file

@ -0,0 +1,25 @@
import pygame
from .Cube import Cube
from .InterfaceBoutons import InterfaceBoutons
def main() -> None:
import this # (c'est important aussi)
pygame.init()
surfaceCube = pygame.Surface((500, 500))
screen = pygame.display.set_mode((700, 700))
pygame.display.set_caption("ISN's Cube")
cube = Cube(surfaceCube)
interfaceBoutons = InterfaceBoutons(screen, cube)
while True:
surfaceCube.fill((255, 255, 255))
screen.fill((255, 255, 255))
cube.run()
screen.blit(surfaceCube, (100, 100))
interfaceBoutons.run()
pygame.display.flip()
pygame.time.wait(25)

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

29
uv.lock generated Normal file
View file

@ -0,0 +1,29 @@
version = 1
revision = 3
requires-python = ">=3.13"
[[package]]
name = "isn-s-cube"
version = "0.1.0"
source = { editable = "." }
dependencies = [
{ name = "pygame" },
]
[package.metadata]
requires-dist = [{ name = "pygame", specifier = "==2.6.1" }]
[[package]]
name = "pygame"
version = "2.6.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/49/cc/08bba60f00541f62aaa252ce0cfbd60aebd04616c0b9574f755b583e45ae/pygame-2.6.1.tar.gz", hash = "sha256:56fb02ead529cee00d415c3e007f75e0780c655909aaa8e8bf616ee09c9feb1f", size = 14808125, upload-time = "2024-09-29T13:41:34.698Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/e1/91/718acf3e2a9d08a6ddcc96bd02a6f63c99ee7ba14afeaff2a51c987df0b9/pygame-2.6.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ae6039f3a55d800db80e8010f387557b528d34d534435e0871326804df2a62f2", size = 13090765, upload-time = "2024-09-29T14:27:02.377Z" },
{ url = "https://files.pythonhosted.org/packages/0e/c6/9cb315de851a7682d9c7568a41ea042ee98d668cb8deadc1dafcab6116f0/pygame-2.6.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2a3a1288e2e9b1e5834e425bedd5ba01a3cd4902b5c2bff8ed4a740ccfe98171", size = 12381704, upload-time = "2024-09-29T14:27:10.228Z" },
{ url = "https://files.pythonhosted.org/packages/9f/8f/617a1196e31ae3b46be6949fbaa95b8c93ce15e0544266198c2266cc1b4d/pygame-2.6.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:27eb17e3dc9640e4b4683074f1890e2e879827447770470c2aba9f125f74510b", size = 13581091, upload-time = "2024-09-29T11:30:27.653Z" },
{ url = "https://files.pythonhosted.org/packages/3b/87/2851a564e40a2dad353f1c6e143465d445dab18a95281f9ea458b94f3608/pygame-2.6.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c1623180e70a03c4a734deb9bac50fc9c82942ae84a3a220779062128e75f3b", size = 14273844, upload-time = "2024-09-29T11:40:04.138Z" },
{ url = "https://files.pythonhosted.org/packages/85/b5/aa23aa2e70bcba42c989c02e7228273c30f3b44b9b264abb93eaeff43ad7/pygame-2.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef07c0103d79492c21fced9ad68c11c32efa6801ca1920ebfd0f15fb46c78b1c", size = 13951197, upload-time = "2024-09-29T11:40:06.785Z" },
{ url = "https://files.pythonhosted.org/packages/a6/06/29e939b34d3f1354738c7d201c51c250ad7abefefaf6f8332d962ff67c4b/pygame-2.6.1-cp313-cp313-win32.whl", hash = "sha256:3acd8c009317190c2bfd81db681ecef47d5eb108c2151d09596d9c7ea9df5c0e", size = 10249309, upload-time = "2024-09-29T11:10:23.329Z" },
{ url = "https://files.pythonhosted.org/packages/7e/11/17f7f319ca91824b86557e9303e3b7a71991ef17fd45286bf47d7f0a38e6/pygame-2.6.1-cp313-cp313-win_amd64.whl", hash = "sha256:813af4fba5d0b2cb8e58f5d95f7910295c34067dcc290d34f1be59c48bd1ea6a", size = 10620084, upload-time = "2024-09-29T11:48:51.587Z" },
]