Help me to optimize the blocks

This is my blocks, I am trying from yesterday to reduce this block but i am unable to do. can anyone help me

Yes it can be reduced.
I don’t have system so I can’t show blocks.
But I will try to explain.

  1. Create two lists
    Eg : list1 = list from CSV (a,b,c,d…) and other list for other font

  2. Use for loop


Or use Dictionaries :slight_smile:


Yes that will be a better way

1 Like

You can use dictionary and use replace text mappings. :sweat_smile:


I am not familairy with dictionary block. can you plz show blocks. :neutral_face:

its work only with “Z” ( last letter ) :pensive:

A Dictionary is basically a list of key and value pairs. You can use it to make a mapping of the characters to its replacement. If you know JSON, it is similar to Objects.

Here’s an example of using Dictionaries for character mapping which is exactly what you are looking for: Chars exchanges. Dictionary. Json to csv. Transliteration - Tutorials and Guides - MIT App Inventor Community


Show your blocks

1 Like

this is my block according to your suggestion

Here is a little example


And if you want to simplify:
First make this dictionary, then press Do it.

Copy the result

Use that this extension to convert the copied text to dictionary

Delete all dictionary blocks.
Do the same as my previous post to replace text


Well @WatermelonIce already gave you block.
But if you are using for then you have to use
For I in list : your list
Replace item I
With item in list2
index: of i in list 1


Thanks for helping me , but can you help me without using Dictionary blocks :grin:

what you mean by For I in list

There is a block in list category
For item in list

1 Like


This uses the dictionary blocks, but after all the dictionary blocks is not needed

1 Like

Is my blocks correct ?