diff --git a/jour10/jour10.bs b/jour10/jour10.bs new file mode 100644 index 0000000..e4f29fa --- /dev/null +++ b/jour10/jour10.bs @@ -0,0 +1,26 @@ +basInput$ = "1113222113" +pred$ = "" +act$ = "" +new$ = "" +k = 0 + +for i = 0 to 40 + print i, " / 40" + for j = 1 to len(basInput$) step k + k = 1 + act$ = mid$(basInput$, j, 1) + pred$ = act$ + while pred$ = act$ and (j + k) < len(basInput$) + pred$ = act$ + act$ = mid$(basInput$, j + k, 1) + k = k + 1 + if act$ <> pred$ then + k = k - 1 + endif + wend + new$ = new$ + str$(k) + pred$ + next j + basInput$ = new$ + next i + +print "La longeur de la chaine finale est ", len(basInput$)