From d1a50b942ce7d2c614a43875893eec4495aedebb Mon Sep 17 00:00:00 2001 From: Emil Botezatu Date: Sun, 23 Jun 2024 19:44:05 +0200 Subject: [PATCH 1/2] =?UTF-8?q?texturen=20f=C3=BCr=20executecontrols?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .squot-materialize | 69 ++++++++++++------ assets/pause.png | Bin 0 -> 171 bytes assets/play.png | Bin 0 -> 191 bytes assets/stop.png | Bin 0 -> 487 bytes .../SKExecuteControls.class.st | 29 ++++---- src/SqueakKara-Core/SKExecuter.class.st | 4 +- 6 files changed, 60 insertions(+), 42 deletions(-) create mode 100644 assets/pause.png create mode 100644 assets/play.png create mode 100644 assets/stop.png diff --git a/.squot-materialize b/.squot-materialize index 325218c..af24640 100644 --- a/.squot-materialize +++ b/.squot-materialize @@ -1,64 +1,85 @@ [ + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'Cloverleaf.png' + ], + #encoding : Class [ #PNGReadWriter ] + }, + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'play.png' + ], + #encoding : @4 + }, SquotTonelMapper { #package : MCPackage { - #name : 'BaselineOfSqueakKara' + #name : 'SqueakKara-Tests' }, #path : FSAbsolutePath [ 'src' ] }, - SquotTonelMapper { - #package : MCPackage { - #name : 'SqueakKara-Core' - }, - #path : @4 + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'stop.png' + ], + #encoding : @4 + }, + SquotImageMapper { + #path : FSAbsolutePath [ + 'assets', + 'Kara-FacingUp.png' + ], + #encoding : @4 }, SquotTonelMapper { #package : MCPackage { - #name : 'SqueakKara-Tests' + #name : 'SqueakKara-Core' }, - #path : @4 + #path : @9 }, SquotImageMapper { #path : FSAbsolutePath [ 'assets', - 'Trunk.png' + 'pause.png' ], - #encoding : Class [ #PNGReadWriter ] + #encoding : @4 }, SquotImageMapper { #path : FSAbsolutePath [ 'assets', - 'Cloverleaf.png' + 'Trunk.png' ], - #encoding : Class [ #PNGReadWriter ] + #encoding : @4 }, SquotImageMapper { #path : FSAbsolutePath [ 'assets', - 'Kara-FacingUp.png' + 'Kara-FacingLeft.png' ], - #encoding : Class [ #PNGReadWriter ] + #encoding : @4 + }, + SquotTonelMapper { + #package : MCPackage { + #name : 'BaselineOfSqueakKara' + }, + #path : @9 }, SquotImageMapper { #path : FSAbsolutePath [ 'assets', 'Kara-FacingRight.png' ], - #encoding : Class [ #PNGReadWriter ] + #encoding : @4 }, SquotImageMapper { #path : FSAbsolutePath [ 'assets', 'Kara-FacingDown.png' ], - #encoding : Class [ #PNGReadWriter ] - }, - SquotImageMapper { - #path : FSAbsolutePath [ - 'assets', - 'Kara-FacingLeft.png' - ], - #encoding : Class [ #PNGReadWriter ] + #encoding : @4 } -] +] \ No newline at end of file diff --git a/assets/pause.png b/assets/pause.png new file mode 100644 index 0000000000000000000000000000000000000000..99e08d82850a6cade43eb90542211d76213f9def GIT binary patch literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjMV>B>Ar*1S5(>+y9-PT`uR>%&<#&!c#|+T~d4O9InloVIk;jyi57hr)Prs zjE1v13y+-meh`ipd}llnFhNbC_bmH~PbxndSpFq5K3O68vq6J_;S+Z>+XXg9Z=mfA Mp00i_>zopr0BxE>yZ`_I literal 0 HcmV?d00001 diff --git a/assets/play.png b/assets/play.png new file mode 100644 index 0000000000000000000000000000000000000000..9cb77e636ac6bb1149579625e9300f492da21f92 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjZJsWUAr*0Vr$+J~P!M39*ur=u zAz^Pq!qF=Zs=1f@eK|DUPgTpm<(hG_pzXh(SCV1cV$QrBuQDyg7mH3Qn$c0@wWmSt zBU8NEjwQMc-t)K?Op0UlG16-ANMpS{=_-@_DY-pu>*p-e{qaUF=dioEB-8u7t_Bs+ p4DHuhMJoO-4t(%6;Nkok+$YOYcD#7z^a$u822WQ%mvv4FO#l-`Nc#W) literal 0 HcmV?d00001 diff --git a/assets/stop.png b/assets/stop.png new file mode 100644 index 0000000000000000000000000000000000000000..6d76482437dcd8c5bbcfa488cb1850727a373c72 GIT binary patch literal 487 zcmV;rE}$TI~u{r4DFvv+1E;H=t?P zXf#~3+aqYLTNuU+oz4Rs=Mkp401Gzo`_Gt6-VpF_T3@<>bU^S6?S{i0==umP4(}QB z1nwsAAc)XU;k40g_9bFca-az~DIf1Bzvs$BSQb~#HW@r%k$^KkDmx&!p2ad3a5q!F z*;CF~jOp}U-GMHZ_ar=oX)SZ`AcIE&?)z(X2NaPZGj|d=Ic1^t35#IdOH9B002ovPDHLkV1gln+}QvC literal 0 HcmV?d00001 diff --git a/src/SqueakKara-Core/SKExecuteControls.class.st b/src/SqueakKara-Core/SKExecuteControls.class.st index 5246a02..524424a 100644 --- a/src/SqueakKara-Core/SKExecuteControls.class.st +++ b/src/SqueakKara-Core/SKExecuteControls.class.st @@ -12,16 +12,15 @@ Class { { #category : #widgets, - #'squeak_changestamp' : 'EB 6/22/2024 15:05' + #'squeak_changestamp' : 'EB 6/23/2024 19:42' } SKExecuteControls >> actionRun [ - |dict label texture| + |dict texture| dict := Dictionary new. - dict at: #terminated put:[self environment run. label := 'pause'. texture := self pauseTextureFilename]. - dict at: #suspended put:[self environment resume. label := 'pause'. texture := self pauseTextureFilename]. - dict at: #running put:[self environment pause. label := 'resume'. texture := self runTextureFilename]. + dict at: #terminated put:[self environment run. texture := self pauseTextureFilename]. + dict at: #suspended put:[self environment resume. texture := self pauseTextureFilename]. + dict at: #running put:[self environment pause. texture := self runTextureFilename]. (dict at: self environment executerState) value. - self buttonRun label: label. self buttonRunSetTexture: texture. ] @@ -70,12 +69,11 @@ SKExecuteControls >> addWidgetCentered: aWidget atXPosition: aXValue [ { #category : #widgets, - #'squeak_changestamp' : 'EB 6/22/2024 15:00' + #'squeak_changestamp' : 'EB 6/23/2024 19:41' } SKExecuteControls >> buildButtonRun [ ^IconicButton new - label: 'run'; target: self; actionSelector: #actionRun; color: Color lightGray. @@ -83,12 +81,11 @@ SKExecuteControls >> buildButtonRun [ { #category : #widgets, - #'squeak_changestamp' : 'EB 6/22/2024 15:00' + #'squeak_changestamp' : 'EB 6/23/2024 19:42' } SKExecuteControls >> buildButtonStop [ ^ IconicButton new - label: 'stop'; target: self; actionSelector: #actionStop; color: Color lightGray @@ -218,20 +215,20 @@ SKExecuteControls >> initialize [ { #category : #texture, - #'squeak_changestamp' : 'EB 6/22/2024 15:02' + #'squeak_changestamp' : 'EB 6/23/2024 19:40' } SKExecuteControls >> pauseTextureFilename [ - ^'Trunk.png' + ^'pause.png' ] { #category : #texture, - #'squeak_changestamp' : 'EB 6/22/2024 14:55' + #'squeak_changestamp' : 'EB 6/23/2024 19:40' } SKExecuteControls >> runTextureFilename [ - ^'Trunk.png' + ^'play.png' ] { @@ -262,11 +259,11 @@ SKExecuteControls >> sliderSpeedValueChanged: aValue [ { #category : #texture, - #'squeak_changestamp' : 'EB 6/22/2024 15:02' + #'squeak_changestamp' : 'EB 6/23/2024 19:40' } SKExecuteControls >> stopTextureFilename [ - ^'Trunk.png' + ^'stop.png' ] { diff --git a/src/SqueakKara-Core/SKExecuter.class.st b/src/SqueakKara-Core/SKExecuter.class.st index d172825..5c0296b 100644 --- a/src/SqueakKara-Core/SKExecuter.class.st +++ b/src/SqueakKara-Core/SKExecuter.class.st @@ -81,14 +81,14 @@ SKExecuter >> executeBlock: aBlock [ { #category : #initialization, - #'squeak_changestamp' : 'EB 6/22/2024 15:07' + #'squeak_changestamp' : 'EB 6/22/2024 14:13' } SKExecuter >> initialize [ self kara: SKKaraDecorator new. self kara executer: self. self compiler: Compiler new. - self speed: 25. + self speed: 5. self state: #terminated. ^self ] From ef1cd69d2f46d3736843257718bbf6267b9af903 Mon Sep 17 00:00:00 2001 From: KarlDuda Date: Sun, 23 Jun 2024 20:25:26 +0200 Subject: [PATCH 2/2] Revert "Merge branch 'code-execution'" This reverts commit b3b2f9de81c01d1a9064ea41b0e6542d3556b4ad, reversing changes made to d1a50b942ce7d2c614a43875893eec4495aedebb. --- .squot-materialize | 16 +------- src/SqueakKara-Core/SKEnvironment.class.st | 36 +---------------- src/SqueakKara-Core/SKGrid.class.st | 45 ++-------------------- src/SqueakKara-Core/SKLandingPage.class.st | 8 ++-- 4 files changed, 9 insertions(+), 96 deletions(-) diff --git a/.squot-materialize b/.squot-materialize index e65251e..af24640 100644 --- a/.squot-materialize +++ b/.squot-materialize @@ -75,24 +75,10 @@ ], #encoding : @4 }, - SquotTonelMapper { - #package : MCPackage { - #name : 'SqueakKara-Tests' - }, - #path : FSAbsolutePath [ - 'src' - ] - }, - SquotTonelMapper { - #package : MCPackage { - #name : 'BaselineOfSqueakKara' - }, - #path : @16 - }, SquotImageMapper { #path : FSAbsolutePath [ 'assets', - 'Kara-FacingUp.png' + 'Kara-FacingDown.png' ], #encoding : @4 } diff --git a/src/SqueakKara-Core/SKEnvironment.class.st b/src/SqueakKara-Core/SKEnvironment.class.st index 8ff46f7..98f24e0 100644 --- a/src/SqueakKara-Core/SKEnvironment.class.st +++ b/src/SqueakKara-Core/SKEnvironment.class.st @@ -113,7 +113,7 @@ SKEnvironment >> initialize [ { #category : #initialization, - #'squeak_changestamp' : 'KD 6/23/2024 19:35' + #'squeak_changestamp' : 'JJG 6/18/2024 18:47' } SKEnvironment >> initializeWithChallenge1 [ @@ -123,40 +123,6 @@ SKEnvironment >> initializeWithChallenge1 [ self workspace: (SKWorkspace newWithKara: self kara). self executer: (SKExecuter new). (self executer kara) kara: self kara. - self executeControls: SKExecuteControls new. - executeControls environment: self. -] - -{ - #category : #initialization, - #'squeak_changestamp' : 'KD 6/23/2024 19:40' -} -SKEnvironment >> initializeWithChallenge2 [ - - - self grid: (SKGrid newWithExtent: 9 @ 2). - self kara: self grid challenge2. - self workspace: (SKWorkspace newWithKara: self kara). - self executer: (SKExecuter new). - (self executer kara) kara: self kara. - self executeControls: SKExecuteControls new. - executeControls environment: self. -] - -{ - #category : #initialization, - #'squeak_changestamp' : 'KD 6/23/2024 19:59' -} -SKEnvironment >> initializeWithChallenge3 [ - - - self grid: (SKGrid newWithExtent: 9 @ 3). - self kara: self grid challenge3. - self workspace: (SKWorkspace newWithKara: self kara). - self executer: (SKExecuter new). - (self executer kara) kara: self kara. - self executeControls: SKExecuteControls new. - executeControls environment: self. ] { diff --git a/src/SqueakKara-Core/SKGrid.class.st b/src/SqueakKara-Core/SKGrid.class.st index e58325b..d38f0c4 100644 --- a/src/SqueakKara-Core/SKGrid.class.st +++ b/src/SqueakKara-Core/SKGrid.class.st @@ -51,14 +51,14 @@ SKGrid >> addHorizontalLineAt: aCoordinate [ { #category : #texture, - #'squeak_changestamp' : 'KD 6/23/2024 19:52' + #'squeak_changestamp' : 'JJG 6/12/2024 16:40' } SKGrid >> addTexture [ 1 to: self gridHeight - 1 do: [:anInteger | - self addHorizontalLineAt: anInteger]. - 1 to: self gridWidth - 1 do: [:anInteger | self addVerticalLineAt: anInteger]. + 1 to: self gridWidth - 1 do: [:anInteger | + self addHorizontalLineAt: anInteger]. ] { @@ -140,45 +140,6 @@ SKGrid >> challenge1 [ ] -{ - #category : #challenges, - #'squeak_changestamp' : 'KD 6/23/2024 19:54' -} -SKGrid >> challenge2 [ - - SKTrunk newInGrid: self at: 3 @ 2. - SKTrunk newInGrid: self at: 5 @ 2. - SKTrunk newInGrid: self at: 7 @ 2. - - SKCloverleaf newInGrid: self at: 9 @ 2. - - ^SKKara newInGrid: self at: 1 @ 2. - -] - -{ - #category : #challenges, - #'squeak_changestamp' : 'KD 6/23/2024 19:59' -} -SKGrid >> challenge3 [ - - SKTrunk newInGrid: self at: 2 @ 1. - SKTrunk newInGrid: self at: 3 @ 1. - SKTrunk newInGrid: self at: 4 @ 1. - SKTrunk newInGrid: self at: 5 @ 1. - SKTrunk newInGrid: self at: 6 @ 1. - - SKTrunk newInGrid: self at: 4 @ 3. - SKTrunk newInGrid: self at: 5 @ 3. - SKTrunk newInGrid: self at: 6 @ 3. - SKTrunk newInGrid: self at: 7 @ 3. - SKTrunk newInGrid: self at: 8 @ 3. - SKTrunk newInGrid: self at: 9 @ 3. - - ^SKKara newInGrid: self at: 1 @ 2. - -] - { #category : #initialization, #'squeak_changestamp' : 'LK 5/24/2024 11:18' diff --git a/src/SqueakKara-Core/SKLandingPage.class.st b/src/SqueakKara-Core/SKLandingPage.class.st index 5afe465..fccd79d 100644 --- a/src/SqueakKara-Core/SKLandingPage.class.st +++ b/src/SqueakKara-Core/SKLandingPage.class.st @@ -16,21 +16,21 @@ SKLandingPage >> actionExample1 [ { #category : #actions, - #'squeak_changestamp' : 'KD 6/23/2024 19:42' + #'squeak_changestamp' : 'LK 6/21/2024 23:02' } SKLandingPage >> actionExample2 [ - SKEnvironment basicNew initializeWithChallenge2. + SKEnvironment basicNew initializeWithChallenge1. self delete ] { #category : #actions, - #'squeak_changestamp' : 'KD 6/23/2024 19:42' + #'squeak_changestamp' : 'LK 6/21/2024 23:02' } SKLandingPage >> actionExample3 [ - SKEnvironment basicNew initializeWithChallenge3. + SKEnvironment basicNew initializeWithChallenge1. self delete ]