LOVEGUN

Fonction Thue Morse

Jan 14th, 2021
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.26 KB | None | 0 0
  1. Function Thue_Morse (ch:String): String;
  2. Var
  3.   x: String;
  4.   i: Integer;
  5. Begin
  6.   x := '';
  7.   For i:=1 To Length (ch) Do
  8.     Begin
  9.       If ch[i]='0' Then
  10.         x := x+'01';
  11.       If ch[i]='1' Then
  12.         x := x+'10';
  13.     End;
  14.   Thue_Morse := x;
  15. End;
Advertisement
Add Comment
Please, Sign In to add comment