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.
Offline
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!
Offline
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.
Offline
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.
Offline
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.
Offline
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.
Offline
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
Offline
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.
Offline
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 ?
Offline
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 ?
You need to start at array position 1 to play it back.
Offline
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
Offline
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........
Offline
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"
Offline
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;
Offline
keroro645 wrote:
Are there projects that simulate arrays?
Yes but none are really as good as actually having arrays.
Offline
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
LOL I mentioned the same thing a while ago and I thought it was MY suggestion (I even made a mock-up of it in Photoshop)! I like the idea of a spreadsheet-style listwatcher for 2-dimensional arrays.
Offline
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
Offline
keroro645 wrote:
Are there projects that simulate arrays?
Cyclone103's Mouse Array is the best array simulator I've seen on Scratch.
Offline
Here is another array project I made: http://scratch.mit.edu/projects/Cyclone103/174713 it uses an array to store block info.
Offline
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