Example #1
0
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')))
Example #2
0
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))
Example #3
0
File: hanoi.py Project: miar/yap-il
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))
Example #4
0
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))
Example #5
0
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)"))
Example #7
0
def main():
    registerForeign(hello)
    prolog = Prolog()
    prolog.assertz("father(michael,john)")
    prolog.assertz("father(michael,gina)")    
    list(prolog.query("father(michael,X), hello(X)"))