users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnu prolog as rule evaluator for small C virtual-world game.


From: Lindsey Spratt
Subject: Re: Gnu prolog as rule evaluator for small C virtual-world game.
Date: Thu, 10 Apr 2003 08:31:37 -0500


On Wednesday, April 9, 2003, at 09:35  AM, address@hidden wrote:

How do I make a program able to interoperate with gnu-prolog as if the program
itself was the user?

I am trying this with C, to make it easier for myself.
I am aware of Pl_Query, the problem is that I do not know in advance (compile-time)
which facts will be asserted to prolog.
I am only trying to add new facts runtime, not present new queries.

Example:
During play, it is suddenly decided that due to game-balance, some of the
players should have more money.
So the following new facts should be added to the rule engine:

'credits(player1,1000)'
'credits(player2,1000)'
...
'credits(player100,1000)'

How can I state these facts to prolog runtime?

This has come up before.

Look in the archive for messages with the subject "Re: Trying to add facts during runtime in VC++ " on February 17 with myself and Vic Bancroft as authors. Vic provided an explicit simple approach to solving this problem, adequate to your problem but less general than Jerry Gerstmann's solution.

Lindsey Spratt
http://homepage.mac.com/lspratt






reply via email to

[Prev in Thread] Current Thread [Next in Thread]