From bbdbc5b72d88dd02128099f22dc7b8c592efa746 Mon Sep 17 00:00:00 2001 From: dick Date: Wed, 3 Apr 2024 12:08:54 +0200 Subject: [PATCH] Auto --- Enter.class | Bin 1806 -> 1874 bytes Enter.java | 7 ++++++- Main.class | Bin 1255 -> 1369 bytes Main.java | 3 +++ Reset.class | Bin 0 -> 675 bytes Reset.java | 22 ++++++++++++++++++++++ 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Reset.class create mode 100644 Reset.java diff --git a/Enter.class b/Enter.class index ac233087fb36c3deaf098e25d8af08fd63ee6c7a..a429358d8e1eebfb6b524d3146b428ed84f231bf 100644 GIT binary patch delta 496 zcmW-eUoV_N6vlt^?!G(r%>?O1qd^*ph>B&GZnae`Yq3~=TiPydm8Gj}kxe9S)+IL* z-iX8(aN9(0>Y}}ET>1k20R0At^o+^mInVQ)Gnq4I4$7~}OP6;Szkm)lJ!E0Xqfzb55T$$(}snAio62Mk#!ZDBaf2%{bu z#w?6`Oc0*5bV@UQxcBGbO0JkL`nU_V-xShP&Yzc+D$<| z-1s+KwTtSqxOD5nAK*WzBEI87W;k=sdFOU`FUx+Fl`ii8`~^DLHoT%OLYQ_39S+`T zYTeqY>Cz+&nrf3Dg}A1rgsThc5jbZV=ZE!4y;^?bB^;XDxXUI-fliKTP$p^XWa#hmLh>{k(7G@rq5O@G3_)&HM diff --git a/Enter.java b/Enter.java index 401795d..d93f60a 100644 --- a/Enter.java +++ b/Enter.java @@ -49,8 +49,13 @@ public class Enter extends JPanel { }); } + public int[][] getInitialGrid() { + return initialGrid; + } + + @Override -protected void paintComponent(Graphics g) { + protected void paintComponent(Graphics g) { super.paintComponent(g); // Dessiner les contours de la grille (en gras) diff --git a/Main.class b/Main.class index 2a14126e61a861b8401a11059e1789c1921fb904..90fd4f09d7f299952410e63e624e15e8d9d53801 100644 GIT binary patch delta 478 zcmY+A%}!HM6otRjAJ6IO!32p0v{KrFwo)i4S_KhNP{3M$Dkv7vhTcRlDG6TDfyOv- zC?PjI2%20IO?&_+#-UH(z=3aIJjWS(uy)p7D{CeDSK_CB^X>2FuRxi{njQ)XPSLL@ zY6ck8lo(PBOHM1!Xe1*J&PvW{l9VOq6&EyZj3`DWW14mf4lYW@6_=cQLUCC#s_A6X zS+BU`RR>cRl1wYENv=y~c3!V0Gh`*RhBV;eJPW~hk?Wo3z7=a5&;2J(d|+7Qp`lLJu*9-qg-0Jvq$#G_^7Z;` z<$ugrVL{N|Xf`KT{k4r&W$l^owY*J1HeXq9Y&A-a7k+grzaw}Wt#zdB@7zQX zwlQll7yO7G$@JRW0m~pxf<8_-#j-z^OS`uN6T)|Wu?78X8$ zm92!euV5waJ&WJTIsY?$x<8Sd_rKRSAj`f>Elm-cX>n+EX`|gGO@~9Lq|2e(MUpY- zk@UJ0(t<*^7velV9kFNIcuE_|4VqWbvCuQb#`@m zqSzv-*k(tu%ifC@IuibewOU@IA2b$1=>DW;ou9EQQz@M*(h-D-P>*L69erczYvIm6 zu}{5pKvh}=5dP*amrJgfCaqe3rPkJ3FK02J1s|edW#fUF`+FaLgZE_d3+e+U3 zOMLNJuvUD?AK-uBzapZ}Zi7^ig_+rJXTEP{_S>(o69D%S2PolU89puvwagvY5gm^me8R=I0bO--HZ6oF@ITC56vCO|!0yDwk!!z=CI%Z7kxf@jZwZ^x5 zjJxcs@d+rteGDgFKZg5}A;KKnc@)@|*p~SOTsp%q^Efvp*hkS4Y`72W@h3Qw_gH1` zenz2w*EPsrH~9kZokJgfe?Ltq8WqQ?EWqQq#@usQW515`+}Z`UFhl%=LqGUOh#^z5 F@CT|EjMo4F literal 0 HcmV?d00001 diff --git a/Reset.java b/Reset.java new file mode 100644 index 0000000..7030942 --- /dev/null +++ b/Reset.java @@ -0,0 +1,22 @@ +import javax.swing.*; +import java.awt.event.*; + +public class Reset implements ActionListener { + private int[][] grid; + private Enter enterPanel; + + public Reset(int[][] grid, Enter enterPanel) { + this.grid = grid; + this.enterPanel = enterPanel; + } + + @Override + public void actionPerformed(ActionEvent e) { + // Réinitialiser la grille en copiant la grille initiale + for (int i = 0; i < grid.length; i++) { + System.arraycopy(enterPanel.getInitialGrid()[i], 0, grid[i], 0, grid[i].length); + } + // Redessiner le panneau + enterPanel.repaint(); + } +}