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!
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.
(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.
Subscribe to:
Posts (Atom)