Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

mcjc29/WDI_PROJECT_1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WDI-30 Project 1 - True || False

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).


You are asked to submit a list of names to randomly generate the student to solve the expression.

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 expression is then printed out on the screen one character at a time.

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published