Solving a logical popular puzzle in Prolog.
Five teams from 5 California colleges (SJSU, De Anza, Foothill, UC Berkeley and UC Santa Cruz) are participating in a hackathon.
Each team has a team lead: Alex, Justin, Nicole, Tammy and Steven.
Each team is using a different programming language: Haskell, Java, JavaScript, Python and C++.
Each team has chosen a different color for the T-shirts they are wearing during the hackathon: blue, red, green, orange and purple.
Five companies are sponsoring these teams: Apple, Facebook, Google, IBM and Amazon.
The results are not out yet but the following information has been leaked:
- The team wearing blue placed ahead of the team wearing purple.
- The team wearing orange placed ahead of the team programming in Haskell.
- The team sponsored by IBM came in third.
- The team programming in Python placed ahead of the team wearing blue.
- The team wearing red did not place first.
- The team sponsored by Google placed ahead of the team wearing blue.
- The team programming in Haskell placed ahead of the team programming in JavaScript.
- The last team used C++.
We also know that:
- Tammy goes to SJSU.
- Alex will only program in Java.
- Justin's team is sponsored by Amazon.
- The SJSU team is sponsored by Facebook.
- The Foothill team is sponsored by IBM.
- Nicole's team is sponsored by Google.
- The Foothill team programs in JavaScript.
- The Berkeley team is wearing orange.
- The team sponsored by Apple is wearing red.
- The UC Santa Cruz team is wearing purple.
- The SJSU team is wearing blue.