Skip to content

Commit

Permalink
adding an example of sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Sep 11, 2024
1 parent 71254bc commit b903361
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Chapters/Chapter2/chapter2.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ Output directory's default name is ''book-result'' but you can change it in the


![blue](figures/pharo.png width=30)
![jlklkjlk](figures/rmod.png width=30)
![jlklkjlk](figures/rmod.png width=30)


### Example of Sync

Now we can make sure that when we copy some code the checker will report to us if the code changed from the book.

```sync=true&origin=Point >> #degrees
degrees "Answer the angle the receiver makes with origin in degrees. right is 0; down is 90." | tan theta |
"I changed this method my friend so you should report it" ^ x = 0 ifTrue: [ y >= 0 ifTrue: [ 90.0 ] ifFalse: [ 270.0 ] ] ifFalse: [ tan := y asFloat / x asFloat. theta := tan arcTan. x >= 0 ifTrue: [ y >= 0 ifTrue: [ theta radiansToDegrees ] ifFalse: [ 360.0 + theta radiansToDegrees ] ] ifFalse: [ 180.0 + theta radiansToDegrees ] ]
```

Expand Down

0 comments on commit b903361

Please sign in to comment.