Skip to content

BanTheRewind/learn-by-ai

Repository files navigation

Four Player Tic-Tac-Toe - Learning Project

Welcome to your coding journey! This project will teach you web development by building a fun, retro-styled game from scratch.

🎮 What You're Building

A browser-based tic-tac-toe game with:

  • 4 players competing on a 5x5 grid
  • 3-in-a-row wins (horizontal, vertical, diagonal)
  • Smart AI opponents that block and try to win
  • Retro 80s arcade aesthetic with animations and sounds
  • Mobile-friendly responsive design

📁 Project Structure

learn-by-ai/
├── example/           ← My completed version (reference)
│   ├── index.html
│   ├── styles.css
│   ├── game.js
│   ├── ai.js
│   ├── sounds.js
│   └── sounds/
├── student/           ← Your version (you build this!)
├── STEP 1: Setup.md   ← Detailed instructions for each step
├── STEP 2: Menu.md
├── STEP 3: Board.md
├── ... (through STEP 12)
└── README.md          ← You are here!

🚀 Getting Started

For Complete Beginners:

  1. Open the STEP 1: Setup.md file - This has everything you need to start
  2. Follow each step carefully - Read the explanations
  3. Type the code yourself - Don't just copy/paste (you'll learn more!)
  4. Test after each step - Make sure it works before moving on
  5. Compare with my example/ folder if you get stuck

How to Work Through This:

Each step file includes:

  • What you're building in that step
  • Why it matters (learning concepts)
  • Step-by-step instructions for you to follow
  • Code explanations so you understand what each line does
  • Success criteria to know you're done
  • Troubleshooting tips for common issues

Two Folders Approach:

  • example/ - My completed code. Use this as reference when stuck.
  • student/ - Your workspace. Build the game here following the step guides.

When you finish a step, you can compare your code with mine to see different approaches!

📚 What You'll Learn

Technical Skills:

  • HTML - Structure of web pages
  • CSS - Styling and animations
  • JavaScript - Programming logic and interactivity
  • Git - Version control (industry standard)
  • Deployment - Publishing to the internet

Programming Concepts:

  • Variables and data types
  • Functions and parameters
  • Arrays and loops
  • Conditional logic (if/else)
  • Event handling
  • Algorithm design (AI logic)
  • Game state management

Professional Skills:

  • Problem-solving
  • Debugging
  • Code organization
  • Documentation
  • Testing
  • User experience design

🎯 Step-by-Step Guide

  1. STEP 1: Setup - Create basic HTML file
  2. STEP 2: Menu - Build player selection screen
  3. STEP 3: Board - Create 5x5 game grid
  4. STEP 4: Turn Logic - Implement player turns
  5. STEP 5: Win Detection - Check for 3-in-a-row
  6. STEP 6: AI Basic - Add random AI moves
  7. STEP 7: AI Smart - Make AI block and attack
  8. STEP 8: Animations - Add retro visual effects
  9. STEP 9: Win Celebration - Win/tie animations
  10. STEP 10: Sounds - Add retro sound effects
  11. STEP 11: Polish - Mobile support & cleanup
  12. STEP 12: Deployment - Put it on the internet!

Time estimate: 8-15 hours total (1-2 hours per step)

💡 Tips for Success

Do's:

✅ Read the explanations - don't just copy code ✅ Type code manually - builds muscle memory ✅ Test after each change - catch errors early ✅ Use the browser console (F12) - see what's happening ✅ Take breaks - learning is a marathon, not a sprint ✅ Ask questions - confusion is part of learning!

Don'ts:

❌ Don't skip steps - they build on each other ❌ Don't copy/paste without understanding ❌ Don't worry about making it perfect ❌ Don't compare your progress to others ❌ Don't give up when stuck - debugging is normal!

🔧 Tools You'll Need

Required:

  • Web Browser - Chrome, Firefox, or Safari
  • Text Editor - VS Code (recommended), Sublime Text, or even Notepad

Optional but Helpful:

  • VS Code Extensions:
    • Live Server (preview in real-time)
    • Prettier (code formatting)
    • HTML CSS Support

🐛 Getting Help

If you're stuck:

  1. Check the browser console (F12 key)

    • Red text = errors
    • Read the error message carefully
  2. Compare with my example/ folder

    • See how I did it
    • Note: there are multiple right ways!
  3. Re-read the step instructions

    • The answer is usually there
  4. Google the error message

    • Millions of developers have been stuck too!
  5. Take a break and come back

    • Fresh eyes solve problems

🎓 After You Finish

Show Off Your Work:

  • Deploy to GitHub Pages (Step 12)
  • Share on LinkedIn
  • Add to your portfolio
  • Show friends and family!

What's Next:

  • Build another project (todo app, calculator, etc.)
  • Learn React or Vue.js
  • Study computer science fundamentals
  • Contribute to open source
  • Apply for junior developer positions!

Your Completed Project Proves:

✅ You can build working software ✅ You understand web fundamentals ✅ You can solve complex problems ✅ You can learn independently ✅ You're ready for more advanced topics!

📝 Comparing Your Work with Mine

After each step:

  1. Test your version - make sure it works
  2. Open my example/ folder
  3. Compare the code
  4. Note differences - both versions might be correct!
  5. Understand why I made certain choices

Remember: There's rarely one "right" way to code something!

🎉 Celebrate Your Progress

After completing each step, celebrate! You're learning valuable skills that can lead to a career in tech.

This project teaches you:

  • Skills used daily by professional developers
  • Technologies that power millions of websites
  • Problem-solving approaches that apply everywhere
  • How to learn new technical concepts

🚀 Ready to Start?

Open STEP 1: Setup.md and begin your journey!

Remember:

  • Go at your own pace
  • Don't worry about being perfect
  • Enjoy the process of creating!

Happy coding! 🎮👨‍💻👩‍💻


Technologies Used

  • HTML5
  • CSS3 (Grid, Animations, Media Queries)
  • Vanilla JavaScript (ES6+)
  • Web Audio API
  • Git & GitHub Pages

License

This is a learning project - feel free to use, modify, and share!


Questions? Found a bug? Have suggestions?

This is your learning project - experiment, break things, fix them, and most importantly, have fun! 🚀

About

An example of how I'm teaching my son to code using modern tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published