инфа / Глава 2 раздел 2
.docГлава 2 Раздел 2
program Project;
{$APPTYPE CONSOLE}
uses
SysUtils, windows;
var
c : char;
N : integer;
begin
repeat
Writeln('napravlenie peremescheniya : S - Sever, V - Vostok, U - Ug, Z - Zapad');
write('c = ');
readln(c);
until(c in ['S','V','U','Z']);
repeat
writeln('Vvedite komandu : 0 - vpered, 1 - vpravo, 2 - nazad, 3 - vlevo');
readln(N);
until(N=0) or (N=1) or (N=2) or (N=3);
case c of
'S' : case N of
0 : c := 'S';
1 : c := 'V';
2 : c := 'U';
3 : c := 'Z';
end;
'V' : case N of
0 : c := 'V';
1 : c := 'U';
2 : c := 'S';
3 : c := 'Z';
end;
'U' : case N of
0 : c := 'U';
1 : c := 'Z';
2 : c := 'V';
3 : c := 'S';
end;
'Z' : case N of
0 : c := 'Z';
1 : c := 'S';
2 : c := 'U';
3 : c := 'V';
end;
end;
writeln('Napravlenie dvijeniya : ',c);
Readln;
end.