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

#26 2011-04-25 00:53:27

nextstorm
Scratcher
Registered: 2009-12-13
Posts: 1000+

Re: Squeak Smalltalk Chapter 3

How do I create a new variable/method? After right-clicking, there doesn't seem to be anything that says "create new variable" etc.

EDIT: I mean in the System Browser. I'm trying to make your stage panning block  big_smile

Last edited by nextstorm (2011-04-25 00:54:37)


bye

Offline

 

#27 2011-04-25 14:28:25

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

Re: Squeak Smalltalk Chapter 3

ProgrammingFreak wrote:

Pecola1 wrote:

ProgrammingFreak wrote:


Also, can you make variables anywhere?

What do you mean make variables anywhere? You mean the watcher allowed off the stage? (yes) Or make a new variable for a certain sprite from another sprite? (yes again) Do you mean make it so the user can make their variable go to motion, control et cetera? (yeperoo) What do you mean?

Like making variables in between the '||' anywhere? Or is that just at the top?

I believe they can go anywhere, but why would you want them anywhere else? For it to look better? but you do have to put the |'s.


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

 

#28 2011-04-25 14:35:14

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

Re: Squeak Smalltalk Chapter 3

nextstorm wrote:

How do I create a new variable/method? After right-clicking, there doesn't seem to be anything that says "create new variable" etc.

EDIT: I mean in the System Browser. I'm trying to make your stage panning block  big_smile

to create a new method, simply put your method in instance (for a scratch block) by clicking the instance button. Put it in any of the ops, if you cannot chose, use 'other ops'. Click on any method under your op, and backspace the WHOLE method (in the big box at the bottom), don't worry as long as you remember to backspace the whole thing it will not ruin the method. Now type/paste your method in the blank. For a variable INSIDE of a method (like BYOB's script variable) at the top of the page put two up and down lines: || (if you have a keyboard which does not contain them like mine, copy them) put the name of your variable in-between the lines. if you want more than one variable press space and make another name.


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

 

#29 2011-04-25 14:43:38

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Squeak Smalltalk Chapter 3

Pecola1 wrote:

ProgrammingFreak wrote:

Pecola1 wrote:


What do you mean make variables anywhere? You mean the watcher allowed off the stage? (yes) Or make a new variable for a certain sprite from another sprite? (yes again) Do you mean make it so the user can make their variable go to motion, control et cetera? (yeperoo) What do you mean?

Like making variables in between the '||' anywhere? Or is that just at the top?

I believe they can go anywhere, but why would you want them anywhere else? For it to look better? but you do have to put the |'s.

I don't know. I was lazy.  tongue

Offline

 

#30 2011-04-25 14:50:49

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

Re: Squeak Smalltalk Chapter 3

ProgrammingFreak wrote:

Pecola1 wrote:

ProgrammingFreak wrote:

Like making variables in between the '||' anywhere? Or is that just at the top?

I believe they can go anywhere, but why would you want them anywhere else? For it to look better? but you do have to put the |'s.

I don't know. I was lazy.  tongue

LOL. Hmm... that just gave me an idea!
lets see...

Code:

abcdefghijklmnopqrstuvwxyz
zyxwvutsrqponmlkjihgfedcba

OLO! Ru blf fhv yzxpdzixh zokszyvg olo is lol! OLO!


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

 

#31 2011-04-25 15:03:28

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

Re: Squeak Smalltalk Chapter 3

Pecola1 wrote:

ProgrammingFreak wrote:

Pecola1 wrote:


I believe they can go anywhere, but why would you want them anywhere else? For it to look better? but you do have to put the |'s.

I don't know. I was lazy.  tongue

LOL. Hmm... that just gave me an idea!
lets see...

Code:

abcdefghijklmnopqrstuvwxyz
zyxwvutsrqponmlkjihgfedcba

OLO! Ru blf fhv yzxpdzixh zokszyvg olo is lol! OLO!

English please?

Offline

 

#32 2011-04-25 15:16:05

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

Re: Squeak Smalltalk Chapter 3

scimonster wrote:

Pecola1 wrote:

ProgrammingFreak wrote:

I don't know. I was lazy.  tongue

LOL. Hmm... that just gave me an idea!
lets see...

Code:

abcdefghijklmnopqrstuvwxyz
zyxwvutsrqponmlkjihgfedcba

OLO! Ru blf fhv yzxpdzixh zokszyvg olo is lol! OLO!

English please?

LOL! If you use backwards alphabet lol i olo! LOL!


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

 

#33 2011-04-25 15:20:01

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

Re: Squeak Smalltalk Chapter 3

Pecola1 wrote:

scimonster wrote:

Pecola1 wrote:


LOL. Hmm... that just gave me an idea!
lets see...

Code:

abcdefghijklmnopqrstuvwxyz
zyxwvutsrqponmlkjihgfedcba

OLO! Ru blf fhv yzxpdzixh zokszyvg olo is lol! OLO!

English please?

LOL! If you use backwards alphabet lol i olo! LOL!

I still don't understand it, and I have to get off now.

Offline

 

#34 2011-04-25 16:22:27

nextstorm
Scratcher
Registered: 2009-12-13
Posts: 1000+

Re: Squeak Smalltalk Chapter 3

Pecola1 wrote:

nextstorm wrote:

How do I create a new variable/method? After right-clicking, there doesn't seem to be anything that says "create new variable" etc.

EDIT: I mean in the System Browser. I'm trying to make your stage panning block  big_smile

to create a new method, simply put your method in instance (for a scratch block) by clicking the instance button. Put it in any of the ops, if you cannot chose, use 'other ops'. Click on any method under your op, and backspace the WHOLE method (in the big box at the bottom), don't worry as long as you remember to backspace the whole thing it will not ruin the method. Now type/paste your method in the blank. For a variable INSIDE of a method (like BYOB's script variable) at the top of the page put two up and down lines: || (if you have a keyboard which does not contain them like mine, copy them) put the name of your variable in-between the lines. if you want more than one variable press space and make another name.

Thanks.  tongue


bye

Offline

 

#35 2011-04-25 16:32:37

nextstorm
Scratcher
Registered: 2009-12-13
Posts: 1000+

Re: Squeak Smalltalk Chapter 3

nextstorm wrote:

Pecola1 wrote:

nextstorm wrote:

How do I create a new variable/method? After right-clicking, there doesn't seem to be anything that says "create new variable" etc.

EDIT: I mean in the System Browser. I'm trying to make your stage panning block  big_smile

to create a new method, simply put your method in instance (for a scratch block) by clicking the instance button. Put it in any of the ops, if you cannot chose, use 'other ops'. Click on any method under your op, and backspace the WHOLE method (in the big box at the bottom), don't worry as long as you remember to backspace the whole thing it will not ruin the method. Now type/paste your method in the blank. For a variable INSIDE of a method (like BYOB's script variable) at the top of the page put two up and down lines: || (if you have a keyboard which does not contain them like mine, copy them) put the name of your variable in-between the lines. if you want more than one variable press space and make another name.

Thanks.  tongue

Wait, so, apparently, only the stage moves, but the pen trails are still stuck there and also the sprites. Darn. D:


bye

Offline

 

#36 2011-04-25 20:43:17

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

Re: Squeak Smalltalk Chapter 3

nextstorm wrote:

nextstorm wrote:

Pecola1 wrote:


to create a new method, simply put your method in instance (for a scratch block) by clicking the instance button. Put it in any of the ops, if you cannot chose, use 'other ops'. Click on any method under your op, and backspace the WHOLE method (in the big box at the bottom), don't worry as long as you remember to backspace the whole thing it will not ruin the method. Now type/paste your method in the blank. For a variable INSIDE of a method (like BYOB's script variable) at the top of the page put two up and down lines: || (if you have a keyboard which does not contain them like mine, copy them) put the name of your variable in-between the lines. if you want more than one variable press space and make another name.

Thanks.  tongue

Wait, so, apparently, only the stage moves, but the pen trails are still stuck there and also the sprites. Darn. D:

Yes sorry, but the stage costume moves behind the pen marks!


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

 

#37 2011-04-25 23:18:57

nextstorm
Scratcher
Registered: 2009-12-13
Posts: 1000+

Re: Squeak Smalltalk Chapter 3

Pecola1 wrote:

nextstorm wrote:

nextstorm wrote:


Thanks.  tongue

Wait, so, apparently, only the stage moves, but the pen trails are still stuck there and also the sprites. Darn. D:

Yes sorry, but the stage costume moves behind the pen marks!

Since I fail (epicly) at Smalltalk, could you make a block that pans the pen trails? Thx if possible  big_smile


bye

Offline

 

#38 2011-04-26 14:43:38

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

Re: Squeak Smalltalk Chapter 3

nextstorm wrote:

Pecola1 wrote:

nextstorm wrote:


Wait, so, apparently, only the stage moves, but the pen trails are still stuck there and also the sprites. Darn. D:

Yes sorry, but the stage costume moves behind the pen marks!

Since I fail (epicly) at Smalltalk, could you make a block that pans the pen trails? Thx if possible  big_smile

I don't know if it is possible, next time I am looking through the browser I will see. I think I know how to make a pen draw by itself, or know how to find 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

 

#39 2011-04-28 13:56:32

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Squeak Smalltalk Chapter 3

Hey, I think you missed typed this:

$yourOneLetter = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #yourNameForYourDropdown].

Isn't the 't2' supposed to be 'code'?

Offline

 

#40 2012-06-21 03:28:32

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

Re: Squeak Smalltalk Chapter 3

scimonster wrote:

A couple things:
It is "ops" not "opps"
It is in private, not --all--
...That's it.
Still a great tutorial!

--all-- or private


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

Offline

 

#41 2012-06-22 21:16:45

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

Re: Squeak Smalltalk Chapter 3

ProgrammingFreak wrote:

Pecola1 wrote:

ProgrammingFreak wrote:


Also, can you make variables anywhere?

What do you mean make variables anywhere? You mean the watcher allowed off the stage? (yes) Or make a new variable for a certain sprite from another sprite? (yes again) Do you mean make it so the user can make their variable go to motion, control et cetera? (yeperoo) What do you mean?

Like making variables in between the '||' anywhere? Or is that just at the top?

Yes. If you want a temp to be able to be accessed by the whole method, you do the top;
if you want it to only be accessed by part of the method, you put it above that part.


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

Offline

 

Board footer