Studi Kasus : PROLOG
12.1 Membahas Contoh Program Prolog Perulangan Segitiga Bintang loopa(A,B):- (A>0, loopb(B),nl, C is A-1, D is B+1, loopa(C,D); A=0,nl). loopb(D):- ( D>0,write('*'), B is D-1, loopb(B); D=0,write('')). menu :- write('-------MENU-------'),nl, write('1. Biodata'),nl, write('2. Segitiga'),nl, write('3. Keluar'),nl, write('Masukkan pilihan : '), read(PIL), nl, (PIL=1,nl, write('------BIODATA------'),nl, write('Nama saya : '),read(A),nl, write('NPM saya : '),read(B),nl, write('-------------------'),nl, write('Nama saya : '),write(A),nl, write('NPM saya : '),write(B),nl, menu; PIL=2,nl, write('Nilai perulangan : '),read(A),loopa(A,1), menu; PIL=3,nl, write('Makasih'),nl). 12.2 Membuat Program Sederhana Prolog Perulangan Segitiga Angka loopa(A,B):- (A>0, loop