-
-
Save morganwilde/6622014 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program gyvatė; | |
var | |
taskas, tarpp, liko, ilgis, tarpo, laik, tn : integer; | |
begin | |
tn := 1; | |
while tn = 1 do | |
begin | |
Randomize; | |
taskas := Random(15)+5; | |
tarpp := 0; | |
liko := taskas - 1; | |
while liko > 0 do | |
begin | |
// komentaras | |
for laik:=1 to tarpp do write(' '); | |
liko := taskas - tarpp-1; | |
ilgis := Random(liko-2)+2; | |
// kitas | |
for laik:=1 to ilgis do write('x'); | |
tarpo := liko - ilgis; | |
for laik:=0 to tarpo do write(' '); | |
if liko > 0 then | |
begin | |
writeln('o'); | |
tarpp := tarpp + ilgis - 1; | |
end | |
else | |
begin | |
if ilgis <> 2 then writeln('x'); | |
writeln; | |
writeln('Jei dar kartą spausk 1'); | |
Readln(tn); | |
end; | |
end; | |
end; | |
Readln; | |
end. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment