Two weeks into the course were given four days to build an in-browser game using HTML, CSS and JavaScript (jQuery library used). Rather then replicating an existing game, I took inspiration from studying formal logic at university and created True || False (a program to solve expressions using logical operators).
Using Math.random, a sub-expression is randomly created and bracketed. An arbitrary number of these sub-expressions are pushed to an array. This is looped over, the sub-expressions concatenated with the random assignment of the logical operators (conjunction and disjunction) where some sub-expressions have been negated.
The exciting part was attempting to show the solution to the expression as a student would work it out themselves, determining the truth value of a sub-expression one at a time.
This proved very challenging because once a sub-expression is solved the indices of the other characters in the array had shifted minus the expression and it's brackets and added the insertion of the truth value.
I really enjoyed this project in particular battling with the logic problem of being able to display the steps of the solution to the expression. It provided a great learning experience of how to break down a problem and attempt to solve it in various ways.