這是個prolog程式,能解決4x4的數獨問題
例:
?- sudoku ([4,2,0,0]/[0,1,0,2]/[0,0,1,0]/[1,0,0,4], Solution).
Solution = [[4,2,3,1]/[3,1,4,2]/[2,4,1,3]/[1,3,2,4]]
標簽:
prolog
程式
上傳時間:
2017-07-21
上傳用戶:rocwangdp
Solving Problem inheritance by prolog
The parents of Mark are Linda and Peter. The parents of Fiona are Linda and Peter. The parents of Andrea are Fiona and Andrew. The parents of John are Fiona and Andrew. The parents of Eileen are Andrea and Alan. The parents of Jane are Andrea and Alan.
Total Inheritance Everyone in my family, who holds a PhD should receive $100,000. Everyone in my family, receives $3,000 for every aunt they have who holds a PhD. Everyone in my family, receives $2,000 for every uncle they have who holds a PhD. Everyone in my family, receives $100 for every sibling holding a University degree.
Peter, Mark, and Fiona hold a PhD. Mark, Linda, and Andrea all hold a MSc. Andrew, John, Alan, Eileen hold a BSc. Jane holds a Tafe certificate.
標簽:
parents
inheritance
The
Solving
上傳時間:
2014-01-08
上傳用戶:15071087253