begin; randomize; x:=windowwidth-300; y:=0; for i:=1 to 10 do begin; for j:=1 to 10 do begin; rectangle(x,y,x+a,y+a); x+=a; end; y+=a; x:=windowwidth-300; end; x:=random(1,10); y:=random(1,10); t:=0; while t<>10 do begin; readln(xt); readln(yt); if (xt<>x) and (yt<>y) then begin; xl:=windowwidth+xt*30-300; yl:=300-yt*30; cross(xl,yl,a); inc(t); end; if (xt=x) or (yt=y) then begin; xl:=windowwidth+xt*30-305; yl:=300-yt*30+4; floodfill(xl,yl,clBlue); inc(t); end; if (xt=x) and (yt=y) then begin; xl:=windowwidth+xt*30-305; yl:=300-yt*30+4; floodfill(xl,yl,clRed); writeln('Ты выиграл!'); break; end; end; if t=10 then begin; writeln('Ты проиграл!'); xl:=windowwidth+x*30-305; yl:=300-y*30+4; floodfill(xl,yl,clRed); end; end.
#include <string>
#include <time.h>
using namespace std;
void main()
{
srand(time(NULL));
int n,k=0,k1=4;
cin >> n; //вводишь количество символов
string *s=new string [n];
for (int i = 0;i < n;++i)
{
while (k == k1)
{
k = rand() % 3;
}
switch (k)
{
case 0:s[i] = '0';cout << s[i];break;
case 1:s[i] ='1';cout << s[i];break; //вместо 0,1,2 пишешь свой алфавит .
case 2:s[i] ='2';cout << s[i];break;
}
k1 = k;
}
system("pause");
}
GraphABC;
const
a=30;
var
xt,yt,x,y,i,j,t,xl,yl:integer;
procedure cross(x,y,a:integer);
begin;
setpencolor(clred);
line(x,y,x-a,y+a);
line(x-a,y,x,y+a);
setpencolor(clblack);
end;
begin;
randomize;
x:=windowwidth-300;
y:=0;
for i:=1 to 10 do
begin;
for j:=1 to 10 do
begin;
rectangle(x,y,x+a,y+a);
x+=a;
end;
y+=a;
x:=windowwidth-300;
end;
x:=random(1,10);
y:=random(1,10);
t:=0;
while t<>10 do
begin;
readln(xt);
readln(yt);
if (xt<>x) and (yt<>y) then
begin;
xl:=windowwidth+xt*30-300;
yl:=300-yt*30;
cross(xl,yl,a);
inc(t);
end;
if (xt=x) or (yt=y) then
begin;
xl:=windowwidth+xt*30-305;
yl:=300-yt*30+4;
floodfill(xl,yl,clBlue);
inc(t);
end;
if (xt=x) and (yt=y) then
begin;
xl:=windowwidth+xt*30-305;
yl:=300-yt*30+4;
floodfill(xl,yl,clRed);
writeln('Ты выиграл!');
break;
end;
end;
if t=10 then
begin;
writeln('Ты проиграл!');
xl:=windowwidth+x*30-305;
yl:=300-y*30+4;
floodfill(xl,yl,clRed);
end;
end.