From 66ece27e402a0c9a83f8500331546e22f6215af7 Mon Sep 17 00:00:00 2001 From: KD Date: Sun, 23 Jun 2024 21:02:04 +0200 Subject: [PATCH] new Challenges & Horizontal Line Bugfix --- src/SqueakKara-Core/SKEnvironment.class.st | 36 +++++++++++++++++- src/SqueakKara-Core/SKGrid.class.st | 44 ++++++++++++++++++++-- src/SqueakKara-Core/SKLandingPage.class.st | 8 ++-- 3 files changed, 80 insertions(+), 8 deletions(-) diff --git a/src/SqueakKara-Core/SKEnvironment.class.st b/src/SqueakKara-Core/SKEnvironment.class.st index 98f24e0..322b19b 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' : 'JJG 6/18/2024 18:47' + #'squeak_changestamp' : 'KD 6/23/2024 20:56' } SKEnvironment >> initializeWithChallenge1 [ @@ -123,6 +123,40 @@ 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 20:56' +} +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 20:57' +} +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 d38f0c4..88787f1 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' : 'JJG 6/12/2024 16:40' + #'squeak_changestamp' : 'KD 6/23/2024 20:58' } SKGrid >> addTexture [ 1 to: self gridHeight - 1 do: [:anInteger | - self addVerticalLineAt: anInteger]. - 1 to: self gridWidth - 1 do: [:anInteger | self addHorizontalLineAt: anInteger]. + 1 to: self gridWidth - 1 do: [:anInteger | + self addVerticalLineAt: anInteger]. ] { @@ -140,6 +140,44 @@ SKGrid >> challenge1 [ ] +{ + #category : #challenges, + #'squeak_changestamp' : 'KD 6/23/2024 20:58' +} +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 20: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 fccd79d..cd5f06c 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' : 'LK 6/21/2024 23:02' + #'squeak_changestamp' : 'KD 6/23/2024 20:59' } SKLandingPage >> actionExample2 [ - SKEnvironment basicNew initializeWithChallenge1. + SKEnvironment basicNew initializeWithChallenge2. self delete ] { #category : #actions, - #'squeak_changestamp' : 'LK 6/21/2024 23:02' + #'squeak_changestamp' : 'KD 6/23/2024 20:59' } SKLandingPage >> actionExample3 [ - SKEnvironment basicNew initializeWithChallenge1. + SKEnvironment basicNew initializeWithChallenge3. self delete ]