--- Begin Message --- oke, then I would work with hour and minutes as the challenge wanted,
So still on the class side make code that convert any given hour and minute to a valid one ?
Yes. Such code would also be used when doing arithmetic with Times. e.g. if you were to implement an instance method named #addMinutes:, its implementation would be as simple as ^Time hours: self hours minutes: self minutes + anInteger (assuming the argument has that name). The instance creation method would normalize the new requested time, just like Time hours: 0 minutes: 70 would do.
Roelof
On some way I think or I do something wrong or I did misunderstood you.
I did this in Pharo
Object subclass: #Clock
instanceVariableNames: 'hour minute'
classVariableNames: ''
package: 'Exercise@Clock'
I made a asscesors on the instance side.
then I did this on the class side :
hour: anInteger minute: anInteger2
self hour: anInteger2 % 60 + anInteger;
self minute: anInteger2 / 60;
yourself.
but I see a message that hour and minutes are not known.
Roelof
--- End Message ---
Re: [Pharo-users] mentoring contined I hope
Roelof Wobben via Pharo-users Tue, 01 Sep 2020 10:11:58 -0700
- [Pharo-users] mentoring contined I hope Roelof Wobben via Pharo-users
- Re: [Pharo-users] mentoring contined I ... Richard O'Keefe
- Re: [Pharo-users] mentoring contined I ... Richard Sargent
- Re: [Pharo-users] mentoring contine... Roelof Wobben via Pharo-users
- Re: [Pharo-users] mentoring contine... Richard Sargent
- Re: [Pharo-users] mentoring con... Roelof Wobben via Pharo-users
- Re: [Pharo-users] mentoring con... Richard Sargent
- Re: [Pharo-users] mentoring... Roelof Wobben via Pharo-users
- Re: [Pharo-users] mentoring... Roelof Wobben via Pharo-users