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

#1 2009-07-09 14:25:03

djmoomoo
Scratcher
Registered: 2007-08-31
Posts: 57

Scratch Functions with Input and Return Values

Scratch is one of the only programming languages I know which doesn't support these.
If you don't have a clue what I'm on about, here's a C snippet of pseudo-code:


// THIS CODE IS PSEUDO CODE. IT WILL NOT COMPILE
main()
{

printf("Double = (   getDouble(2)    ) " );


}

int getDouble(int number)
{

return number * 2 ;

}

It would be really helpful if Scratch would support this. If you've anything to add...


There are 0011 types of people, those that can count in binary and those that can't.

Offline

 

#2 2009-07-12 02:02:24

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: Scratch Functions with Input and Return Values

Yes, well, first scratch needs functions!
It would not be too hard to add return values to these, but the MIT team wants to keep it easy to use for younger children.
You can use variables...
Or, jens' BYOB may be what you're looking for.


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

Board footer