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!

11-17-09

I've found a great free E-Book entitled Squeak By Example, the pdf of which may be found on http://www.squeakbyexample.org/ and I received help from Mr Elkner in solving a problem I had opening saved files in squeak. I have to open the files through a terminal. Not being able to open them properly has been an issue for several days and makes the tutorials much easier to follow.

Monday, November 16, 2009

Boolean

The part of the tutorial i covered today focused on Boolean operations. The basic syntax is
(Argument) ifTrue [^'Some Printed Output'] ifFalse [^'Some Printed Output']

Where the argument is something along the lines of 1 < 10 and the ^ (shown as an up arrow in Squeak) is the command to return a value. This is one of the code blocks i evaluated which was included in the tutorial:

| dir pos |
pos := 'Chalk Farm'.
dir := ''.
[dir isNil or: [dir isEmpty]] whileTrue: "loop Prompter until a char has been entered"
[ dir := FillInTheBlank request: 'Enter a one-letter direction: N,S,W,E' ].
( dir = 'N' )
ifTrue: [ pos := (Map at: pos) n.
Transcript show: 'Moved to ', (Map at: pos) description ]
ifFalse: [ Transcript show: 'This has not been implemented yet!'].

Ignoring some the the classes created earlier in the tutorial the code is basically creating two temporary variables (dir and pos), setting pos equal to the string 'Chalk Farm,' setting dir equal to nil and comparing a user input to deturmine the aspects of locations around the variables.

Friday, November 13, 2009

Hierarchy

Today I learned more about arrays and some of the more detailed syntax of Smalltalk, including how to return data and use variables. I also learned some about the Hierarchy of objects in Smalltalk. Looking up the Array class in the class browser I selected the Hierarchy for it and found it descended through several classes down directly from the Object class. I didn't make too much progress on the game today but did learn a significant deal regarding Smalltalk code.

Thursday, November 12, 2009

SmallTalk (cont'd)

I'm going on with the smalltalk tutorial listed in the previous post. It is slightly more in depth than i previously anticipated and on page two it actually takes you through the steps of creating a small maze game modeled after the london subway station. I'll be working on this for the next couple days and possibly into next week. hopefully ill have results to show in class on monday.

Tuesday, November 10, 2009

SmallTalk Tutorial

I'm on to page two of the Smalltalk tutorial (http://www.bitwisemag.com/copy/programming/smalltalk/smalltalk2.html). It focuses on the the syntax of SmallTalk programming which is fairly basic. It seems to build on a few basic commands. I've just gotten into creating arrays in the language which is fairly simple. One of the more interesting aspects of the code blocks it has me dealing with is the inclusion of primarily temporary variables which are defined only until the code is finished executing and then are destroyed.

11-9-09

I stayed home sick today but spent a minute or two thinking about smalltalk.

Friday, November 6, 2009

New Tutorial

I've found a new tutorial for squeak (http://www.bitwisemag.com/copy/programming/smalltalk/smalltalk1.html) which specifically focuses on smalltalk programming. So far it has been fairly useful in teaching me the basics and I'm getting a much clearer idea of squeak. It has been very clear, but as it is so short I'll most likely finish with it on monday and may go back to a previous tutorial with this newfound knowledge

Thursday, November 5, 2009

Squeak (pt2)

After looking over the Squeak tutorial a little longer i managed to figure out what it was asking me to do. I managed to do this but i still have a major problem with this tutorial as it is fairly unclear as to why it has me do certain things, and more importantly how to do them.

Wednesday, November 4, 2009

Tutorial Troubles

The tutorial I had been using to learn squeak seems to be either made from an old version or simply incomplete. It often asks you to do things without telling you how and all the images are of a version of squeak that i dont have. Even when the directions are fairly simple the expected result does not happen. Ill be looking for a better tutorial and in the meantime try to sift through this one.

Monday, November 2, 2009

Squeak

After finally getting squeak downloaded near the end of the period i looked over the first few pages of the "laser game" tutorial and tried out a few simple objects in squeak. I'll be working on it more on Wednesday and may download it on my home computer before then.