Re: XcD Language
Alan Baljeu <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
It is a pattern-matching rules-based language. CHR is a more advanced version of this sort of language, and in fact the entire game could easily be implemented with CHR rules. In the following, the left side is matching (and deleting) terms in the CHR datastore, and the right side is inserting terms in the datastore, but can be any ordinary Prolog. % ordinal moving player(+X,Y) <=> player(X+1,Y). player(-X+1,Y) <=> player(X,Y). player(X,+Y) <=> player(X,Y+1). player(X,-Y+1) <=> player(X,Y). % player push crate player(+X,Y) \ crate(X+1, Y) <=> crate(+X+1,Y). % kitty eats fruit kitty(X,Y), fruit(X,Z) <=> kitty(X,Z). kitty(X,Y), fruit(Z,Y) <=> kitty(Z,Y). To fully implement it, you'd have to think more carefully about the data structures you make so you don't have to repeat everything 4x for each direction. Alan Baljeu ________________________________ From: Anne Ogborn <[email protected]> To: swipl list <[email protected]> Sent: Thursday, March 27, 2014 1:32:50 AM Subject: [SWIPL] XcD Language Here, now all of YOU can waste your evening: http://www.puzzlescript.net/ insanely addictive little language for describing tile based games So what sort of language is this? _______________________________________________ SWI-Prolog mailing list [email protected] https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog -------------- next part -------------- HTML attachment scrubbed and removed