Cam Dresie

Greetings! I spend my weekdays building the future of AI in the legal industry at Ontra. I'm a California licensed attorney and hold a law degree from Washington University in St. Louis and a Masters in Computer and Information Technology from the University of Pennsylvania.

Learn More →
Cam Dresie

Connect Four Game

This project utilizes object-oriented JavaScript to complete a connect four game. In this program, heavy use is made of JavaScript's class constructors to create each aspect of the game (the players, tokens, board, spaces, and game itself). The program is highly modular, with each aspect coded in its own file for high readability. When the game begins, the first player uses the arrow keys to control their token and then drops the token in the slot of their choosing. The game alternates between both players until one has placed four tokens in a row. They are then declared the winner! If both players play all their tokens and there is no winner, a message is displayed. After either ending event, a message is displayed telling the user to refresh the browser to start a new game.

Technologies
  • HTML
  • CSS
  • JavaScript
  • JavaScript Classes
  • jQuery
Live DemoGitHub Repo