Skip to content

This repository contains some of the projects I built using JavaScript, now gradually converted to TypeScript.

Notifications You must be signed in to change notification settings

2iaad/TypeScript

Repository files navigation

🎲 Tenzies Game (TypeScript + React)

A modern implementation of the classic Tenzies dice game built with React and TypeScript (TSX). The goal of the game is simple: roll the dice until all of them show the same number, while strategically freezing dice between rolls.

This project focuses on clean component design, state management, and strong typing using TypeScript.

Tenzies Game Screenshot


🚀 Features

  • 🎯 Classic Tenzies game rules
  • 🔁 Roll dice until all values match
  • 📌 Freeze/unfreeze individual dice
  • 🧠 Win detection logic
  • ⏱️ Optional roll counter / timer (if implemented)
  • ⚛️ Built with React functional components
  • 🧾 Fully written in TypeScript (TSX)

🛠️ Tech Stack

  • React
  • TypeScript
  • Vite (for fast development)
  • CSS / Tailwind CSS (depending on your setup)

📂 Project Structure

src/
│── App.tsx           # Main application logic
│── index.tsx         # Entry point
│── components/       # Reusable UI components
│   ├── Die.tsx
│   ├── DiceGrid.tsx
│   └── ...
│── index.css         # Global styles

🎮 How to Play

  1. Click Roll to roll all dice.
  2. Click on a die to freeze its value.
  3. Continue rolling until all dice show the same number.
  4. When all dice are frozen and identical, you win 🎉

▶️ Getting Started

1. Clone the repository

git clone https://github.com/2iaad/tenzies-game.git
cd tenzies-game

2. Install dependencies

npm install

3. Run the development server

npm run dev

Open your browser at:

http://localhost:5173

🧠 What I Practiced in This Project

  • React state management with hooks
  • Immutable updates to arrays and objects
  • TypeScript interfaces and props typing
  • Component-based architecture
  • Game logic and condition checks

📄 License

This project is for learning and educational purposes.


🙌 Author

Built by Ziyad Derfoufi as part of learning React and TypeScript.

If you have suggestions or feedback, feel free to open an issue or pull request.

About

This repository contains some of the projects I built using JavaScript, now gradually converted to TypeScript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published