diff --git a/Chapters/Chapter2/chapter2.md b/Chapters/Chapter2/chapter2.md index 59ba6e4..115e009 100644 --- a/Chapters/Chapter2/chapter2.md +++ b/Chapters/Chapter2/chapter2.md @@ -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) \ No newline at end of file +![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 ] ] +``` +