First Attempt at Prolog Programming

The simplest program ever. It tells us what flavour(s) of ice cream are available in Stanford’s Arillaga Dining Hall.

Program

flavour(chocolate).

Query


flavour(chocolate)
Yes.
flavour(vanilla)
No.

It took two words of code to do this. In Java it would probably take more than 5 lines. I think I like logic programming.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s