Tic Tac Toe
- 5 Devlogs
- 8 Total hours
Tic Tac Toe
Tic Tac Toe
Hey Everyone,
I made some serious improvement in my project.
I used ncurses library to improve the UI and i fixed the repetitive board which before kept coming to a single board to look more asthetic and a premium finished product.
what bugs i faced:
i forget to declare the prototype and update the rest of the code where i was using printBoard(board) to printBoard(board,cursor_row,cursor_col) to use the arrow keys to look more refine.
Hey Everyone , After struggling to beat AI in my Tic-Tac-toe project i threw some restrictions to beat AI using Difficulty levels.
Bugs i encountered:
The Bracket: I somehow endup mixing all of the backets here and there and it took me a while to fix the trap and because of the bracket trap everytime user was playing PvP AI was playing instead of player 2 for which everytime player 2 was winnin but at the end somehow i managed to fix it.
SETTING up Difficulty Bar: when i was trying to set up the difficulty bar to easy it was taking random guesses but it was looking realistic because the grid has only 9 blocks to move but it was still better although i dropped the idea previously saying it was too dumb but yeah sometimes it makes sense and in Medium difficulty it uses 50% of it brain and the rest random guesses but the game changes at Hard i also call it Unbeatable level here you can rarely beat AI even if you try so hard you will meet draw everytime.
i am slowly trying to express myself,
Happy Coding hour
PIZZA:)
Hey everyone, As you know i was trying to build computer vs player,
i tried to build the algorithm minimax but failed miserably last time so prepared myself and built the computer vs player so lets talk about what problems i faced during the build.
0 for a tie, it assumed a full board was the worst possible outcome in the universe. If I trapped the AI in a fork where it knew it couldn’t win, it would literally skip its turn and refuse to play! I had to build a fallback block to force it to accept its fate.scanf input logic for the second player! The code was just reaching that block.was trying to improve my project by allowing player to play with the computer but i just couldn’t finish it well so will come back with better solution and the random computer felt so dumb to me i don’t want anyone to experience that ! Yeah that’s it if any want want to share idea am Open to consider any ideas :)
after joining cs50 a month ago am finally able to build a tic tac toe .Now its a basic but i will try to improve it and those semicolon became my greatest obstacle but still somehow i cracked it and will try to make it more interactive with automation and all