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

#1 2007-09-11 22:10:26

cdonato
Scratcher
Registered: 2007-09-11
Posts: 1

"printing" a list

I'm a brand new user so please forgive me in advance for the stupid question...

I'm helping my daughter write a program that generates a sequence of numbers.  She's using the say command to "print" a number to the screen each time she runs through the loop.

Unfortunately, each time the sprite "prints" the new number it replaces the previous entry.  Ideally, I'd like the program to generate a list of numbers (e.g., "2, 5, 7, 15, 34...") by having appending the new number.   I suspect this is easily done but I can't figure it out.

Thanks in advance!

Craig

Offline

 

#2 2007-09-11 22:29:26

cocoanut
Scratcher
Registered: 2007-07-10
Posts: 1000+

Re: "printing" a list

So you're doing something like this:

Say: 2
blah blah blah
Say: 3

But each time you do that, it replaces the other.
Simple. You just say:

Say: 2
blah blah blah
Say: 2, 3

You have to type in the first number as well, then type in the next.


http://i42.tinypic.com/20gyvif.jpgPlease leave a message at the beep.
Steam: Hellephant

Offline

 

#3 2007-09-11 22:31:25

cocoanut
Scratcher
Registered: 2007-07-10
Posts: 1000+

Re: "printing" a list

I'm not that good at blocks. If these work, they may help you.

<say[1
<wait(1 seconds
<say[1, 3

Last edited by cocoanut (2007-09-11 22:32:23)


http://i42.tinypic.com/20gyvif.jpgPlease leave a message at the beep.
Steam: Hellephant

Offline

 

#4 2007-09-12 20:15:48

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

Re: "printing" a list

You might also want to use my print_number or print_decimal programs:

http://scratch.mit.edu/projects/kevin_karplus/2163
http://scratch.mit.edu/projects/kevin_karplus/2951

The print a number on the screen then move down before printing the next.
You can easily modify them to position the numbers where you want, as they were designed for incorporation into other projects.

Offline

 

Board footer