Skip to content

Instantly share code, notes, and snippets.

@chrisamaphone
Created March 2, 2022 16:02
Show Gist options
  • Save chrisamaphone/f9334c3dc66321c97b3ef4566a1a7ca6 to your computer and use it in GitHub Desktop.
Save chrisamaphone/f9334c3dc66321c97b3ef4566a1a7ca6 to your computer and use it in GitHub Desktop.
#const width=10.
dim(1..width).
tile_type(water;floor;gem;tree;player).
1 {at(X,Y,T) : tile_type(T)} 1
:- dim(X), dim(Y).
#show at/3.
% The player has to start at the start tile
% :- start(X, Y), not at(X,Y,player).
% There must be exactly one tile with the player at it
1 {at(X,Y,player) : dim(X), dim(Y)} 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment