Laser-Game sect1 pg 26 problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Laser-Game sect1 pg 26 problem

Marco Segreto
Hi,

I'm new to squeak and was using the Laser-Game tutorial:
http://squeak.preeminent.org/tut2007/html/ and was on page 26 when I got
stuck: http://squeak.preeminent.org/tut2007/html/026.html.

I ran UnitTests right before completing this page and everything was
working fine so something with this page is making it now work. I put
MirrorCell, BlankCell and TargetCell as a subclass as Cell. Cell is a
subclass of Object. I created new methods leanLeft and leanRight under
mirror cell under a testing protocol. Under BlankCell I modified the
initializeExitSides method so it dislays the same as on the page and
added self leanLeft to the initialize method. I then moved all the other
methods out of BlankCell and put them in Cell.

These are the directions the page gives. When I run Unit Test I get 4
failures for 4 tests. It says that BlankCell(Object) doesnotundertand
#leanLeft. leanLeft was not set as an instance variable on any class and
accessors were not created for it. The instructions weren't very clear
on where to put everything. I wasn't sure where to put the
initializeExitSides method that was under BlankCell (if it was supposed
to be moved or not). I also wasn't sure which class initialize method I
was supposed to add "self leanLeft" to as it says to do at the bottom of
page 26.

This is my first post to the mailing list so please let me know if
theres anything more I should post or do to receive help.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Laser-Game sect1 pg 26 problem

Jerry Henderson
Hi, Marco

Looks like you're sending #leanLeft to a BlankCell object, but have the leanLeft method defined in MirrorCell, so the BlankCell object is not going to understand it. The pictures on page 26 show the "self leanLeft" fragment in the initialize method of MirrorCell .. not BlankCell.

As for the initializeExitSides method, both BlankCell and MirrorCell have such a method, but it's coded differently in each class. The method shown in the page 26 picture (lower left) is in MirrorCell.

Hope that helps.

--
Jerry

Marco Segreto wrote:
Hi,

I'm new to squeak and was using the Laser-Game tutorial: http://squeak.preeminent.org/tut2007/html/ and was on page 26 when I got stuck: http://squeak.preeminent.org/tut2007/html/026.html.

I ran UnitTests right before completing this page and everything was working fine so something with this page is making it now work. I put MirrorCell, BlankCell and TargetCell as a subclass as Cell. Cell is a subclass of Object. I created new methods leanLeft and leanRight under mirror cell under a testing protocol. Under BlankCell I modified the initializeExitSides method so it dislays the same as on the page and added self leanLeft to the initialize method. I then moved all the other methods out of BlankCell and put them in Cell.

These are the directions the page gives. When I run Unit Test I get 4 failures for 4 tests. It says that BlankCell(Object) doesnotundertand #leanLeft. leanLeft was not set as an instance variable on any class and accessors were not created for it. The instructions weren't very clear on where to put everything. I wasn't sure where to put the initializeExitSides method that was under BlankCell (if it was supposed to be moved or not). I also wasn't sure which class initialize method I was supposed to add "self leanLeft" to as it says to do at the bottom of page 26.

This is my first post to the mailing list so please let me know if theres anything more I should post or do to receive help.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners