Skip to content

Commit 65c32b6

Browse files
authored
Merge branch 'master' into exercise-categorisations
2 parents 513c3d7 + 7e82010 commit 65c32b6

File tree

47 files changed

+260
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+260
-132
lines changed

config/exercise_readme.go.tmpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@
22

33
{{ .Spec.Description -}}
44
{{- with .Hints }}
5+
56
## Hint
67

78
{{ . }}
89
{{ end }}
910

1011
## Downloading
1112

12-
To download this exercise in Pharo, type: `{{ .Spec.Slug }}` into the `Exercism | Fetch Exercise` package menu prompt (right click on the Exercism package in the Pharo System Browser). You can also submit your solution from the same menu for any selected package. You don't normally need to use the exercism cli (as indicated on the right hand panel).
13+
To download this exercise in Pharo, type: `{{ .Spec.Slug }}` into the `Exercism | Fetch new exercise` top menu prompt (or right click on any `Exercise@<Name>` package in the Pharo System Browser).
14+
15+
When you are finished writing and testing your solution, and want to submit it, you should right click on the `Exercise@{{ .Spec.MixedCaseName }}` package and choose `Exercism | Submit exercise` in the context menu. You DON'T use the exercism cli (as indicated on the right hand panel).
1316

1417
## Running The Tests
1518

1619
Tests can be run directly from the Pharo IDE, by clicking on the test orb next to any test.
1720
The SUnit convention is that the provided `{{ .Spec.MixedCaseName }}Test`, will test the functionality of `{{ .Spec.MixedCaseName }}`.
1821

19-
If you are still stuck, the track documentation has more detailed help on [running tests](https://exercism.io/tracks/pharo/tests).
22+
If you are still stuck, the track documentation has detailed help for [running tests](https://exercism.io/tracks/pharo/tests).
2023

2124
## Language and Environment Help
2225

dev/src/Exercise@Die/DieHandleTest.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ DieHandleTest >> testRoll [
3737

3838
{ #category : #tests }
3939
DieHandleTest >> testSimpleHandle [
40-
self assert: 2 D20 diceNumber equals: 2.
40+
self assert: 2 d20 diceNumber equals: 2.
4141
]
4242

4343
{ #category : #tests }
4444
DieHandleTest >> testSumming [
4545

4646
| handle |
47-
handle := 2 D20 + 3 D10.
47+
handle := 2 d20 + 3 d10.
4848
self assert: handle diceNumber equals: 5.
4949
]
5050

5151
{ #category : #tests }
5252
DieHandleTest >> testSummingAndRolling [
5353

5454
| handle |
55-
handle := 2 D20 + 3 D10.
55+
handle := 2 d20 + 3 d10.
5656
self assert: handle diceNumber equals: 5.
5757
100 timesRepeat:
5858
[ handle roll between: 5 and: 70 ]

dev/src/Exercise@Die/Integer.extension.st

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
Extension { #name : #Integer }
22

33
{ #category : #'*Exercise@Die' }
4-
Integer >> D10 [
5-
^ self D: 10
4+
Integer >> d10 [
5+
^ self d: 10
66
]
77

88
{ #category : #'*Exercise@Die' }
9-
Integer >> D2 [
10-
^ self D: 3
9+
Integer >> d2 [
10+
^ self d: 3
1111
]
1212

1313
{ #category : #'*Exercise@Die' }
14-
Integer >> D20 [
15-
^ self D: 20
14+
Integer >> d20 [
15+
^ self d: 20
1616
]
1717

1818
{ #category : #'*Exercise@Die' }
19-
Integer >> D4 [
20-
^ self D: 4
19+
Integer >> d4 [
20+
^ self d: 4
2121
]
2222

2323
{ #category : #'*Exercise@Die' }
24-
Integer >> D6 [
25-
^ self D: 6
24+
Integer >> d6 [
25+
^ self d: 6
2626
]
2727

2828
{ #category : #'*Exercise@Die' }
29-
Integer >> D: anInteger [
29+
Integer >> d: anInteger [
3030

3131
| handle |
3232
handle := DieHandle new.

dev/src/Exercise@HelloWorld/HelloWorldTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If everything goes well, you will be ready to fetch your first real exercise
2020
If you are editting this file in a text editor and not in Pharo -
2121
please review the [Getting Started](https://exercism.io/tracks/pharo/installation) section.
2222

23-
While you can use a text editor, the Pharo IDE is partly what makes the langauge so special.
23+
While you can use a text editor, the Pharo IDE is partly what makes the language so special.
2424

2525
In Pharo you can run code (including tests) with broken methods and missing classes. When the VM encounters broken code, it raises a debugger which lets you explore the problem a little better.
2626

dev/src/ExercismDev/ExercismExerciseGenerator.class.st

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,11 @@ ExercismExerciseGenerator >> generateTestMethodsOn: testClass calling: testVaria
330330
{ #category : #generation }
331331
ExercismExerciseGenerator >> generateTestNamed: testName in: aClass variable: variableName selector: aSelectorPrefix parameters: testParameters expecting: testResults [
332332
| output src |
333+
333334
output := (WriteStream on: '').
334-
output nextPutAll: testName; cr; tab; nextPutAll: '| result |'; cr; cr.
335+
output << testName; crlf.
336+
testCounter = 1 ifTrue: [ output tab << '"Tip: Remember to review the class [Comment] tab"' ; crlf].
337+
output tab << '| result |'; crlf; crlf.
335338

336339
(self isErrorAssertion: testResults)
337340
ifTrue: [ self

dev/src/ExercismTests/ExercismExerciseTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ ExercismExerciseTest >> testUnlockReference [
204204
{ #category : #tests }
205205
ExercismExerciseTest >> testUnlockedExercises [
206206

207-
self assertCollection: HelloWorldTest exercise unlockedExercises asArray equals: {DieTest exercise }.
207+
self assertCollection: HelloWorldTest exercise unlockedExercises asArray equals: {} .
208208
self assertCollection: TwoFerTest exercise unlockedExercises asArray
209209
includesAll: {ResistorColorDuoTest exercise. SpaceAgeTest exercise}.
210210
]

docs/INSTALLATION.md

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## Installation
22

33
The simplest way to install [Pharo](http://pharo.org) is to use a [zero conf](http://pharo.org/download#//*[@id="main"]/div/h2[3]) download from a terminal command line.
4-
<br/>_Note: If you are trying to upgrade an existing installation see the [upgrade instructions](https://github.com/exercism/pharo-smalltalk/blob/master/docs/UPGRADE.md).
4+
<br/>_Note: If you are trying to upgrade an existing installation see the [upgrade instructions](https://github.com/exercism/pharo-smalltalk/blob/master/docs/UPGRADE.md)._
55

66
Windows users who do not have a UNIX style shell installed should skip to the [Windows Installation](#windows-installation-skip-for-osxlinux) instructions (below).<br/>
7-
More advanced Linux users may also want to refer to the [Linux Hackers Installation](#linux-hackers-installation-for-advanced-linux-use-only) (below).
7+
More advanced Linux users may want to refer to the [Linux Hackers Installation](https://github.com/exercism/pharo-smalltalk/blob/master/docs/LINUX.md).
88

99
### Linux/OSX Installation
1010

@@ -75,39 +75,8 @@ Then evaluate the pasted code by highlighting all of it, right clicking then sel
7575

7676
If everything is working properly, you should see loading progress bars flicker across the screen, and then a System Browser window will appear.
7777

78-
Now you can you can proceed below to **[Getting Started](#getting-started)**.
7978

80-
### Linux Hackers Installation (for advanced Linux use only)
81-
82-
We are still working out the best instructions here, but we know (and appreciate) that many Linux developers are very discerning when it comes to what they install and where things should go.
83-
84-
The following instructions are very WIP and based on ArchLinux but may apply to your distro (and if they don't help us figure out improvements, and possibly upstream Pharo requests too). _Note: its not yet clear if these instructions work reliably, so we would appreciate any help to improve them._
85-
86-
- Install a Pharo VM into your preferred location. You might be able to use one in AUR or equivalent if pharo 7 is listed in there, OR alternatively download one from: [https://files.pharo.org/vm/pharo-spur64/linux/] (and choose a stable-timer vm)
87-
- You next need to extract a Pharo.image file to place in your exercism directory. You can obtain this from: [https://files.pharo.org/image/70/] and pick the latest 64 bit zip file.
88-
- Now try a simple command line test to verify if the VM and Image are working: `pharo Pharo.image eval "100 factorial"`. If all is well, you should get an answer.
89-
- Now try the "load script" described in the OSX section. You may find you get an error mentioning `libgit2`, if this is the case you should also install it and try again. We have also had reports that installing `libcurl-gnutls` can help (but this is not yet proven)
90-
- We have also had reports that for some libgit2 failures there is an internal loadModule change that we may backport from the development pharo. In this case you need to replace the method `unixModuleName` in Class `LGitLibrary` as follows:
91-
1. Launch a headfull Pharo by typing `pharo-ui Pharo.image`
92-
1. Press Ctrl-Space and type `unixModuleName`
93-
1. Select the `LGitLibrary >> unixModuleName` entry and press enter
94-
1. In the resulting browser, replace the method source for `unixModuleName` with the following (copy and paste it), press save (ctrl-s), and finally save and exit pharo.
95-
```
96-
LGitLibrary >> unixModuleName
97-
| pluginDir |
98-
pluginDir := Smalltalk vm binary parent.
99-
#('libgit2.so' 'libgit2.so.0')
100-
detect: [ :each | (pluginDir / each) exists ]
101-
ifFound: [ :libName | ^ (pluginDir / libName) fullName ].
102-
103-
self error: 'Module not found.'
104-
```
105-
106-
Now retry the aforementioned OSX exercism "load script". If everything is working properly, you should see loading progress bars flicker across the screen, and then a System Browser window will appear. If not, please visit the Pharo Discord (as outlined above).
107-
108-
Now you can you can proceed below to **[Getting Started](#getting-started)**.
109-
110-
## Getting Started
79+
## Getting Started (ALL)
11180

11281
When you launch Pharo, you will see a Welcome project, in a [System Browser](https://medium.com/@richardeng/pharo-quick-start-5bab70944ce2#3099) (_tip:_ if you ever lose this window you can open a new one from the Tools|System Browser menu).
11382

docs/LINUX.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Linux Hackers Installation (for advanced Linux use only)
2+
3+
We are still working out the best instructions here, but we know (and appreciate) that many Linux developers are very discerning when it comes to what they install and where things should go.
4+
5+
_If you do want to stick to a standard install, just return and follow [the normal setup](https://exercism.io/tracks/pharo-smalltalk/installation)._
6+
7+
The following instructions are very WIP and based on ArchLinux but may apply to your distro (and if they don't help us figure out improvements, and possibly upstream Pharo requests too). _Note: its not yet clear if these instructions work reliably, so we would appreciate any help to improve them._
8+
9+
- Install a Pharo VM into your preferred location. You might be able to use one in AUR or equivalent if pharo 7 is listed in there, OR alternatively download one from: [https://files.pharo.org/vm/pharo-spur64/linux/] (and choose a stable-timer vm)
10+
- You next need to extract a Pharo.image file to place in your exercism directory. You can obtain this from: [https://files.pharo.org/image/70/] and pick the latest 64 bit zip file.
11+
- Now try a simple command line test to verify if the VM and Image are working: `pharo Pharo.image eval "100 factorial"`. If all is well, you should get an answer.
12+
- Now try the "load script" described in the OSX section. You may find you get an error mentioning `libgit2`, if this is the case you should also install it and try again. We have also had reports that installing `libcurl-gnutls` can help (but this is not yet proven)
13+
- We have also had reports that for some libgit2 failures there is an internal loadModule change that we may backport from the development pharo. In this case you need to replace the method `unixModuleName` in Class `LGitLibrary` as follows:
14+
1. Launch a headfull Pharo by typing `pharo-ui Pharo.image`
15+
1. Press Ctrl-Space and type `unixModuleName`
16+
1. Select the `LGitLibrary >> unixModuleName` entry and press enter
17+
1. In the resulting browser, replace the method source for `unixModuleName` with the following (copy and paste it), press save (ctrl-s), and finally save and exit pharo.
18+
```
19+
LGitLibrary >> unixModuleName
20+
| pluginDir |
21+
pluginDir := Smalltalk vm binary parent.
22+
#('libgit2.so' 'libgit2.so.0')
23+
detect: [ :each | (pluginDir / each) exists ]
24+
ifFound: [ :libName | ^ (pluginDir / libName) fullName ].
25+
26+
self error: 'Module not found.'
27+
```
28+
29+
Now retry the aforementioned OSX exercism "load script". If everything is working properly, you should see loading progress bars flicker across the screen, and then a System Browser window will appear. If not, please visit the Pharo Discord (as outlined above).
30+
31+
Now you should return and follow the remaining [Getting Started Instructions](https://exercism.io/tracks/pharo-smalltalk/installation).

exercises/acronym/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,24 @@ Techies love their TLA (Three Letter Acronyms)!
77
Help generate some jargon by writing a program that converts a long name
88
like Portable Network Graphics to its acronym (PNG).
99

10+
1011
## Hint
1112

1213
Try to find a way to split up a String and then iterate over the resulting sections to output a result.
1314

1415

1516
## Downloading
1617

17-
To download this exercise in Pharo, type: `acronym` into the `Exercism | Fetch Exercise` package menu prompt (right click on the Exercism package in the Pharo System Browser). You can also submit your solution from the same menu for any selected package. You don't normally need to use the exercism cli (as indicated on the right hand panel).
18+
To download this exercise in Pharo, type: `acronym` into the `Exercism | Fetch new exercise` top menu prompt (or right click on any `Exercise@<Name>` package in the Pharo System Browser).
19+
20+
When you are finished writing and testing your solution, and want to submit it, you should right click on the `Exercise@Acronym` package and choose `Exercism | Submit exercise` in the context menu. You DON'T use the exercism cli (as indicated on the right hand panel).
1821

1922
## Running The Tests
2023

2124
Tests can be run directly from the Pharo IDE, by clicking on the test orb next to any test.
2225
The SUnit convention is that the provided `AcronymTest`, will test the functionality of `Acronym`.
2326

24-
If you are still stuck, the track documentation has more detailed help on [running tests](https://exercism.io/tracks/pharo/tests).
27+
If you are still stuck, the track documentation has detailed help for [running tests](https://exercism.io/tracks/pharo/tests).
2528

2629
## Language and Environment Help
2730

exercises/allergies/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,24 @@ allergens that score 256, 512, 1024, etc.). Your program should
2929
ignore those components of the score. For example, if the allergy
3030
score is 257, your program should only report the eggs (1) allergy.
3131

32+
3233
## Hint
3334

3435
Notice how each of the items is a power of 2, a property that you should be able to leverage.
3536

3637

3738
## Downloading
3839

39-
To download this exercise in Pharo, type: `allergies` into the `Exercism | Fetch Exercise` package menu prompt (right click on the Exercism package in the Pharo System Browser). You can also submit your solution from the same menu for any selected package. You don't normally need to use the exercism cli (as indicated on the right hand panel).
40+
To download this exercise in Pharo, type: `allergies` into the `Exercism | Fetch new exercise` top menu prompt (or right click on any `Exercise@<Name>` package in the Pharo System Browser).
41+
42+
When you are finished writing and testing your solution, and want to submit it, you should right click on the `Exercise@Allergies` package and choose `Exercism | Submit exercise` in the context menu. You DON'T use the exercism cli (as indicated on the right hand panel).
4043

4144
## Running The Tests
4245

4346
Tests can be run directly from the Pharo IDE, by clicking on the test orb next to any test.
4447
The SUnit convention is that the provided `AllergiesTest`, will test the functionality of `Allergies`.
4548

46-
If you are still stuck, the track documentation has more detailed help on [running tests](https://exercism.io/tracks/pharo/tests).
49+
If you are still stuck, the track documentation has detailed help for [running tests](https://exercism.io/tracks/pharo/tests).
4750

4851
## Language and Environment Help
4952

0 commit comments

Comments
 (0)