-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.pl
48 lines (33 loc) · 894 Bytes
/
main.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
:-ensure_loaded(golog2_32).
:-ensure_loaded(fabrica).
:-ensure_loaded(instrumentos).
:-ensure_loaded(relacoes).
:-ensure_loaded(menu).
:-ensure_loaded(pecas).
:-ensure_loaded(alarm).
cls :- write('\e[H\e[2J').
start:-
cls,
def_fabrica,
def_instrumento,
def_pecas,
def_alarm,
def_is_in_relation,
def_is_a_relation,
def_has_relation.
%Method that gets the date we are currently on.
%date(year,month,day,hour,minute,seconds,offset relative to ITC in seconds, Local timezone, true if daylight saving time applies to the current time)
get_date(D):-
get_time(T),
stamp_date_time(T,D,'UTC').
readListUntil(List,End):-
(readElement((E,N),End)-> List=[(E,N)|L1],
readListUntil(L1,End);
List=[]).
readElement((E,N), End):-
read(E),
dif(E,End),
read(N).
display_values_from_list([H|T]):-
write(H),nl,
display_values_from_list(T).