I finished another chapter in the book today. It was a fairly short chapter which dealt with the basic rules of syntax in smalltalk. One of the points it stressed continuously was how simple the syntax truly is. Eventually it boiled down all squeak programming to 5 simple rules
Rule 1. Everything is an object.
Rule 2. Every object is an instance of a class.
Rule 3. Every class has a superclass.
Rule 4. Everything happens by message sends.
Rule 5. Method lookup follows the inheritance chain.
One of the most difficult ideas to grasp was that even the classes were objects. This next chapter that I've just started deals with development in squeak. Hopefully this will provide greater insight into some of the more in depth details that previous chapters have left out.
Tuesday, December 1, 2009
Tuesday, November 24, 2009
Syntax
I've completed the part of the tutorial in which you create the Quinto game. However there are several issues with it. When clicked on an object and the four surrounding it are supposed to change color but so far this only works on certain blocks. I've decided to skip over this for now and move on to the next chapter which deals with syntax. Hopefully I can go back and fix this as a side project after I learn more about what I've actually done in creating this game, as so far the tutorial simply says to trust it and it will explain what we are doing later.
Monday, November 23, 2009
Protocol Creation
With the game almost done I'm stuck on one part. The tutorial asks me to create a protocol called game logic in SBEGame. I dont believe the tutorial has told me how to do this yet but if it has I've simply forgotten. I ran a few google searches and havnt found the answer yet but will try again tomorrow. Hopefully I'll be able to solve this problem fairly quickly. Once I do I believe I'm only about an hour away from completing the game which means i would have it done before the break. I'll post the file as I complete it.
Thursday, November 19, 2009
More Class Creation
Continuing with the creation of the Quinto game, today I created a class named CellGame which will actually run the game. Another class I created, SBECell, is a rectangle of variable size which will make up the changeable pieces of the board. when the project is complete, ie at the end of the chapter, these will change color to blue when the nearby cell is clicked.
Chapter 2
I just finished the first chapter of the Squeak by Example book. So far it has been significantly more helpful than any other tutorial I have founds so far. I went through the process of creating a new method which i discussed in the previous post and an now just starting a game entitled quinto. Screenshots will follow when I'm further in to the chapter.
Wednesday, November 18, 2009
Class Creation
Today I was guided through the creation of a method. So far I have created a test for a program i am going to write and first thing tomorrow I will create the actual program. The goal of which is to convert a string into one that is "more frantic sounding" the testing document contains an example:
testShout
self assert: ('Don''t panic' shout = 'DON''T PANIC!')
which tests the input of Don't panic for the output of DON'T PANIC!
testShout
self assert: ('Don''t panic' shout = 'DON''T PANIC!')
which tests the input of Don't panic for the output of DON'T PANIC!
Subscribe to:
Posts (Atom)