Skip to content

Commit

Permalink
fun neue 2 Level und BugFix bei Griderstellung.
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Duda committed Jun 23, 2024
1 parent cd62e53 commit 9dc8c63
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 36 deletions.
56 changes: 32 additions & 24 deletions .squot-materialize
Original file line number Diff line number Diff line change
@@ -1,64 +1,72 @@
[
SquotTonelMapper {
#package : MCPackage {
#name : 'BaselineOfSqueakKara'
#name : 'SqueakKara'
},
#path : FSAbsolutePath [
'src'
]
},
SquotTonelMapper {
#package : MCPackage {
#name : 'SqueakKara-Core'
},
#path : @4
},
SquotTonelMapper {
#package : MCPackage {
#name : 'SqueakKara-Tests'
},
#path : @4
},
SquotImageMapper {
#path : FSAbsolutePath [
'assets',
'Trunk.png'
'Cloverleaf.png'
],
#encoding : Class [ #PNGReadWriter ]
},
SquotImageMapper {
#path : FSAbsolutePath [
'assets',
'Cloverleaf.png'
'Kara-FacingLeft.png'
],
#encoding : Class [ #PNGReadWriter ]
#encoding : @7
},
SquotImageMapper {
#path : FSAbsolutePath [
'assets',
'Kara-FacingUp.png'
'Kara-FacingDown.png'
],
#encoding : Class [ #PNGReadWriter ]
#encoding : @7
},
SquotImageMapper {
#path : FSAbsolutePath [
'assets',
'Kara-FacingRight.png'
],
#encoding : Class [ #PNGReadWriter ]
#encoding : @7
},
SquotTonelMapper {
#package : MCPackage {
#name : 'SqueakKara-Tests'
},
#path : FSAbsolutePath [
'src'
]
},
SquotTonelMapper {
#package : MCPackage {
#name : 'BaselineOfSqueakKara'
},
#path : @16
},
SquotImageMapper {
#path : FSAbsolutePath [
'assets',
'Kara-FacingDown.png'
'Kara-FacingUp.png'
],
#encoding : Class [ #PNGReadWriter ]
#encoding : @7
},
SquotImageMapper {
#path : FSAbsolutePath [
'assets',
'Kara-FacingLeft.png'
'Trunk.png'
],
#encoding : Class [ #PNGReadWriter ]
#encoding : @7
},
SquotTonelMapper {
#package : MCPackage {
#name : 'SqueakKara-Core'
},
#path : @16
}
]
]
36 changes: 35 additions & 1 deletion src/SqueakKara-Core/SKEnvironment.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ SKEnvironment >> initialize [

{
#category : #initialization,
#'squeak_changestamp' : 'JJG 6/18/2024 18:47'
#'squeak_changestamp' : 'KD 6/23/2024 19:35'
}
SKEnvironment >> initializeWithChallenge1 [

Expand All @@ -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 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.
]

{
Expand Down
8 changes: 4 additions & 4 deletions src/SqueakKara-Core/SKExecuteControls.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,20 @@ SKExecuteControls >> initialize [

{
#category : #texture,
#'squeak_changestamp' : 'EB 6/22/2024 15:02'
#'squeak_changestamp' : 'KD 6/23/2024 19:51'
}
SKExecuteControls >> pauseTextureFilename [

^'Trunk.png'
^'Kara-FacingUp.png'
]

{
#category : #texture,
#'squeak_changestamp' : 'EB 6/22/2024 14:55'
#'squeak_changestamp' : 'KD 6/23/2024 19:51'
}
SKExecuteControls >> runTextureFilename [

^'Trunk.png'
^'Cloverleaf.png'
]

{
Expand Down
45 changes: 42 additions & 3 deletions src/SqueakKara-Core/SKGrid.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ SKGrid >> addHorizontalLineAt: aCoordinate [

{
#category : #texture,
#'squeak_changestamp' : 'JJG 6/12/2024 16:40'
#'squeak_changestamp' : 'KD 6/23/2024 19:52'
}
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].
]

{
Expand Down Expand Up @@ -140,6 +140,45 @@ 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'
Expand Down
8 changes: 4 additions & 4 deletions src/SqueakKara-Core/SKLandingPage.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ SKLandingPage >> actionExample1 [

{
#category : #actions,
#'squeak_changestamp' : 'LK 6/21/2024 23:02'
#'squeak_changestamp' : 'KD 6/23/2024 19:42'
}
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 19:42'
}
SKLandingPage >> actionExample3 [

SKEnvironment basicNew initializeWithChallenge1.
SKEnvironment basicNew initializeWithChallenge3.
self delete
]

Expand Down

0 comments on commit 9dc8c63

Please sign in to comment.