-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProlog_ReturnList.pro
31 lines (24 loc) · 1.01 KB
/
Prolog_ReturnList.pro
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
append( [], X, X). % your 2nd line
append( [X | Y], Z, [X | W]) :- append( Y, Z, W). % your first line
% boss(Name, Type) Name = Name of boss, Type = Attack type
boss(kraken,magic).
boss(scorpia,melee).
boss(zulrah,ranged).
boss(cerberus,melee).
boss(abyssal_sire,melee).
boss(obor,melee).
boss(sarachnis,ranged).
boss(skotizo,melee).
boss(venenatis,magic).
superEffective(magic,melee). %magic is more effective against melee
superEffective(ranged,magic). %ranged is more effective against magic
superEffective(melee,ranged). %melee is more effective against ranged
verify_con(Boss, ConBoss) :- boss(Boss,MainSkill),
superEffective(MainSkill,ConSkill),
boss(ConBoss,ConSkill), !.
verify_con_list([],[]).
verify_con_list([H|T], LIST) :- verify_con(H, ConBoss),
verify_con_list(T, L1),
append([ConBoss],L1, LIST).
%verify_con(kraken, A).
%verify_con_list([kraken, scorpia, zulrah], A).