Prolog suitable for this problem?

From: Stephen Waits (steve_at_waits.net)
Date: 02/26/04

  • Next message: Szász Bence: "Beginner"
    Date: 26 Feb 2004 11:20:07 -0800
    
    

    Hi all,

    I'm new to Prolog, but not letting that slow me down :)

    Anyway, I need to encode a set of game rules... (imagine basketball,
    or hockey, in which case the rules would be based on the NBA or NHL
    official rules).

    Let's say that connected to this Rules code is an Engine, which moves
    players around, deals with the ball, or puck, goals, court/rink
    markings, etc. This Engine sends events to the Rules code, which then
    controls the flow of the game. For example, on a certain event, the
    Rules code might set the game to a free-throw state, make an icing
    call, determine the quarter/period has expired, etc.

    The idea here being that we could easily substitute different
    rulesets, say perhaps College, or High School; or even Practice, or
    "Horse", or a Penalty Shot Challenge, etc...

    My plan has been to code this Ruleset as a handcoded HSM; however, now
    I'm wondering if Prolog might make more sense. That leads me to my
    specific questions:

    *) Does Prolog make any sense for this problem? Actually, the real
    question should be: Does Prolog make more sense than a handcoded HSM
    for this problem?

    *) If so, how would you approach this type of game ruleset in Prolog?

    Thanks,
    Steve

    P.S. - I'm looking for the straight dope; don't hesitate to talk to me
    like I've been coding Prolog since Borland was actually producing
    something innovative products. I might not get it right away, but
    won't bother you with my inexperience - I'll catch up quickly.


  • Next message: Szász Bence: "Beginner"

    Relevant Pages

    • Re: Prolog suitable for this problem?
      ... inferences on multiple rules at once) then Prolog would again be perfect. ... This Engine sends events to the Rules code, ... > controls the flow of the game. ... how would you approach this type of game ruleset in Prolog? ...
      (comp.lang.prolog)
    • Re: Prolog suitable for this problem?
      ... basketball, cricket and ice-hockey all in the same language, but on the ... enforcing the game could be implemented in the game engine. ... Prolog probably won't be appropriate as a means ...
      (comp.lang.prolog)
    • Re: Prolog for the AI part of games
      ... example Python) to implement a game. ... I really like Prolog and hope ... Either way, run-time handling of FSMs is easy in imperative languages, ... the real "what it takes" of games programming appears to be ...
      (comp.lang.prolog)
    • Re: Prolog AI for Game of Go
      ... Vasile V. Alaiba wrote: ... I am unable to find some useful information on how to create a simple ... AI in Prolog for the Game of Go. ... A sentence containing all of simple, Prolog, AI and "Go" is an oxymoron. ...
      (comp.lang.prolog)
    • Prolog the right tool?
      ... I want to encode a ruleset for a domain in first-order predicate logic. ... conjunctions/disjunctions), perform goal regression, etc. ... Is Prolog the right tool for this job? ...
      (comp.lang.prolog)