Search code examples
prolog

Rerun prolog application automatically


I am designing a prolog game where i have to guess what sport the user is thinking. I have created a start game rule and a display result (triggered after the start game). I want the start_ game to be called automatically again right after the display result. I have created some list in the start game. am I suppose to clear the list before being able to trigger the start_ game?


Solution

  • main
    :-
    repeat ,
    start_game(RESULT) ,
    display_result(RESULT) ,
    fail
    .