Step 5 - Sort indexes

Genereate all_csv file

Once all the formulas are done (all the csv), we execute the following line:

python FORMULAS/append_csv.py <txt_name>

For our example it is this:

python FORMULAS/append_csv.py quadratic

Understandig all_csv file

This will generate a new file in the CSV folder from step 4 called all_csv.csv. Once created, I recommend opening it with the LibreOffice Calc program, but you can do it with English.

If you try to open it with LibreOffice the following window will appear:

../_images/ODS1.png

Click on one of the columns of the data and press Ctrl + a and this will select all the columns:

../_images/ODS2.png

Then, in the Column Type property, select Text, and then press Ok.

../_images/ODS3.png

This all_csv file will contain the following format, is separated by steps, and each step distinguishes the following parts:

../_images/ODS4.png
  • PRE_FORMULAS CONFIG
    • Before transformation
      • pre_fade: The symbols indicated by these indexes disappear before the animation.

      • pre_copy: Explanation below.

    • While transformation occurs
      • run_fade: The symbols indicated by these indexes disappear during the animation.

  • POS_FORMULAS CONFIG
    • While transformation occurs
      • run_write: The symbols indicated by these indexes appear (with the Write animation) during the animation.

    • After transformation
      • pos_write: The symbols indicated by these indexes appear (with the Write animation) after the animation.

      • pos_copy: Explanation below.

It is recommended to use colors to detect the symbols that are repeated in a pattern:

../_images/ODS5.png

Sort indexes

Then, the indexes must be related one by one. that is to say:

0 a

1 x

2 2

3 +

4 b

5 x

6 +

7 c

8 =

9 0

0 a

1 x

2 2

3 +

4 b

5 x

7 -

8 c

6 =

9

We see that the first 6 symbols (from 0 to 5) are identical, but the rest are not, and the last symbol of the pre_formula has no relation, so it must disappear, either using run_fade or pre_fade. So the sheet looks like this:

../_images/ODS6.png

Warning

Remember to save the file in .ods format, because the CSV format only saves the row and column format.

Special case

In the event that a symbol of one pre_form is transformed into two of pos_formula then the following has to be done: (we will use Step 2 as an example)

../_images/ODS7.png

In this example we see that index 0 of the pre_formula is going to be transformed into index 5 and 11 of the pos_formula. In these cases a copy of the index of the pre_formula must be made, then we decided that index 0 will become symbol 5 and that copy 0 will become 11. That is:

0 a

0 copy a

5 a

11 a

In the event that many formulas are transformed to one, then they simply repeat the index of the pos_formula as many times as necessary. Here is the fully ordered ODS file for reference.