tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,26 @@
|
|||
$ include "seed7_05.s7i";
|
||||
|
||||
const string: start is "_###_##_#_#_#_#__#__";
|
||||
|
||||
const proc: main is func
|
||||
local
|
||||
var string: g0 is start;
|
||||
var string: g1 is start;
|
||||
var integer: generation is 0;
|
||||
var integer: i is 0;
|
||||
begin
|
||||
writeln(g0);
|
||||
for generation range 0 to 9 do
|
||||
for i range 2 to pred(length(g0)) do
|
||||
if g0[i-1] <> g0[i+1] then
|
||||
g1 @:= [i] g0[i];
|
||||
elsif g0[i] = '_' then
|
||||
g1 @:= [i] g0[i-1];
|
||||
else
|
||||
g1 @:= [i] '_'
|
||||
end if;
|
||||
end for;
|
||||
writeln(g1);
|
||||
g0 := g1;
|
||||
end for;
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue