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
thanks

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

2 Likes

Or use Dictionaries :slight_smile:

2 Likes

Yes that will be a better way

1 Like

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

3 Likes

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.

https://docs.kodular.io/blocks/dictionaries/

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

2 Likes

Show your blocks

1 Like

this is my block according to your suggestion

Here is a little example

6 Likes

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

2 Likes

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

2 Likes

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

Why?


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

1 Like


Is my blocks correct ?