19 lines
363 B
Prolog
19 lines
363 B
Prolog
login :-
|
|
getdata(_, _),
|
|
writeln('Welcome!').
|
|
login :-
|
|
repeat,
|
|
writeln('Sorry, you are not permitted.'),
|
|
getdata(_, _),
|
|
writeln('Welcome').
|
|
|
|
getdata(Name, Password) :-
|
|
write('Username: '),
|
|
read(Name),
|
|
write('Password: '),
|
|
read(Password),
|
|
user(Name, Password).
|
|
|
|
user(john, john1).
|
|
user(jimmy, jimmy1).
|
|
user(mary, mary1).
|