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

#1 2007-08-21 12:49:14

jhugart
Scratcher
Registered: 2007-08-21
Posts: 1

Trig functions? String manipulation?

I downloaded Scratch in order to teach my son some programming skills. One thing I like is the ability to play with graphics; it reminds me of my early days with an Apple II or Atari computer, playing with BASIC.

What's missing, though, is a set of trig functions. Showing that you can plot a circle using sine and cosine, or having a sprite move through a circular path using those functions, is something I wish I could do.

I could fake it if I could have a script block that would return a value, but there doesn't seem to be a way to do that. I can certainly use a variable as a return value, but I don't know that I have the calculation functions I'd need (looks like you can calculate signs using a series of additions and subtractions of powers and factorials, or by playing with complex numbers. But I'd be willing to fake it by using a table; is there a way to have a data file or data stored in an array?

A case statement wouldn't be unwelcome, either!

The other big thing I was was there, is some string functionality. The ability to iterate through characters in a string and show a specific character would be nice. I know this is graphically-oriented instead of text-oriented, but since we can have sprites think and say, it would be cool if they could "ask" for the viewer's name, then "say" it backwards (maybe by looping through to build a vaariable with the reversed text).

Jacob

Offline

 

#2 2007-08-21 13:38:00

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Trig functions? String manipulation?

Those are all desired functions.  You can find work-arounds for some of them in my RPN calculator project:
http://scratch.mit.edu/projects/kevin_karplus/2164

Offline

 

Board footer