[Cuis-dev] Hello, new Cuis smalltalk user here!
cuis.01 at klix.ch
Sat Jul 17 01:38:24 PDT 2021
Let me explain ...
On 7/17/21 3:06 AM, Joseph Turco via Cuis-dev wrote:
> Hello Hilaire.
> You mentioned about me looking for anything in the book, and I do have one thing to mention. Some of the exercises are kinda difficult and I've had to goto the solution. Most of them made sense after looking at the solution, but some of them I don't understand. For example.
> Exercise 4.9
> ($A to: $Z) collect [:c | (c asciiValue - 65 + 3 \\ 26 + 65) asCharacter] .
For each character from A to Z
take its asciiValue subtract the assciValue of A (65) add 3
compute the remainder (\\) wrt. 26 (the number of characters from A to
Z) and add the asciiValue of A. Finally convert the integer
back to a character (asCharacter).
It would be more instructive if you write it this way:
| numberOfCharacters asciiValueOfA |
numberOfCharacters _ ($Z asciiValue - $A asciiValue).
asciiValueOfA _ $A asciiValue.
($A to: $Z) collect: [ :character |
(character asciiValue - asciiValueOfA + 3 \\ numberOfCharacters +
> I have no clue how that math calculation works at all.
Juan, Hilaire, Ken:
Would it make sense to add arithmetic to characters?
> Sent from ProtonMail mobile
> -------- Original Message --------
> On Jul 15, 2021, 11:40 AM, Hilaire Fernandes via Cuis-dev wrote:
>> Hi Joseph,
>> As your eyes are new on the book. It will be very useful to let us know about any issue or misunderstanding you encounter while struding the book.
>> Happy reading
>> Le 15/07/2021 à 16:01, Joseph Turco via Cuis-dev a écrit :
>>> Oh wow thanks! I downloaded the book and it seems like its a lot better suited. I'll follow that instead.
>> GNU Dr. Geo
More information about the Cuis-dev