I have two arrays ‘won1’ and ’ won2’ to compare with ‘win’ win is an array of arrays that have all the possible results to the winner. when I compare ‘won1’ to ‘win’ - once I’ve gained the game - it works and alerts that “X won”, but when the “O wins the game”, it doesn’t alert anything. I’m using a function in which I just call win and won1/won2.
Here’s my code on code pen:
it’s quite messy but I’m just trying things out.
Also, I have no idea how to make the game ‘unwinnable’, so any tips would be appreciated.
If I’m overcomplicating things, please tell me, I’ve done this all on my own so I didn’t come up with a better way to approach this challenge.