--- Begin Message ---
I solved it but I think with ugly code on the class side.

solution
    | computer |
    computer := self new.
    computer readRam: computer masses.
    computer patchRam: 1 value: 12.
    computer patchRam: 2 value: 2.
    computer processData: computer ram.
    computer at: 0

Is there a way I can make this more smalltalk.

Roelof




Op 31-12-2019 om 12:36 schreef Roelof Wobben:
nope,

Then masses is still not understood , I tried that already and tried it a few moments ago.

Roelof



Op 31-12-2019 om 12:30 schreef jtuc...@objektfabrik.de:
Roelof,

I didn't import your code, just read the .st file in an editor, and I'm not an expert in Pharo source files, so maybe I overlooked something. I even don't have Pharo on this machine I'm sitting at. Still you seem to reference a variable called masses and send this as an argument to readRam. But I cannot find a method that would initialize this variable. Maybe what you wanted to write is

readRam: self masses

???
Without the self keyword, you are referencing some variable instead of sending a message. Is that your problem?

Joachim


Am 31.12.19 um 12:26 schrieb Roelof Wobben:
Thanks.

I think I misunderstood you.

There is a instance method called masses where all the numbers are mentioned. The class variable masses that I used there was just because masses were not understood but that one can be deleted.

Roelof



Op 31-12-2019 om 12:18 schreef jtuc...@objektfabrik.de:
I only skimmed over your code briefly. It seems you implemented a class method #masses which returns stuff, but never call that method. You reference the class var #masses which is never initialized.

So I guess there should be some place where you assign the return value of #masses to the masses variable....?

HTH

Joachim



Am 31.12.19 um 12:00 schrieb Roelof Wobben:
Hello,

Im still trying to make part1 of day2 working at a way I can also test things. the tests are working but when I call on the class side the method which should reed the masses which are on the instanc side , the masses cannnot be found.

So question 1 is why is masses not found.

and question 2  is how can I use the changed array at the process method so I can calculate the outcome.

Regards,

Roelof










--- End Message ---

Reply via email to