Discuss Scratch
- Discussion Forums
- » Suggestions
- » Databases
- BotanAI
-
Scratcher
100+ posts
Databases
Variables. Allowing us near-instantaneous storage and use of a single bit of data. Infinitely useful.
Lists. Letting us group data, sort it, identify it. Gives us many more possibilities than a mere variable can. But, these are 1 dimensional.
Let's go a step further. Databases- 2 dimensional information storage. I can imagine many possibilities where this is useful.
Data tables for RPGs.
A backbone for 3-dimensional shapes.
A map-based game.
“Can't you just create a bunch of lists?” I hear you cry. But on that note, you could “just” create a bunch of variables and remove lists. This is extremely inefficient. While I've used it on EXTREMELY SMALL databases, it can't be scaled. Having to manually code in a bunch of editing functions every time I make a different-sized database than I have before is torture.
Lists. Letting us group data, sort it, identify it. Gives us many more possibilities than a mere variable can. But, these are 1 dimensional.
Let's go a step further. Databases- 2 dimensional information storage. I can imagine many possibilities where this is useful.
Data tables for RPGs.
A backbone for 3-dimensional shapes.
A map-based game.
“Can't you just create a bunch of lists?” I hear you cry. But on that note, you could “just” create a bunch of variables and remove lists. This is extremely inefficient. While I've used it on EXTREMELY SMALL databases, it can't be scaled. Having to manually code in a bunch of editing functions every time I make a different-sized database than I have before is torture.
- BotanAI
-
Scratcher
100+ posts
Databases
So, this is like Excel?Haha, that's one way to think of it. Yeah, basically.
- FancyFoxy
-
Scratcher
500+ posts
Databases
Okay then, support.So, this is like Excel?Haha, that's one way to think of it. Yeah, basically.
I'm gonna come up with the blocks for this data type.
add [Hello world] to column (1 v) of [database v] :: #e41b17
add [Hello world] to row (1 v) of [database v] :: #e41b17
insert [Hello world] at column (1 v) of [database v] :: #e41b17
insert [Hello world] at row (1 v) of [database v] :: #e41b17
delete item column: (1 v) row: (1 v) of [database v] :: #e41b17
replace item column: (1 v) row: (1 v) of [database v] with [Hello world] :: #e41b17
<[database v] contains [Hello world] ? :: #e41b17>
<column (1 v) of [database v] contains [Hello world] ? :: #e41b17>
<row (1 v) of [database v] contains [Hello world] ? :: #e41b17>
(item at column: (1 v) row: (1 v) of [database v] :: #e41b17)
(length of column (1 v) of [database v] :: #e41b17)
(length of row (1 v) of [database v] :: #e41b17)
(length of [database v] :: #e41b17)
Last edited by FancyFoxy (July 28, 2017 16:22:47)
- BotanAI
-
Scratcher
100+ posts
Databases
Okay then, support.
I'm gonna come up with the blocks for this data type.
-snip-
It's…
wipes a tear from my eye
It's beautiful.
Edit- What's the difference between “add” and “insert?” And why wouldn't an add block specify both the column and row?
Last edited by BotanAI (July 27, 2017 20:31:57)
- FancyFoxy
-
Scratcher
500+ posts
Databases
Insert is a bit hard to explain, but…Okay then, support.
I'm gonna come up with the blocks for this data type.
-snip-
It's…
wipes a tear from my eye
It's beautiful.
Edit- What's the difference between “add” and “insert?” And why wouldn't an add block specify both the column and row?
Basically, if you say “insert at 5”, then the item would be put at 5 and everything after 5 would be moved up. So previous 5 would be 6, making way for the new 5.
Also, I separated column and row for the add block because I think “adding” shouldn't be point-specific. Those blocks are for adding to a column or adding to a row. It would probably need something at Column 2, Row 1 in order to have Column 2, Row 2. Like how lists work. You need an Item 1 to have an Item 2.
- Charles12310
-
Scratcher
1000+ posts
Databases
Support. This would be very useful for things like leaderboards.
- BotanAI
-
Scratcher
100+ posts
Databases
Support. This would be very useful for things like leaderboards.I think you can do that with just a list. I dunno, tho
- Charles12310
-
Scratcher
1000+ posts
Databases
Nah. It's difficult. The a list would be like:Support. This would be very useful for things like leaderboards.I think you can do that with just a list. I dunno, tho
User1 - 1234
User2 - 39174
User3 - 29883
And then you need to find the positions of the numbers and the names, and other things all in one item, and if you ever wanted to change a position in a leaderboard, it would be more difficult too.
A database would be like:
User 1 | 1234
User 2 | 39174
User 3 | 29883
The difference is that the individual sections can be changed easily and positioned easily.
- Blaze349
-
Scratcher
1000+ posts
Databases
Variables. Allowing us near-instantaneous storage and use of a single bit of data. Infinitely useful.Variables don't give you just one bit of data. A bit can only hold two values, 0 and 1 (though this is alright for booleans).
- BotanAI
-
Scratcher
100+ posts
Databases
Variables don't give you just one bit of data. A bit can only hold two values, 0 and 1 (though this is alright for booleans).
Sorry, confusing wording. I meant a bit like “a little bit,” not “one bit.” My bad.
-snip-
The difference is that the individual sections can be changed easily and positioned easily.
True.
Last edited by BotanAI (July 29, 2017 19:24:17)
- Charles12310
-
Scratcher
1000+ posts
Databases
Because I think this suggestion is very useful for leaderboards, custom variables, player data (they should be cloud), etc., I am going to revive this topic. (please don't complain about necroposting)
Anyways, I think the “databases” should be called tables. Tables are more understandable than databases, and databases can mean more than just a table, especially when it comes to internet terms.
Anyways, I think the “databases” should be called tables. Tables are more understandable than databases, and databases can mean more than just a table, especially when it comes to internet terms.
- -ShadowOfTheFuture-
-
Scratcher
1000+ posts
Databases
Support! I can see many instances in which this would be useful.
How about “arrays”?
Anyways, I think the “databases” should be called tables. Tables are more understandable than databases, and databases can mean more than just a table, especially when it comes to internet terms.
How about “arrays”?
- walkcycle
-
Scratcher
500+ posts
Databases
No support because this is too complicated for Scratch and we have lists for data. But as an extension it could be added.
- Charles12310
-
Scratcher
1000+ posts
Databases
No support because this is too complicated for Scratch and we have lists for data. But as an extension it could be added.I see no reason why this is confusing. As far as I know, tables/arrays can seem confusing at first, but when you look at how it works, it seems very understandable. Not everything has to be understandable at first glance. Not to mention that is you are going to make a large table, you have to make a lot of lists, and scripting can take extra time.
- HyperNova35
-
Scratcher
100+ posts
Databases
Support. Not sure if I completely understand what this is, but judging by this post:
it seems to be pretty useful.So, this is like Excel?Haha, that's one way to think of it. Yeah, basically.
- walkcycle
-
Scratcher
500+ posts
Databases
I see no reason why this is confusing.Who said it was confusing?

To make it less complicated, try reducing the number of blocks it takes.
add [Hello world] to column (1 v) of [database v] :: #e41b17
add [Hello world] to row (1 v) of [database v] :: #e41b17
insert [Hello world] at column (1 v) of [database v] :: #e41b17
insert [Hello world] at row (1 v) of [database v] :: #e41b17
delete item column: (1 v) row: (1 v) of [database v] :: #e41b17
replace item column: (1 v) row: (1 v) of [database v] with [Hello world] :: #e41b17
<[database v] contains [Hello world] ? :: #e41b17>
<column (1 v) of [database v] contains [Hello world] ? :: #e41b17>
<row (1 v) of [database v] contains [Hello world] ? :: #e41b17>
(item at column: (1 v) row: (1 v) of [database v] :: #e41b17)
(length of column (1 v) of [database v] :: #e41b17)
(length of row (1 v) of [database v] :: #e41b17)
(length of [database v] :: #e41b17)
it seems to be pretty useful.It would be useful for sure.

- DaEpikDude
-
Scratcher
1000+ posts
Databases
Well, kind of you?I see no reason why this is confusing.Who said it was confusing?
… because this is too complicated for Scratch…
Anyway, I really feel like having tables / databases / 2D lists / whatever would be really helpful for all sorts of things: specifically stat tables would be so much easier.
- Charles12310
-
Scratcher
1000+ posts
Databases
snip
add new row :: list
add [] to row (1 v) of [table v] :: list
insert [] to row (1 v) of [table v] :: list
replace (1 v) of row (1 v) of [table v] with [] :: list
delete (1 v) of row (1 v) of [table v] :: list
<row (1 v) of table contains []? :: list >
(item (1 v) of row (1 v) of [table v] :: list )
(length of row (1 v) of [table v] :: list )
(# of items in [table v] :: list )
To make it simpler.
- Discussion Forums
- » Suggestions
-
» Databases