- 5


process(1,Sp,1):-make_list([]).

process(4,Sp,0):-attent_window,window(Sp,0).

process(4,Sp,1):-delete_list(Sp).

process(2,Sp,0):-attent_window,window(Sp,0).

process(2,Sp,1):-view_list(Sp).

process(3,Sp,0):-add_list(Sp).

process(3,Sp,1 ):-add_list(Sp).

process(5,Sp,0):-attent_window,window(Sp,0).

process(5,Sp,1):-insert_sort(Sp,Sp1),view_list(Sp1).

process(6,Sp, 1 ):-sound2, exit. process(6,Sp,0):-sound2, exit.

/*------------------------------------ ---------------------------------*/

make_list(Sp):-makewindow(2,48,7," ",5,5,15,70),

gotowindow(2),cursor(3,8),

write(" - "),readint(N),

sound(8,2000),cursor(5,8),

write(" : "),Z=1,Sp=[],create(N,Sp,Z).

create(0,Sp,Z):-inversion(Sp,[]).create(N,Sp,Z):-

write(" # ",Z,"-"),readint(U),sound(8,3000),scroll(1,0),cursor(5,32),

N1 =N-1, Z1 =Z+1 ,create(N1 ,[U | Sp],Z1).

inversion([],Sp1 ):-window(Sp1,1).

inversion([H|T],Sp):-inversion(T,[H|Sp]).

323

/*---------------- ----------- */

attent_window:-akewindow(3, 64,7, "BHMAHE",10,25,5,30),gotowindow(3),nl,

write(" !"),sound(50,1 000), readchar(L).

/*------------------------- ---------------------*/

delete_list(Sp):-makewindow(8,48,7,"AEHE",5,15,15, 45), gotowindow(8)l

write(""),nl,

write(" - 1 "),nl,

write(" - 2 "),nl, cursor(7,5),readint(N),delete(N, Sp).

delete(1, Sp):-makewindow(9, 64, 7,"", 10, 23, 5, 30), gotowindow(9),nl,

write("CCOK AEH!"), sound1, readchar(U),window([], 0).

delete(2,Sp):-makewindow(4, 48, 7, " ", 10, 15, 5,45),

gotowindow(4),nl,

write(" : "),readint(S),N=0,

split(S,N,Sp,Sp1,[H|T]),connect(Sp1,T,Sp3),view_list(Sp3).

split(S, N,[H|T],[H|L1],L2):-N1=N+1,N1

split(S,N, [H|T],L1,[H|L2]):-N1=N+1,split(S,N1,T,L1,L2),N1>=S.