Tic-tac-toe: I thought this post would never come...

CodeCaraCodeCara
4 min read

(This should have been posted on 03/11/24)

Things I've worked on/completed since my last post…

This has been a long time coming as I really went off track with this project and too much longer than I should have, but…

  • I completed Tic-tac-toe(!!!!!) Believe me, the five (brackeed) exclamation marks are necessary here.

https://codecara.github.io/tic-tac-toe-odin/

Things that went well...

  • Finishing the project. Accepting the imperfections in my code, especially when comparing other people’s solutions to my own.

Things that didn't go quite so well...

  • This week was mostly a positive week, so not much to report here.

Things I've learnt/need to improve on...

Here, I mainly want to talk about where i went seriously wrong with this project, which I will summarise in the following points:

  • I had no problem writing the procedural code for the logic of this game, however, this was not the aim of the project.

  • The whole concept of objects and how they interact with each other just completely threw me off and I felt completly lost as to how to put things together.

  • The module pattern was not clear in my head, in spite of trying to read around the subject (albeit it’s clearer now)

  • I felt like I was guessing a lot of the time.

  • I ended up getting a working version in the console, but in order to work, it required inputted information in the form of prompts, which of course meant I had to rejig a lot of things to tie this into the UI working version. I did not know that I could play the game in the console by simply calling functions in the console (this just never occurred to me, although it seems a lot more obvious now). Had I done this, I could have left my ‘console code’ untouched when it came to working on the interaction with the DOM (the displayController)

  • I eventually got something working, but my displayController had a lot going on it it. Somebody pointed this out to me trying to help, which made me think I had gone seriously wrong again and I started looking (very briefly!) at other’s people solutions - not to copy, but to have some idea of how they approached this.

    In all honestly, their solutions seemed beyond my capabilites and included getters and setters and other things I did not yet understand. I then looked at the Connect Four code example in the ‘Building a House from the Inside Out’ article and some of this also confused me (in that, I struggled to understand some parts of the code).

  • In the end, I just took out the prompts in my console game version and then tried to build the displayController and made any further adjustments as required as frankly, I felt like I was not going to finish this project (which I thought I would finish in a week).

  • I think I was a little overwhelmed by just not knowing how to put things together and looking at other people’s code which was more advanced and a lot cleaner than mine. I had never done this before (looked at other people’s solutions), but I thought it would give me an idea what to do. It didn’t help in the end and don’t plan to do that again until I have finished my own project - I would almost go so far as to say that it made things worse for me, as I felt like I was on the completely wrong track.

    As a few Odinites pointed out to me, some of these solutions have been modified by students as they progressed throughout the course, but at that time, I just thought I had fundamentally misunderstood the course theory and required approach. I can see now that some of the concepts included are not covered until later in the course and so looking at other’s solutions was a hindrance to me. Lesson learnt - I hope.

  • Am I now an expert on this project? No. Do I understand certain aspects of it better? Yes. I even find myself re-reading some help that other Odintes gave me and find myself thinking, why didn’t I understand it at the time?

    In any case, it’s time to move on…onwards and upwards, hopefully…

Plan for the forthcoming week...

I hope to at least get through the theory on:

  • Classes

  • ES6 Modules

  • NPM

0
Subscribe to my newsletter

Read articles from CodeCara directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

CodeCara
CodeCara