def main(): registerForeign(hello) prolog = Prolog() #prolog.assertz("father(michael,john)") #prolog.assertz("father(michael,gina)") #list(prolog.query("father(michael,X), hello(X)")) Query(readFileSee('/home/tyler/Documents/Github/crosswordSolver/word_list.txt')))
def main(): def notify(t): print "move disk from %s pole to %s pole." % tuple(t) notify.arity = 1 prolog = Prolog() registerForeign(notify) prolog.consult("hanoi.pl") list(prolog.query("hanoi(%d)" % N))
def main(): N = 3 INTERACTIVITY = True prolog = Prolog() tower = Tower(N, INTERACTIVITY) notifier = Notifier(tower.move) registerForeign(notifier.notify) prolog.consult("hanoi.pl") list(prolog.query("hanoi(%d)" % N))
def main(): #digunakan untuk membuat fungsi main() N = 3 #pendeklarasian nilai N adalah 3 INTERACTIVITY = True prolog = Prolog() tower = Tower(N, INTERACTIVITY) notifier = Notifier(tower.move) registerForeign(notifier.notify) prolog.consult("prolog_file/hanoi.pl") list(prolog.query("hanoi(%d)" % N))
def main(): registerForeign(hello) prolog = Prolog() prolog.assertz("father(michael,john)") prolog.assertz("father(michael,gina)") list(prolog.query("father(michael,X), hello(X)"))