Quinto Game Example Code Not Working

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

Quinto Game Example Code Not Working

Dr. Zephy
I'm working through the Squeak by Example book and ran into a snag. The code on
page 33 for the Quinto game is returning an error message.
I have the SBECell selected and "-- all --" is highlighted in the right pane,
just like in the book, but it responds with the message "Unknown variable:
initialize   please correct or cancel:  / declare temp / declare instance /
cancel".

So I guess it doesn't  recognize "initialize" and thinks I'm trying to create a
variable? According to the book it should be recognized.

Here's the code:

initialize
        super initialize.
        self label: ''.
        self borderWidth: 2.
        bounds := 0@0 corner: 16@16.
        offColor := Color paleYellow.
        onColor := Color paleBlue darker.
        self useSquareCorners.
        self turnOff


I even downloaded the code for the book from Squeaksource and pasted it in and
it does the same thing.

Any help would be appreciated.

Thanks,
- Eric (Dr. Zephy)

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Quinto Game Example Code Not Working

Enrico Schwass-2
"Dr. Zephy" <[hidden email]> writes:

> I'm working through the Squeak by Example book and ran into a snag. The code on
> page 33 for the Quinto game is returning an error message.
> I have the SBECell selected and "-- all --" is highlighted in the right pane,
> just like in the book, but it responds with the message "Unknown variable:
> initialize   please correct or cancel:  / declare temp / declare instance /
> cancel".

Sounds like a typo in your code. Maybe there is something wrong with
your cut and paste (unicode and tabs drove me crazy in other languages -
not in squeak so far).

Select all in your initialize method with command-a, backspace, rewrite
it from scratch. The tutorial should be okay, i did it twice with some
newbies.

bye
Enno
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Quinto Game Example Code Not Working

waufrepi III
In reply to this post by Dr. Zephy

I got an error here too, when I first did the example. I think I removed: self turnOff and the code worked. I was using the Cobalt image though. not sur if this helps.

wfpi


On 4/28/08, Dr. Zephy <[hidden email]> wrote:
I'm working through the Squeak by Example book and ran into a snag. The code on
page 33 for the Quinto game is returning an error message.
I have the SBECell selected and "-- all --" is highlighted in the right pane,
just like in the book, but it responds with the message "Unknown variable:
initialize   please correct or cancel:  / declare temp / declare instance /
cancel".

So I guess it doesn't  recognize "initialize" and thinks I'm trying to create a
variable? According to the book it should be recognized.

Here's the code:

initialize
        super initialize.
        self label: ''.
        self borderWidth: 2.
        bounds := 0@0 corner: 16@16.
        offColor := Color paleYellow.
        onColor := Color paleBlue darker.
        self useSquareCorners.
        self turnOff


I even downloaded the code for the book from Squeaksource and pasted it in and
it does the same thing.

Any help would be appreciated.

Thanks,
- Eric (Dr. Zephy)

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


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