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

#1 2010-04-21 17:59:35

Zxblqcktptyjsplkn
Scratcher
Registered: 2009-10-24
Posts: 100+

Lists multiplication

We need a way to multiply lists by other lists so the answer generates a list, like how you multiply matrices.

Offline

 

#2 2010-04-21 18:03:53

BWOG
Scratcher
Registered: 2008-09-19
Posts: 1000+

Re: Lists multiplication

I don't get it. Do you mean like this?

List 1
|1. 2
|2. 2
|3. 3
List 2
|1. 2
|2. 5
|3. 1
Multiply lists
1. 4
2. 10
3. 3

Offline

 

#3 2010-04-21 18:13:15

Zxblqcktptyjsplkn
Scratcher
Registered: 2009-10-24
Posts: 100+

Re: Lists multiplication

Yes. Like that. Please tell me that isn't how it works now, or I'm an idiot.

Offline

 

#4 2010-04-21 18:32:12

BWOG
Scratcher
Registered: 2008-09-19
Posts: 1000+

Re: Lists multiplication

Well, you could do ( (Item (1) of [List1] ) X (Item (1) of [List2] ) )

Offline

 

#5 2010-04-22 03:08:06

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Lists multiplication

I think that block is rather silly - there's not much use for it, and what would the block look like?

You can just do this:

http://img708.imageshack.us/img708/1774/143ascriptformultiplyin.png

It's not complex, and honestly, I think it's better than making a block for that.

Last edited by Jonathanpb (2010-04-22 03:09:13)


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#6 2010-04-22 11:05:29

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Lists multiplication

Jonathanpb wrote:

I think that block is rather silly - there's not much use for it, and what would the block look like?

You can just do this:

http://img708.imageshack.us/img708/1774 … iplyin.png

It's not complex, and honestly, I think it's better than making a block for that.

The problem is that whenever you use a repeat block it's extremely laggy.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#7 2010-04-22 12:47:34

Zxblqcktptyjsplkn
Scratcher
Registered: 2009-10-24
Posts: 100+

Re: Lists multiplication

It also adds a new variable. And it really should work the way I described it anyway.

It would look like multiplication of two lists. This would let it, when multiplied, give a list as an answer instead of a single number.

Last edited by Zxblqcktptyjsplkn (2010-04-22 12:49:02)

Offline

 

#8 2010-04-23 01:51:10

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Lists multiplication

Jonathanpb wrote:

I think that block is rather silly - there's not much use for it, and what would the block look like?

You can just do this:

http://img708.imageshack.us/img708/1774/143ascriptformultiplyin.png

It's not complex, and honestly, I think it's better than making a block for that.


juststickman wrote:

The problem is that whenever you use a repeat block it's extremely laggy.

It's not laggy... it's quite good.

Zxblqcktptyjsplkn wrote:

It also adds a new variable.

What's so bad about having a variable?  hmm


Blocks are supposed to be simple and for good reasons (ie. [switch to costume [ ]]) - I don't think that the multiplication block would be very good. It just wouldn't fit in...  hmm

Last edited by Jonathanpb (2010-04-23 01:52:01)


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

Board footer