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

#1 2008-05-19 21:07:22

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Array block

I think that there should be an array block in scratch. It would compress the many variables I wind up using in the course of one project into one single array. Are there any plans to include an array block in Scratch 1.3? I know that Jens has an experimental one, but I would like to know if any plans for a real one are in place, or if it is even possible.


All your base are belong to us

Offline

 

#2 2008-05-20 18:22:39

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Array block

Cyclone103 wrote:

I think that there should be an array block in scratch. It would compress the many variables I wind up using in the course of one project into one single array. Are there any plans to include an array block in Scratch 1.3? I know that Jens has an experimental one, but I would like to know if any plans for a real one are in place, or if it is even possible.

Nope, Lists is the only implementation in Scratch...I think Jens has found an excellent way to do this, and I hope the Scratch team implements them in 1.3 (probably available this fall). I know, I can't wait either!  mad


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#3 2008-05-20 18:47:46

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: Array block

I know that lists are the only current implementation, but they act in a way that is similar to an array. I really hope they DO choose to incorporate Jens' lists, in the exact same style, but perhaps go through and fix any glitches. Another possible idea would be to make a visible array, like an Excel spreadsheet, that would function in a similar manner.


All your base are belong to us

Offline

 

#4 2008-05-21 00:37:28

AddZero
Scratcher
Registered: 2007-08-11
Posts: 100+

Re: Array block

Yes!
Jen's setup is awesome. I think it's about as functional yet simple as it can get. It'll open a whole world of possibilities.  A visible array is an interesting idea too, that could help people understand what's happening.


http://scratch.mit.edu/static/icons/buddy/524717_med.png?t=2010-06-15+09%3A48%3A36

Offline

 

#5 2008-05-21 02:50:17

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Array block

Cyclone103 wrote:

Another possible idea would be to make a visible array, like an Excel spreadsheet, that would function in a similar manner.

Absolutely! A visual representation of a list/array would be fantastic, so you could view and edit lists interactively the same as you can view/edit a variable watcher.


Jens Mönig

Offline

 

#6 2008-05-21 15:10:46

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: Array block

It could be like a pull-down menu, just like the new keyboard for notes, but it would also allow number input like Jens' lists.


All your base are belong to us

Offline

 

#7 2008-08-24 12:30:27

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: Array block

Hey, just curious scratch team, but I have the beta, and are the visual aspects of the lists inspired by my earlier post? Just wondering. It would be awesome if something I said affected how Scratch turns out  tongue


All your base are belong to us

Offline

 

#8 2008-08-24 12:38:45

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Array block

Question:What are arrays and what do they do?

Offline

 

#9 2008-08-24 14:35:35

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Array block

keroro645 wrote:

Question:What are arrays and what do they do?

Arrays are variables that store groups of data.

Using arrays you can make a mouse recorder.

//like this
forever
set mouseX at (i) to (mousex)
set mouseY at (i) to (mousey)
change i by 1
end

If you did this every time the code is executed it would save the position of your mouse to the array.

To play it back you would do this.
//put this one the fake cursor sprite
set j to 1
repeat until (j=i)
goto x:(mouseX(j) y:(mouseY(j)
end

Arrays have many uses.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#10 2008-08-24 14:37:24

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Array block

archmage wrote:

keroro645 wrote:

Question:What are arrays and what do they do?

Arrays are variables that store groups of data.

Using arrays you can make a mouse recorder.

//like this
forever
set mouseX at (i) to (mousex)
set mouseY at (i) to (mousey)
change i by 1
end

If you did this every time the code is executed it would save the position of your mouse to the array.

To play it back you would do this.
//put this one the fake cursor sprite
set j to 1
repeat until (j=i)
goto x:(mouseX(j) y:(mouseY(j)
j+1
end

Arrays have many uses.

Forgot to add 1 to j. What's the point of repeating it at position 1 XD  tongue ?


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#11 2008-08-24 14:40:33

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Array block

Bluestribute wrote:

archmage wrote:

keroro645 wrote:

Question:What are arrays and what do they do?

Arrays are variables that store groups of data.

Using arrays you can make a mouse recorder.

//like this
forever
set mouseX at (i) to (mousex)
set mouseY at (i) to (mousey)
change i by 1
end

If you did this every time the code is executed it would save the position of your mouse to the array.

To play it back you would do this.
//put this one the fake cursor sprite
set j to 1
repeat until (j=i)
goto x:(mouseX(j) y:(mouseY(j)
j+1
end

Arrays have many uses.

Forgot to add 1 to j. What's the point of repeating it at position 1 XD  tongue ?

You need to start at array position 1 to play it back.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#12 2008-08-24 14:42:02

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Array block

archmage wrote:

You need to start at array position 1 to play it back.

Yeah, but you need to go to a new position in the array each tiem through. What you wrote was to play position 1 of the array over and over XD


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#13 2008-08-24 14:43:01

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: Array block

I see many possible uses for arrays. I will keep my big project a secret until it is totally done, I have started work on it using the beta........


All your base are belong to us

Offline

 

#14 2008-08-24 14:47:14

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Array block

Bluestribute wrote:

archmage wrote:

You need to start at array position 1 to play it back.

Yeah, but you need to go to a new position in the array each tiem through. What you wrote was to play position 1 of the array over and over XD

Lol my bad. I forgot to put "change j by 1"


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#15 2008-08-24 14:51:38

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Array block

archmage wrote:

Bluestribute wrote:

archmage wrote:

You need to start at array position 1 to play it back.

Yeah, but you need to go to a new position in the array each tiem through. What you wrote was to play position 1 of the array over and over XD

Lol my bad. I forgot to put "change j by 1"

oh yeah, you don't use j+1 in Scratch XD. I almost put J+= 1;


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#16 2008-08-24 15:03:52

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Array block

Are there projects that simulate arrays?

Offline

 

#17 2008-08-24 15:27:01

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Array block

keroro645 wrote:

Are there projects that simulate arrays?

Yes but none are really as good as actually having arrays.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#18 2008-08-29 15:26:26

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Array block

Cyclone103 wrote:

Hey, just curious scratch team, but I have the beta, and are the visual aspects of the lists inspired by my earlier post? Just wondering. It would be awesome if something I said affected how Scratch turns out  tongue

LOL I mentioned the same thing a while ago and I thought it was MY suggestion  tongue  (I even made a mock-up of it in Photoshop)! I like the idea of a spreadsheet-style listwatcher for 2-dimensional arrays.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#19 2008-08-29 15:30:04

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: Array block

Teh only reason I thought it might have been my idea was cause Jens liked it, and he is in close contact with teh scratch team. It is probably the scratch team's idea lol


All your base are belong to us

Offline

 

#20 2008-08-29 15:35:44

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Array block

keroro645 wrote:

Are there projects that simulate arrays?

Cyclone103's Mouse Array is the best array simulator I've seen on Scratch.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#21 2008-08-29 16:37:53

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: Array block

Here is another array project I made: http://scratch.mit.edu/projects/Cyclone103/174713 it uses an array to store block info.


All your base are belong to us

Offline

 

#22 2008-08-30 11:44:20

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: Array block

i want multi-dimensional arrays. instead of something like this:
list 1
a
b
c
you get:
list 1
1 2 3
a b c
b b c
it would make my 1.3 sudoku  project waayyyyyy easier.

Offline

 

Board footer