Skip to content

mokhtar-khaled/Challenge-Arena

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Challenge Arena

A competitive Programming Platform

A fun and interactive console-based platform for students to solve algorithmic challenges, learn programming concepts, and compete with peers through a global leaderboard system.

๐ŸŽฏ Overview

This project is designed to help students:

  • Solve stimulating algorithmic problems
  • Compare performance with other solutions
  • Learn through practice with graduated challenges
  • Develop computational thinking skills

The platform provides 5 unique coding challenges with varying difficulty levels, a persistent scoring system, and a competitive leaderboard.

โœจ Features

Core Features

  • ๐ŸŽจ Attractive ASCII art interface with colored menus and visual feedback
  • ๐Ÿ‘ค User management system with personalized welcome messages
  • ๐Ÿ’พ Persistent data storage using text files (users.txt, scores.txt)
  • ๐Ÿ† Global leaderboard to track top performers
  • ๐Ÿ“Š Individual statistics tracking for each player
  • ๐ŸŽฏ Dynamic scoring based on challenge difficulty and performance efficiency

User Experience

  • New users receive a welcome message and start fresh
  • Returning users see "Welcome back" with their current statistics
  • Real-time feedback on challenge performance
  • Personal best tracking for each challenge

๐ŸŽฒ Challenges

1. ๐ŸŽฏ Le Compte est Bon (30 points)

Difficulty: โญโญโญ

Find a combination of mathematical operations to reach a target number using given numbers.

  • Input: 6 numbers and a target
  • Output: Sequence of operations (e.g., 25*5=125, 125+10=135, 135-2=133)
  • Scoring: Based on time taken and solution correctness

2. ๐Ÿงฉ Mastermind Algorithmique (25 points)

Difficulty: โญโญโญ

Guess a secret 4-digit sequence with feedback on correct/misplaced digits.

  • Mechanic: System provides hints (โœ“ for correct position, ? for wrong position)
  • Goal: Minimize the number of attempts (max 10 attempts)
  • Scoring: Fewer attempts = higher score

3. ๐Ÿค– Course de Robots (50 points)

Difficulty: โญโญโญโญโญ

Find the shortest path through a maze from start (S) to end (E).

  • Input: 10x10 grid with walls, start, and finish
  • Output: Sequence of movements (N, S, E, O for North/South/East/West)
  • Visualization: Path is displayed on the maze
  • Scoring: Shorter paths earn more points

4. ๐Ÿ“Š Tri Ultime (20 points)

Difficulty: โญโญ

Sort an array using swap operations with minimal swaps.

  • Goal: Sort an 8-element array
  • Constraint: Minimize the number of swap operations
  • Scoring: Fewer swaps = higher score

5. ๐Ÿ—ผ Tour de Hanoi (40 points)

Difficulty: โญโญโญโญ

Solve the classic Tower of Hanoi puzzle with 4 disks.

  • Rules:
    • Move all disks from tower A to tower C
    • Only one disk can be moved at a time
    • Larger disks cannot be placed on smaller disks
  • Minimum moves: 15 (2^4 - 1)
  • Scoring: Closer to optimal = higher score

๐Ÿš€ Installation

Prerequisites

  • GCC compiler or any C compiler
  • Terminal/Console access

Compilation

# Clone the repository
git clone <your-github-repo-url>
cd programming-challenges-platform

# Compile the program
gcc main.c -o challenges

# Run the program
./challenges

For Windows:

gcc main.c -o challenges.exe
challenges.exe

๐Ÿ“– Usage

  1. Start the program and enter your name
  2. Choose a challenge from the main menu (1-5)
  3. Complete the challenge by following the on-screen instructions
  4. View your score after completing each challenge
  5. Check the leaderboard (option 6) to see how you rank
  6. View your statistics (option 7) to track your progress

First-Time Users

Enter your name: Alice
Welcome, Alice! Let's start your coding journey! ๐Ÿš€

Returning Users

Enter your name: Alice
Welcome back, Alice!
Your Statistics:
  โ€ข Total Score: 85 points
  โ€ข Challenges Completed: 3/5

๐ŸŽฏ Scoring System

Each challenge awards points based on:

  1. Base difficulty points (fixed per challenge)
  2. Performance efficiency (varies by challenge type):
    • Time taken (Le Compte est Bon)
    • Number of attempts (Mastermind)
    • Path length (Course de Robots)
    • Number of swaps (Tri Ultime)
    • Number of moves (Tour de Hanoi)

Point Distribution

Challenge Max Points Difficulty
Le Compte est Bon 30 โญโญโญ
Mastermind 25 โญโญโญ
Course de Robots 50 โญโญโญโญโญ
Tri Ultime 20 โญโญ
Tour de Hanoi 40 โญโญโญโญ
Total Possible 165 -

Personal Best System

  • Each player's best score per challenge is saved
  • Only improvements update the total score
  • Encourages replay to optimize solutions

๐Ÿ“ File Structure

programming-challenges-platform/
โ”œโ”€โ”€ main.c                 # Main source code
โ”œโ”€โ”€ users.txt             # Stores registered usernames
โ”œโ”€โ”€ scores.txt            # Stores player scores (auto-generated)
โ””โ”€โ”€ README.md             # This file

Data Files Format

users.txt:

Alice
Bob
Charlie

scores.txt:

Alice,30,25,50,20,40,165,5
Bob,28,20,45,18,35,146,5
Charlie,25,23,0,20,0,68,3

Format: name,compte_bon,mastermind,robot,tri,hanoi,total,completed

๐Ÿ› ๏ธ Technologies

  • Language: C (Standard C99)
  • Libraries Used:
    • stdio.h - Input/output operations
    • stdlib.h - Memory allocation and system functions
    • string.h - String manipulation
    • time.h - Time tracking for scoring
    • ctype.h - Character type checking

๐ŸŽ“ Learning Outcomes

By using this platform, students will practice:

  • Algorithm design and optimization
  • Problem decomposition and logical thinking
  • Data structures (arrays, sequences)
  • File I/O operations and data persistence
  • Pathfinding algorithms (BFS/DFS concepts)
  • Recursive thinking (Tower of Hanoi)
  • Sorting algorithms and efficiency analysis

๐Ÿ† Leaderboard

The global leaderboard displays:

  • Top 10 players ranked by total score
  • Player name
  • Total accumulated points
  • Number of challenges completed

Players are sorted by total score in descending order, encouraging friendly competition!

๐Ÿ“ Notes

  • All data is stored locally in text files
  • Scores persist across sessions
  • The program uses console-based UI with ASCII art
  • Cross-platform compatible (Windows, Linux, macOS)

๐Ÿค Contributing

This project is part of an academic assignment. Suggestions for improvements are welcome!

๐Ÿ“ง Contact

For questions or feedback about this project, please contact through the course platform.


Made with โค๏ธ for learning and fun coding challenges!

๐Ÿš€ Happy Coding! ๐Ÿš€

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 100.0%