Skip to content

Instantly share code, notes, and snippets.

@upvalue
Last active November 30, 2025 22:56
Show Gist options
  • Select an option

  • Save upvalue/324a7906e96a5c478dacbb37f7eba2c5 to your computer and use it in GitHub Desktop.

Select an option

Save upvalue/324a7906e96a5c478dacbb37f7eba2c5 to your computer and use it in GitHub Desktop.
prolog experiments

prolog experiments

some experiments with prolog

even(X) :-
0 is X mod 2.
odd(X) :-
1 is X mod 2.
% claude helps: https://claude.ai/chat/d66fb55c-a9b5-40cb-8ba2-17572d3b1b1d
% help know whether a color combination works or not
% outfit(coat/blazer/jacket, shirt, bottom)
% top(coat/blazer/jacket, shirt)
top(navy, white).
top(navy, white).
top(khaki, black).
top(khaki, charcoal).
top(khaki, navy).
top(navy, khaki).
light(white).
light(khaki).
dark(navy).
dark(black).
dark(charcoal).
outfit(Coat, Shirt, Bottom) :-
top(Coat, Shirt),
light(Shirt),
dark(Bottom).
outfit(Coat, Shirt, Bottom) :-
top(Coat, Shirt),
dark(Shirt),
light(Bottom).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment