. , , ,

,,,

- " " Prolog — ,

CODE=12050

/* **************************

* ߠ *

* *

* ࠠ *

* *

**************************

*/

domains

z,i,n,n1,ko,ob,pl=integer

na,j=symbol

database -svod1

svod1(n,j,ko,ob,pl)

database -lolo

lolo(n,na,i,ob,pl)

database -kuku

kuku(n,na,ko,i,pl)

database

svod(n,na,ko,ob,pl)

predicates

start

patch

load

select(i)

sel(i,i)

process(i)

procedure(i)

sve(i)

lod(i)

repeat

goal

start.

clauses

/* */

start:-

makewindow(1,2,7," ",0,0,25,80),

clearwindow,

load,

patch.

/* */

patch:-

repeat,

cursor(7,0),

write(" 0 - pp... "),nl,

write(" 1 - "),nl,

write(" 2 - "),nl,

write(" 3 - "),nl,

write(" 4 - "),nl,

write(" 5 - "),nl,

write(" 6 - "),nl,

write(" 7 - "),nl,

write(" 8 - -"),nl,

write(" 9 - "),nl,

write(" =>"),

readint(Choice),

Choice >= 0,

Choice < 10,

clearwindow,

process(Choice),

clearwindow,

Choice = 9,

retractall(_),

removewindow.

/* */

load:-

existfile("slava.dat"),

consult("slava.dat"),

cursor(1,2),

write(" ").

load:-

cursor(1,2),

write(" ").

/*pp */

process(7):-

makewindow(1,2,7," ",0,0,25,80),

nl,

write(" 𠠠 :"),readint(K),nl,

write(" :"),readln(O),nl,

write(" :"),readint(I),nl,

write(" 蠠 :"),readint(Y),nl,

write(" :"),readint(T),nl,

N1=K,NA1=O,KO1=I,OB1=Y,PL1=T,

assertz(svod(N1,NA1,KO1,OB1,PL1)),

removewindow,

fail.

/* -*/

process(8):-

makewindow(1,2,7,"-",0,0,25,80),

nl,

write(" :"),readint(A),nl,nl,

svod(N,NA,KO,OB,PL),

A=N,

write(" 蠠 :"),write(A),nl,

write(" :"),write(NA),nl,

write(" :"),write(KO),nl,

write(" 蠠 :"),write(OB),nl,

write(" :"),write(PL),nl,nl,nl,

write(" "),

readchar(_),

removewindow,

!.

process(8):-

write(" ."),

write(" "),nl,nl,nl,

write(" :"),

readint(A),nl,

A=N1,

write(" :"),readln(F),nl,

write(" :"),readint(Y),nl,

write(" 蠠 :"),readint(J),nl,

write(" :"),readint(G),nl,

NA1=F,KO1=Y,OB1=J,PL1=G,

assertz(svod(N1,NA1,KO1,OB1,PL1)),

removewindow,

fail.

/*pp pp*/

process(0):-

makewindow(1,2,7," pp...",0,0,25,80),

write(" p-p "),nl,nl,

write(" "),nl,nl,

write(" -TURBO-PROLOG v.2.0. "),nl,nl,

write(" p: . "),nl,nl,

write(" , p.-1-94 () 1995 . "),nl,nl,nl,nl,

write(" "),

readchar(_),

removewindow.

/* */

process(1):-

makewindow(1,2,7,"pp ",0,0,25,80),

nl,

select(N),

X=N,

svod(X,NA,KO,OB,PL),

write(" 蠠 :"),write(N),nl,

write(" :"),write(NA),nl,

write(" :"),write(KO),nl,

write(" 蠠 :"),write(OB),nl,

write(" :"),write(PL),nl,

nl,

write(" :"),readln(NA1),nl,

write(" :"),readint(KO1),nl,

write(" 蠠 :"),readint(OB1),nl,

write(" :"),readint(PL1),nl,

X1=X,

retract(svod(X,NA,KO,OB,PL)),

assert(svod(X1,NA1,KO1,OB1,PL1)),

!,

removewindow.

/* */

process(2):-

makewindow(1,2,7," ",0,0,25,80),

nl,

select(N),

X=N,

svod(X,NA,KO,OB,PL),

retract(svod(X,NA,KO,OB,PL)),!,

removewindow.

/* */

process(3):-

makewindow(1,2,7,"p ",0,0,25,80),

nl,

write("__________________________________________________________________!"),

write(" ߠ "),

nl,

write("------------------------------------------------------------------!"),

nl,

write("!! ! ! 젠 ! !"),

nl,

write("! ! ! ! ! "),

nl,

write("-------------------------------------------------------------------"),

nl,

svod(N,NA,KO,OB,PL),

cursor(Z,_),

cursor(Z,0),write(N),

cursor(Z,8),write(NA),

cursor(Z,27),write(KO),

cursor(Z,42),write(OB),

cursor(Z,54),write(PL),

cursor(Z,66),write("!"),

nl,

fail.

process(3):-

write("-------------------------------------------------------------------"),

nl,

write(" "),

readchar(_),

removewindow.

/* */

process(4):-

nl,

makewindow(2,15,4,"",5,5,20,70),

write("1 - "),nl,

write("2 - slava.dat"),nl,

write("3 - "),nl,

write("==>"),

readint(C),

C>0,C<4,

lod(C),

!,

removewindow.

/* */

process(5):-

nl,

makewindow(2,15,4,"",5,5,20,70),

write("1 - "),nl,

write("2 - slava.dat"),nl,

write("3 - "),nl,

write("==>"),

readint(I),

I>0,I<4,

sve(I),!,

removewindow.

/* */

process(6):-

nl,

makewindow(3,2,7," ",0,0,25,80),

write("1 - "),nl,

write("2 - "),nl,

write("3 - "),nl,

write("4 - "),nl,

write("==>"),

readint(O),

O>0,O<5,

procedure(O),

removewindow.

process(_).

/* */

procedure(1):-

makewindow(1,2,7," ",0,0,25,80),

nl,

cursor(7,10),

retractall(_,svod1),

nl,

write(" , "),

nl,

write(" :"),

readln(X),

svod(N,NA,KO,OB,PL),

S=NA,

S=X,

N1=N,KO1=KO,OB1=OB,PL1=PL,

assert(svod1(N1,S,KO1,OB1,PL1)),

fail.

procedure(1):-

write(" "),nl,

write("__________________________________________________________________!"),

write(" ߠ "),

nl,

write("------------------------------------------------------------------!"),

nl,

write("!! ! ! 젠 ! !"),

nl,

write("! ! ! ! ! "),

nl,

write("-------------------------------------------------------------------"),

nl,

svod1(N,S,KO,OB,PL),

cursor(Z,_),

cursor(Z,0),write(N),

cursor(Z,8),write(S),

cursor(Z,27),write(KO),

cursor(Z,42),write(OB),

cursor(Z,54),write(PL),

cursor(Z,66),write("!"),

nl,

fail.

procedure(1):-

write("-------------------------------------------------------------------"),

save("not.dat",svod1),

nl,

write(" not.dat"),

nl,

write(" "),

readchar(_),

removewindow,

!.

procedure(1):-

write("-------------------------------------------------------------------"),

nl,

write(" "),

nl,

write(" "),

readchar(_),

makewindow(1,2,7," ",0,0,25,80).

procedure(2):-

makewindow(1,2,7," ",0,0,25,80),

nl,

cursor(7,10),

retractall(_,lolo),

nl,

write(" , "),nl,

write(" :"),

readint(X),

svod(N,NA,KO,OB,PL),

S=KO,

S>=X,

N1=N,NA1=NA,OB1=OB,PL1=PL,

assert(lolo(N1,NA1,S,OB1,PL1)),

fail.

procedure(2):-

write(" "),nl,

write("__________________________________________________________________!"),

write(" ߠ "),

nl,

write("------------------------------------------------------------------!"),

nl,

write("!! ! ! 젠 ! !"),

nl,

write("! ! ! ! ! "),

nl,

write("-------------------------------------------------------------------"),

nl,

lolo(N,NA,S,OB,PL),

cursor(Z,_),

cursor(Z,0),write(N),

cursor(Z,8),write(NA),

cursor(Z,27),write(S),

cursor(Z,42),write(OB),

cursor(Z,54),write(PL),

cursor(Z,66),write("!"),

nl,

fail.

procedure(2):-

write("-----------------------------------------------------------------------------"),

save("not1.dat",lolo),

nl,

write(" not1.dat"),

nl,

write(" "),

readchar(_),

removewindow,

!.

procedure(2):-

write("-------------------------------------------------------------------"),

nl,

write(" "),

nl,

write(" "),

readchar(_),

makewindow(1,2,7," ",0,0,25,80).

procedure(3):-

makewindow(1,2,7," ",0,0,25,80),

nl,

cursor(7,10),

retractall(_,kuku),

nl,

write(" , "),

nl,

write(" :"),

readint(X),

svod(N,NA,KO,OB,PL),

S=OB,

S>=X,

N1=N,NA1=NA,KO1=KO,PL1=PL,

assert(kuku(N1,NA1,KO1,S,PL1)),

fail.

procedure(3):-

write(" "),nl,

write("__________________________________________________________________!"),

write(" ߠ "),

nl,

write("------------------------------------------------------------------!"),

nl,

write("!! ! ! 젠 ! !"),

nl,

write("! ! ! ! ! "),

nl,

write("-------------------------------------------------------------------"),

nl,

kuku(N,NA,KO,S,PL),

cursor(Z,_),

cursor(Z,0),write(N),

cursor(Z,8),write(NA),

cursor(Z,27),write(KO),

cursor(Z,42),write(S),

cursor(Z,54),write(PL),

cursor(Z,66),write("!"),

nl,

fail.

procedure(3):-

write("-------------------------------------------------------------------"),

save("not2.dat",kuku),

nl,

write(" not.dat"),

nl,

write(" "),

readchar(_),

removewindow,

!.

procedure(3):-

write("-------------------------------------------------------------------"),

nl,

write(" "),

nl,

write(" "),

readchar(_),

makewindow(1,2,7," ",0,0,25,80).

/* */

sve(1):-

write(" :"),

readln(N),

save(N),

write(" "),

beep,

!.

sve(1):-

write(" , "),

readchar(_).

sve(2):-

save("slava.dat").

sve(3).

/* */

lod(1):-

retractall(_),

write(" :"),

readln(N),

existfile(N),

consult(N),

write(" "),

beep,

!.

lod(1):-

nl,

write(" "),nl,

write(" "),

readchar(_).

lod(2):-

retractall(_),

existfile("slava.dat"),

consult("slava.dat"),

write(" "),

beep,

!.

lod(2):-

write(" slava.dat "),nl,

write(" "),

readchar(_).

lod(3).

repeat.

repeat:- repeat.

/* */

select(N):-

nl,

write("1 - "),nl,

write("2 - "),nl,

write("3 - "),nl,

write("4 - "),nl,

write("5 - "),nl,

write("==>"),

readint(X),

sel(X,N).

sel(1,N):-

nl,

write(" 蠠 :"),

readint(N),

svod(M,_,_,_,_),

M=N.

sel(1,N):-

N=0.

sel(2,N):-

nl,

write(" :"),

readln(L),

svod(Z,L,_,_,_),

N=Z.

sel(2,N):-

N=0.

sel(3,N):-

nl,

write(" : "),

readint(F),

svod(Z,_,F,_,_),

N=Z.

sel(3,N):-

N=0.

sel(4,N):-

nl,

write(" :"),

readint(Q),

svod(Z,_,_,Q,_),

N=Z.

sel(4,N):-

N=0.

sel(5,N):-

nl,

write(" :"),

readint(W),

svod(Z,_,_,_,W),

N=Z.

CODE=12050 /* ************************** * ߠ * * * * ࠠ * * * ***************

 

 

 

! , , , .
. , :