Course:CPSC312-2021/Sudoku

From UBC Wiki

Title

Authors: Heidi, Yanli

What is the problem?

We will implement a Sudoku game using Haskell.

User can choose 3 levels : EASY, MEDIUM, HARD, and the program will generates a random Sudoku with the difficulty level which user chosen. Each time the player enter a number, the program will check if the corresponding row, col and box have duplicated number. The player wins when he/she complete the sudoku without any duplicated number in every rows, cols and boxes. Also, the player can press the "give up" button and see the solution.

What is the something extra?

  • A user-friendly gui
  • Using Random system to generate a random Sudoku.
  • haskell id and transpose functions

What did we learn from doing this?

By implementing this program, we found that Haskell is a really lazy language. We used lazy evaluation , and it saves the runtime and makes our program more efficient. All data in Haskell is immutable, so it minimize the complexity and makes the program brief and clear.

We also learned how to program a GUI program in Haskell. For example, we learned how to use a css style sheet to design the layout of a widget, and how to make buttons, labels and popup windows.

Links to code etc

https://github.com/HeidiCai/Sudoku