Tic Tac Toe game project focused on Javascript Factory Functions, Module Pattern usage.
Game logic built with Factory functions / Module Pattern.
-
UX:
- Game for 2 players / no AI-opponent available.
- Each player can add his name or play with default name: "player X" / "player Y".
- Inputs are disabled when game is on.
- Restart button available.
- Marker shows which player's turn for the next move.
Built with:
- HTML,
- CSS(Sass),
- Vanilla JavaScript.
The Odin Project project assignment: https://www.theodinproject.com/lessons/node-path-javascript-tic-tac-toe Design Patterns: https://www.patterns.dev/posts#design-patterns
In progress.
The Module pattern and factory function require careful planning of the application's behavior and placing the "logic" in the right place. However, as a result, the code has a chance to remain organized, it is easier to work with, and allows for the use of "namespacing", which solves naming conflicts. Working with the Module pattern or factory requires getting used to it but pays off with better workflow.
Initially, I had trouble accessing certain data, such as inputs, to use them for displaying the names entered by players instead of default names. After all I wish to learn more about Module Patterns.