Question: How can I create and compare lists from 2 words on scratch/snap? I'm trying to create a block that will take 2 words that are

How can I create and compare lists from 2 words on scratch/snap?

I'm trying to create a block that will take 2 words that are no longer than 4 letters and create 2 lists containing each of the characters in these words. The block will then report which characters from the 2 words are the same.

For example:

Word 1: ABCG List 1: A, B, C, G

Word 2: EBFG List 2: E, B, F, G

The bock will then report 2 and 4 because the 2nd and 4th values of words 1 and 2 are the same.

So far I have:

How can I create and compare lists from 2 words on scratch/snap?

However, when I run this block it reports 0.

I'm trying to create a block that will take 2 words that

How do I fix this?

+ matching + characters + word1 + word2 + script variables word1 word2 list1 list24 set list1 to word list word1 set list to word list word2 for each item in list1 report keep items list1 = list2 from list2 + length: 1 matching characters ABCG EBFG + matching + characters + word1 + word2 + script variables word1 word2 list1 list24 set list1 to word list word1 set list to word list word2 for each item in list1 report keep items list1 = list2 from list2 + length: 1 matching characters ABCG EBFG

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!