Course:CPSC312-2024-wordle2

From UBC Wiki

Authors: Peter Lee, Ray Nguyen, Luke Joe

What is the problem?

We will be implementing Wordle into Haskell.

What is the something extra?

We will be implementing a text based GUI.

The game will simulate the real Wordle such as telling you which characters are correct and which characters are misplaced.

The word will be randomly picked from a list of words.


What did we learn from doing this?

We learnt that Functional Programming is suitable for the task to an extend such as the using recursion for showing which words are correctly placed and which ones are not. It was quite easy to implement and it was done with very short lines of code with very efficient compiling speed. However, at the start it was quite difficult to be able to map out the basic logistics behind the functions due to the short form of the Haskell language itself.

However, Haskell does not really have a user friendly interaction between randomization and input and output. It was impossible to cast a IO String onto a String since with functional programming we needed to able to clearly state that what parameters were going to be passed through the function, therefore we had to use other ways to work around it. However this lead to inputs being able to easily break the code such as inputting a String when it is expecting an Integer, this made error testing really hard to implement for our project.

With System.random we still had to implement our own randomization function from the library instead of just being able to use the library itself. We had to write our own randomization function and it had to be part of the scope of the main function. Or else we would have generated the same "random" word every time the game is loaded. Furthermore, Haskell is not very friendly with UTF encoding such as different colours and shapes. We were going to add different coloured shapes into our project as part of our text based GUI however Haskell was unable to encode them and therefore it caused an error everytime it was ran.

Work division

How was the workload divided? Who did what? (This can be in a private communication to the TA if you do not want it to be public).

Links to code etc.

https://github.com/Luke-Joe/haskell-wordle