# 312P2

## Contents

## Suduko X

#### Authors:Edgar, Britton, Drijon

### What is the problem?

We are going to re-explore our P1 topic in Prolog.

### What is the something extra?

We built a Sudoku solver in Prolog and then extended it to solve Sudoku-X problems.

### What did we learn from doing this?

We were originally planning on extending an existing Sudoku X solver, but soon after starting we found the solution in Prolog was trivial enough

to build from the ground up ourselves.

Compared to Haskell, the program was much simpler to implement in Prolog. In Prolog we simply had to give the constraints (all rows/columns/grids/diagonals to be distinct elements 1...9) and the program would logically give us the correct result, rather than having to write an algorithm that does pruning and backtracking search ourselves in Haskell.

The program was much easier to implement in Prolog but we believe a more efficient version could most likely be implemented in Haskell given the degree of control you have over

how the solution is found.