MOS substitution: Difference between revisions

Inthar (talk | contribs)
Inthar (talk | contribs)
Line 212: Line 212:
== Pseudocode ==
== Pseudocode ==
<syntaxhighlight lang="py">
<syntaxhighlight lang="py">
def letterwise_subst(template_word, slot, filling_word):
def letterwise_subst(template_word, slot_letter, filling_word):
     result = ""
     result = ""
     i = 0
     i = 0
     for letter in template_word:
     for letter in template_word:
         if letter == slot:
         if letter == slot_letter:
             result += filling_word[i]
             result += filling_word[i]
             i += 1
             i += 1