This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-01-30 21:20:08

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Squeak Smalltalk Chapter 1

Let's start with simple codes:

Code:

self = object using the method
^ = makes a up arrow and is used like a BYOB report block
_ = makes a side arrow (like ->) and sets the variable the arrow is pointing to to what is behind the arrow
# = a selector, used in two main different ways, 1. Like broadcasting to another method. 2. Used in dropdowns before the list of the dropdown, such as #('true' 'false').
would become a dropdown of  true and false. (notice the ' before and after a word used so that the browser doesn't think it is trying to go to a method which it will not find and later the code wouldn't have been able to be accepted)
nil = this is like saying '' or 0 but you cannot type in 'nil' or '' or 0 and then see if it is nil otherwise it will be false. EVERY VARIABLE IN THE SOURCE CODE IF NOT SET TO SOMETHING EVER WILL BE NIL.
ifTrue: = a condition, if the code before it is true it will run the code after it (which has to be in []'s)
ifFalse: = a condition, if the code before it is false it will run the code after it (which has to be in []'s)
ifNil: = a condition, if the code before  it is nil it will run the code after it (which has to be in []'s)
ifNotNil: = a condition, if the code before it is anything but nil it will run the code after it (which has to be in []'s)
[] = conditional code, if there is a reason why it shouldn't do what is inside the []'s , such as t1 = 3 ifTrue: [^t2]
() = joiner, like the join block, it is needed for things like  (sensor shiftPressed) and: ( self = ScriptableScratchMorph) I HAVE NO EXPERIENCE OTHERWISE BUT I KNOW IT IS USED IN VARIOUS WAYS WHICH I CANNOT EXPLAIN, IF YOU CAN EXPLAIN PLEASE DO.
Float = will make a word not the word itself but like nil is not 'nil' the word will not be equal to it, such as Float Infinity or Float Pi

Now I will tell you where you can do what:

blockSpecs = where you can code what a block looks like
ScriptableScratchMorph = where you code blocks for SPRITES AND THE STAGE
ScriptableSpriteMorph = where you can code blocks for SPRITES ONLY
ScriptableStageMorph = where you can code blocks for the STAGE ONLY
Scratch-Blocks = where you will code new type of blocks and/or dropdowns which later you can use in blockSpecs
Scratch-Objects = where you code things for Objects such as blocks
Scratch-UI-Panes = where you can put codes for the top of your Scratch window, such as menus like the Edit or Share menu
Scratch-UI-Watchers = where you can edit how a reporter shows in the stage

Here are a few things you can do with Scratch:

Mesh = a connection between two different Scratch window (even if they are on different computers!) ONLY WORKS SHORT DISTANCE
Code A Block = is when you make a block that will be in the blocks pane
Get Things From The Internet = Scratch can get things from the internet without opening an internet browser as seen in some Scratch Modifications
Open The Internet = Scratch can open your default internet browser
Make A Method Or Block = Scratch allows you to make a code that allows you to make your own method and/or block which will save for that project only.
Change The Color Of ANYTHING = Change the color of blocks, watchers, buttons, panes and more!
Open Other Programs = Scratch can open any program installed to your computer, such as paint, word, ITunes and more!
Make A Mod = About 50 Scratch Modifications have already been made!
Change Files On Your Computer = with Scratch you can make a code which can change and/or create a file on your computer! As seen in some Mods
More! = If you can code it, you can use it!

http://www.weebly.com/uploads/5/4/1/3/5413503/3191070.gif
http://www.weebly.com/uploads/5/4/1/3/5413503/3967268.gif
http://www.weebly.com/uploads/5/4/1/3/5413503/8557935.gif

Last edited by Pecola1 (2011-04-10 18:18:42)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#2 2011-01-31 00:40:52

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

Here are a few things you need to fix:
BBCode does not work inside the [code] tag.
Scratch-Blocks is where you make dropdown menus and new block types.
The Mesh link is broken, take out the http// and replace with http://.

Overall, nice guide!

Offline

 

#3 2011-01-31 19:30:26

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

scimonster wrote:

Here are a few things you need to fix:
BBCode does not work inside the [code] tag.
Scratch-Blocks is where you make dropdown menus and new block types.
The Mesh link is broken, take out the http// and replace with http://.

Overall, nice guide!

Actually the Mesh had a space before it. I know about the bbcode tag thing, I edited it but accidentally didn't save it. What about the Scratch-Blocks


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#4 2011-02-01 00:42:19

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

Pecola1 wrote:

scimonster wrote:

Here are a few things you need to fix:
BBCode does not work inside the [code] tag.
Scratch-Blocks is where you make dropdown menus and new block types.
The Mesh link is broken, take out the http// and replace with http://.

Overall, nice guide!

Actually the Mesh had a space before it. I know about the bbcode tag thing, I edited it but accidentally didn't save it. What about the Scratch-Blocks

You wrote Scratch-Objects.

Offline

 

#5 2011-02-01 14:26:51

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

scimonster wrote:

Pecola1 wrote:

scimonster wrote:

Here are a few things you need to fix:
BBCode does not work inside the [code] tag.
Scratch-Blocks is where you make dropdown menus and new block types.
The Mesh link is broken, take out the http// and replace with http://.

Overall, nice guide!

Actually the Mesh had a space before it. I know about the bbcode tag thing, I edited it but accidentally didn't save it. What about the Scratch-Blocks

You wrote Scratch-Objects.

OH! LOL sorry about that.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#6 2011-02-07 18:25:25

6jarjar6
Scratcher
Registered: 2009-11-25
Posts: 4

Re: Squeak Smalltalk Chapter 1

<font color=red>text goes here</font>

Offline

 

#7 2011-02-07 20:09:44

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

6jarjar6 wrote:

<font color=red>text goes here</font>

What? Use BBcode:

Code:

[color=red]text goes here[/color]

will appear text goes here


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#8 2011-02-08 15:40:35

pen13
Scratcher
Registered: 2010-08-27
Posts: 100+

Re: Squeak Smalltalk Chapter 1

text goes here


http://womrealms.com/char.php?nomimg1:3ri855a
pen13 http://blocks.scratchr.org/API.php?user=pen13&amp;action=onlineStatus green= online gray=offline

Offline

 

#9 2011-02-08 16:55:14

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

pen13 wrote:

text goes here

What about it?


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#10 2011-04-09 15:15:37

DarthPickley
Scratcher
Registered: 2008-06-13
Posts: 100+

Re: Squeak Smalltalk Chapter 1

Pecola1 wrote:

ifTrue: = a condition, if the code behind it is true it will run the code after it (which has to be in []'s)

I suggest that everytime you say "behind", you replace it with "before".

I mean, in the word CAT, is the A behind the C or the C behind the A?

this confused me at first. you should change it.

Offline

 

#11 2011-04-10 18:14:18

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

DarthPickley wrote:

Pecola1 wrote:

ifTrue: = a condition, if the code behind it is true it will run the code after it (which has to be in []'s)

I suggest that everytime you say "behind", you replace it with "before".

I mean, in the word CAT, is the A behind the C or the C behind the A?

this confused me at first. you should change it.

Thank you! I just thought that before, can also mean in front of. But I do believe it would be less confusing.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#12 2011-04-30 15:03:45

PythonLibrary
Scratcher
Registered: 2011-03-26
Posts: 100+

Re: Squeak Smalltalk Chapter 1

How do you let Scratch open other programs?


http://dl.dropbox.com/u/9137793/Python%20Library%20logo.png
Our website: pylibrary.co.cc http://dl.dropbox.com/u/9137793/Awesomeness%20Block.gif

Offline

 

#13 2011-04-30 20:12:00

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

PythonLibrary wrote:

How do you let Scratch open other programs?

I think it is something like:
Cursor wait showWhile: [ScratchPlugin primOpen: t1]
I don't quite remember.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#14 2011-06-21 11:35:35

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: Squeak Smalltalk Chapter 1

By only works short distance, I think you mean LAN.

Offline

 

#15 2011-06-21 15:07:03

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

LiquidMetal wrote:

By only works short distance, I think you mean LAN.

I don't quite understand... what is by and LAN?


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#16 2011-06-21 15:09:36

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

Pecola1 wrote:

LiquidMetal wrote:

By only works short distance, I think you mean LAN.

I don't quite understand... what is by and LAN?

LAN is Local Area Network.

Offline

 

#17 2011-06-21 15:12:04

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

scimonster wrote:

Pecola1 wrote:

LiquidMetal wrote:

By only works short distance, I think you mean LAN.

I don't quite understand... what is by and LAN?

LAN is Local Area Network.

and whats By?


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#18 2011-06-21 15:39:39

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

Pecola1 wrote:

scimonster wrote:

Pecola1 wrote:


I don't quite understand... what is by and LAN?

LAN is Local Area Network.

and whats By?

I don't know. I was just translating the acronym. XD

Offline

 

#19 2011-06-21 15:46:43

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

scimonster wrote:

Pecola1 wrote:

scimonster wrote:


LAN is Local Area Network.

and whats By?

I don't know. I was just translating the acronym. XD

LOL so LAN may be something else? Or is that what he is talking about?


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#20 2011-06-21 15:53:55

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Squeak Smalltalk Chapter 1

Pecola1 wrote:

scimonster wrote:

Pecola1 wrote:


and whats By?

I don't know. I was just translating the acronym. XD

LOL so LAN may be something else? Or is that what he is talking about?

That's what he's talking about, I'm pretty sure.  smile

Offline

 

#21 2011-07-24 12:11:17

Rocker98585
Scratcher
Registered: 2010-12-26
Posts: 39

Re: Squeak Smalltalk Chapter 1

hi

Offline

 

#22 2011-07-24 12:12:36

Rocker98585
Scratcher
Registered: 2010-12-26
Posts: 39

Re: Squeak Smalltalk Chapter 1

hi

Offline

 

#23 2011-07-24 12:13:43

Rocker98585
Scratcher
Registered: 2010-12-26
Posts: 39

Re: Squeak Smalltalk Chapter 1

[color=light gray]hi[/color]

Offline

 

#24 2012-06-15 01:32:00

Jonathan50
Scratcher
Registered: 2011-07-06
Posts: 100+

Re: Squeak Smalltalk Chapter 1

Pecola1 wrote:

PythonLibrary wrote:

How do you let Scratch open other programs?

I think it is something like:
Cursor wait showWhile: [ScratchPlugin primOpen: t1]
I don't quite remember.

so does that means you declare t1 as a temp like this:
| t1 |
t1 _ Path goes here
Cursor wait showWhile: [ScratchPlugin primOpen: t1]
and for the web browser you do primOpenURL: t1 instead of primOpen: t1!
I'd rather just do ScratchPlugin primOpen :t1 rather than Cursor wait showWhile: [ScratchPlugin primOpen: t1] because it sets the cursor to wait


Jonathan50
big_smile  http://scratch.mit.edu/img/pages/credits/cat-face-bullet.gif http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=onlineStatus&amp;type=square         http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1

Offline

 

Board footer