Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion exercises/practice/acronym/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

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

Try to find a way to split up a String and then iterate over the resulting sections to output a result.
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
You may want to explore Number class and its methods in Pharo, and how to add to OrderedCollection in different order.
# Instructions append

## Hint

You may want to explore Number class and its methods in Pharo, and how to add to OrderedCollection in different order.
2 changes: 2 additions & 0 deletions exercises/practice/allergies/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Instructions append

## Implementation

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

Check out the 'bit manipulation' protocol of class Integer.
2 changes: 2 additions & 0 deletions exercises/practice/anagram/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Instructions append

## Implementation

You must return the anagrams in the same order as they are listed in the candidate words.

As with Isogram, it's worth browsing what data types are already available in the system.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

Browse the class Integer for some inspiration
## Hint

Browse the class Integer for some inspiration.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

This is a fun little exercise, just follow the tests.
## Note

This is a fun little exercise, just follow the tests.
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Instructions append

You may want to use objects of the same class that represent tree and subtrees (nodes). Try to use recursion method for adding and sorting nodes.
## Note

You may want to use objects of the same class that represent tree and subtrees (nodes).
Try to use recursion method for adding and sorting nodes.
4 changes: 3 additions & 1 deletion exercises/practice/binary/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

The ^ operation in Pharo is expressed as the descriptive keyword message #raisedTo:
## Note

The ^ operation in Pharo is expressed as the descriptive keyword message #raisedTo:
4 changes: 3 additions & 1 deletion exercises/practice/bowling/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

You will need to store some game state.
## Implementation

You will need to store some game state.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

For error cases during operations, see Error class hiearchy (class side) to find out how to signal exception with given message.
## Implementation

For error cases during operations, see Error class hiearchy (class side) to find out how to signal exception with given message.
4 changes: 3 additions & 1 deletion exercises/practice/clock/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

Try and encapsulate your implementation
## Implementation

Try and encapsulate your implementation.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

This is nicely suited for recursion
## Note

This is nicely suited for recursion.
4 changes: 3 additions & 1 deletion exercises/practice/diamond/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

Extract clear, single purpose methods to keep your solution understandable
## Note

Extract clear, single purpose methods to keep your solution understandable.
2 changes: 2 additions & 0 deletions exercises/practice/die/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

## Note

This exercise has been sourced from the book: Learning Object-Oriented Programming, Design and TDD with Pharo available at http://books.pharo.org. Chapter 12: Crafting a simple embedded DSL with Pharo.
4 changes: 3 additions & 1 deletion exercises/practice/etl/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

While readability is preferred over efficiency, there is a solution that avoids multiple input looksups when solving this.
## Note

While readability is preferred over efficiency, there is a solution that avoids multiple input looksups when solving this.
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Instructions append

Without using the built-in flattening method, you can derive your own, but you will need to differentiate between what is a collection and what is not. Alternatively, if you decide to use the built-in flattening methods, you will need to create a new Stream type to override incorrect behaviour.
## Note

Without using the built-in flattening method, you can derive your own, but you will need to differentiate between what is a collection and what is not.
Alternatively, if you decide to use the built-in flattening methods, you will need to create a new Stream type to override incorrect behaviour.
4 changes: 3 additions & 1 deletion exercises/practice/forth/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

It might take several classes and/or instances to model this
## Note

It might take several classes and/or instances to model this.
7 changes: 6 additions & 1 deletion exercises/practice/gigasecond/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
The Kernel-Chronology package has many useful date and time related classes and protocols. The Date and Time class have useful printing methods which you can use to create your own ISO8601 date and time representation.
# Instructions append

## Note

The Kernel-Chronology package has many useful date and time related classes and protocols.
The Date and Time class have useful printing methods which you can use to create your own ISO8601 date and time representation.
2 changes: 2 additions & 0 deletions exercises/practice/grade-school/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Instructions append

## Note

It isn't strictly necessary to model students as a separate object, you can use a convenient internal data structure as the requirements are quite simple (and as long as it doesn't leak out into the results).

~~~~exercism/note
Expand Down
8 changes: 7 additions & 1 deletion exercises/practice/grains/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Instructions append

These kinds of problems (where an answer is dependent on a previous) one are often called recursion. There are different ways to code for recursion, it might be worth reasearching if you are not familiar with this. Pharo is well optimised for recursion, and it is a commonly used pattern.Note: in the original problem specification, the grainsCalculator is called via #square, however we have renamed this method #atSquare: which is a more Smalltalk like name, that better describes that you are asking for an answer "at a square".
## Note

These kinds of problems (where an answer is dependent on a previous) one are often called recursion.
There are different ways to code for recursion, it might be worth reasearching if you are not familiar with this.
Pharo is well optimised for recursion, and it is a commonly used pattern.

Note: in the original problem specification, the grainsCalculator is called via #square, however we have renamed this method #atSquare: which is a more Smalltalk like name, that better describes that you are asking for an answer "at a square".
5 changes: 4 additions & 1 deletion exercises/practice/hamming/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Instructions append

In Smalltalk, exceptions are instances of subclasses of Exception. While you can create your own for your domain, if you browse this hierarchy you can choose something appropriate to simplify your solution.
## Note

In Smalltalk, exceptions are instances of subclasses of Exception.
While you can create your own for your domain, if you browse this hierarchy you can choose something appropriate to simplify your solution.
14 changes: 13 additions & 1 deletion exercises/practice/hello-world/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Instructions append

If you are editting this file in a text editor and not in Pharo - please review the [Getting Started](https://exercism.io/tracks/pharo/installation) section. While you can use a text editor, the Pharo IDE is partly what makes the language so special.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. You then have the option to press the Create button to add a missing class or method, as well as correct any code that causes an error. When you do so, the debugger will backup and let you resume execution with your new changes.Try doing this with your HelloWorld example, by simply running any one of the unit test methods.
## Note

If you are editting this file in a text editor and not in Pharo - please review the [Getting Started](https://www.exercism.org/tracks/pharo/installation) section.

While you can use a text editor, the Pharo IDE is partly what makes the language so special.

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.

You then have the option to press the Create button to add a missing class or method, as well as correct any code that causes an error.
When you do so, the debugger will backup and let you resume execution with your new changes.

Try doing this with your HelloWorld example, by simply running any one of the unit test methods.
4 changes: 3 additions & 1 deletion exercises/practice/high-scores/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

This is a nice exercise to just test drive (TDD), and let each test guide your solution
## Note

This is a nice exercise to just test drive (TDD), and let each test guide your solution.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

Use the lessons from previous exercises, try and keep your methods small
## Note

Use the lessons from previous exercises, try and keep your methods small.
4 changes: 3 additions & 1 deletion exercises/practice/isogram/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

There is a range of interesting data types in Pharo, it's worth taking the time to browse the hierarchy of class Collection and reading some of the class comments and running some of the examples.
## Note

There is a range of interesting data types in Pharo, it's worth taking the time to browse the hierarchy of class Collection and reading some of the class comments and running some of the examples.
15 changes: 14 additions & 1 deletion exercises/practice/leap/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Instructions append

The tests for this exercise (and future exercises), are prefix numbered like 'test00_'. This is not a normal convention in Pharo, however to ease the study of the language it is useful to present tests in a deterministic order.For this exercise, study the 'arithmetic' method category for class Number, as well as how boolean operators are also defined as messages. Notice how "and:" and "or:" are implented in the classes True and False. You can use the context menu item "senders of..." to view how other parts of Pharo use these operators.You may also find something useful trying... `World > Tools > Finder > Examples > 20 . 4 . true`<br> which is asking Pharo which operations between the first and second elements result in the third.<br> [View demo][demo][demo]: https://github.com/exercism/pharo-smalltalk/raw/master/docs/images/Hint-Finder-Leap.gif
## Note

The tests for this exercise (and future exercises), are prefix numbered like 'test00_'.
his is not a normal convention in Pharo, however to ease the study of the language it is useful to present tests in a deterministic order.

For this exercise, study the 'arithmetic' method category for class Number, as well as how boolean operators are also defined as messages.
Notice how "and:" and "or:" are implented in the classes True and False.
You can use the context menu item "senders of..." to view how other parts of Pharo use these operators.

You may also find something useful trying... `World > Tools > Finder > Examples > 20 . 4 . true` which is asking Pharo which operations between the first and second elements result in the third.

[View demo][demo]

[demo]: https://github.com/exercism/pharo-smalltalk/raw/master/docs/images/Hint-Finder-Leap.gif
4 changes: 3 additions & 1 deletion exercises/practice/luhn/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

Read the instructions carefully, if you skim you might miss some important details about direction.
## Note

Read the instructions carefully, if you skim you might miss some important details about direction.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

Saving state in a useful data type can help here.
## Note

Saving state in a useful data type can help here.
4 changes: 3 additions & 1 deletion exercises/practice/matrix/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

Try using the Finder - Examples searcher, to see if there is a useful method for parsing.
## Note

Try using the Finder - Examples searcher, to see if there is a useful method for parsing.
6 changes: 5 additions & 1 deletion exercises/practice/minesweeper/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Instructions append

x,y locations are often represented as a Point, which then leads to some useful point functions that can help with this. Alternatively, representing this as a 2D Array can also be useful. Either way, defining some descriptive extension methods that can make your solution much more readable and elegant.
## Note

x,y locations are often represented as a Point, which then leads to some useful point functions that can help with this.
Alternatively, representing this as a 2D Array can also be useful.
Either way, defining some descriptive extension methods that can make your solution much more readable and elegant.
6 changes: 5 additions & 1 deletion exercises/practice/ocr-numbers/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Instructions append

## Note

The following text could be parsed from this comment and used to recognize characters:
' _ _ _ _ _ _ _ _ '
' | _| _||_||_ |_ ||_||_|| |'
' ||_ _| | _||_| ||_| _||_|'
' '
' '
4 changes: 3 additions & 1 deletion exercises/practice/pangram/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

It pays off to carefully read the exercise description as this can simplify your solution and make it quite compact.
## Note

It pays off to carefully read the exercise description as this can simplify your solution and make it quite compact.
4 changes: 3 additions & 1 deletion exercises/practice/proverb/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

This one can be quite simple if you look at ways to iterate over the list of inputs.
## Note

This one can be quite simple if you look at ways to iterate over the list of inputs.
6 changes: 5 additions & 1 deletion exercises/practice/raindrops/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Instructions append

Try to focus on using Test Driven Development for this exercise. Run the tests, one by one and try to solve the problem incrementally as it unfolds. When everything passes, see if you can refactor it to make it less repetitive.
## Note

Try to focus on using Test Driven Development for this exercise.
Run the tests, one by one and try to solve the problem incrementally as it unfolds.
When everything passes, see if you can refactor it to make it less repetitive.
6 changes: 5 additions & 1 deletion exercises/practice/rectangles/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
You may be able to use a brute force strategy to solve this one.
# Instructions append

## Note

You may be able to use a brute force strategy to solve this one.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

You will need some form of lookup table of colours to calculate the value. You don't necessarily have to use a Dictionary to do this.
## Note

You will need some form of lookup table of colours to calculate the value. You don't necessarily have to use a Dictionary to do this.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

It's useful to consider having a seperate Robot oject and even write some of your own tests for it, possibly using TDD to drive out useful behaviour.
## Note

It's useful to consider having a seperate Robot oject and even write some of your own tests for it, possibly using TDD to drive out useful behaviour.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

This exercise uses techniques from several of the others, but also requires some conditional looping.
## Note

This exercise uses techniques from several of the others, but also requires some conditional looping.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

The Integer class has a bit manipulation protocol which may be useful.
## Note

The Integer class has a bit manipulation protocol which may be useful.
4 changes: 3 additions & 1 deletion exercises/practice/sieve/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

To make your solution readable, try using the refactoring tools to extract any meaningful sub-operation(s), and don't worry about using well named temporary variables.
## Note

To make your solution readable, try using the refactoring tools to extract any meaningful sub-operation(s), and don't worry about using well named temporary variables.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Instructions append

Try using arithmetic operations like modulo to wrap indexes, when exceeded. Character, String classes are your friends too.
## Note

Try using arithmetic operations like modulo to wrap indexes, when exceeded. Character, String classes are your friends too.
7 changes: 6 additions & 1 deletion exercises/practice/space-age/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Instructions append

You might find Pharo dictionaries useful in completing this exercise.Pharo has several ways to construct dictionaries, including `Dictionary new: at:put:`and a literal syntax using `Association`s. An `Association` looks like `key -> value`and can be turned into a dictionary like this: `{ 'key' -> 'value' } asDictionary`.Remember that in Smalltalk, all infix operators are right-associative and that youcan browse any of the classes mentioned above live.
## Note

You might find Pharo dictionaries useful in completing this exercise.
Pharo has several ways to construct dictionaries, including `Dictionary new: at:put:` and a literal syntax using `Association`s.
An `Association` looks like `key -> value` and can be turned into a dictionary like this: `{ 'key' -> 'value' } asDictionary`.
Remember that in Smalltalk, all infix operators are right-associative and that you can browse any of the classes mentioned above live.
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Instructions append

The trick to this exercise understanding how to iterate accross a range of numbers as well as check a Collection for any multiples that are divisible by a number. Try using the Spotter to look up potential classes and browse the categories of methods in those classes. Also remember that the Pharo environment is extensively cross referenced. You can right click on any class or method and browse "references" to a class (to see how it might be created), as well as "senders" of a method (to see how it might be used).
## Note

The trick to this exercise understanding how to iterate accross a range of numbers as well as check a Collection for any multiples that are divisible by a number.
Try using the Spotter to look up potential classes and browse the categories of methods in those classes.

Also remember that the Pharo environment is extensively cross referenced.
You can right click on any class or method and browse "references" to a class (to see how it might be created), as well as "senders" of a method (to see how it might be used).
7 changes: 6 additions & 1 deletion exercises/practice/tournament/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Instructions append

Build up this exercise piece by piece, and don't be afraid to split out any useful concepts into a new class. Previous exercises should give the foundation for a neat solution.It might also be helpfulnto review chapters on Object Oriented thinking, for example [Inside Smalltalk - Chapter 1](http://sdmeta.gforge.inria.fr/FreeBooks/InsideST/InsideSmalltalk.pdf) or [Smalltalk by Example - Chapter 9](http://sdmeta.gforge.inria.fr/FreeBooks/ByExample/11%20-%20Chapter%209%20-%20Object-Oriente.pdf)
## Note

Build up this exercise piece by piece, and don't be afraid to split out any useful concepts into a new class.
Previous exercises should give the foundation for a neat solution.

It might also be helpful to review chapters on Object Oriented thinking, for example [Inside Smalltalk - Chapter 1](http://sdmeta.gforge.inria.fr/FreeBooks/InsideST/InsideSmalltalk.pdf) or [Smalltalk by Example - Chapter 9](http://sdmeta.gforge.inria.fr/FreeBooks/ByExample/11%20-%20Chapter%209%20-%20Object-Oriente.pdf)
Loading
Loading