Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Pujan-sarkar authored Jun 9, 2024
2 parents 9dadc5e + fbee699 commit 7af7ef8
Show file tree
Hide file tree
Showing 114 changed files with 3,990 additions and 345 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr_tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@
# labels: prLabels.map(function(label) {
# return label.name;
# })
# });
# });
43 changes: 43 additions & 0 deletions Games/Anagram -Word-Game/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# **Anagram Word Game**

---

<br>

## **Description 📃**

- Anagram Word Game is an engaging web-based game where players are challenged to unscramble a given set of letters to form a correct word. This game is designed to test and enhance players' vocabulary and cognitive skills in a fun and interactive way, providing an enjoyable gaming experience for all ages.

## **Functionalities 🎮**

- Presents players with a scrambled word.
- Allows players to input their guessed word.
- Provides instant feedback on the correctness of the guessed word.
- Generates a new scrambled word for each game session.
- Tracks and displays the player's score.
- Features a sleek and intuitive user interface for seamless gaming.

<br>

## **How to play? 🕹️**

1. Launch the Anagram Word Game in your browser.
2. Observe the scrambled word presented on the screen.
3. Enter your guess for the correct word into the provided input field.
4. Click "Submit Guess" to verify your answer.
5. If correct, you'll receive a confirmation message and your score will increase; otherwise, try again or click "Give Up" to reveal the correct word.
6. Click "Next Word" to generate a new scrambled word and continue playing.

<br>

## **Screenshots 📸**

![image](https://github.com/manishh12/GameZone/assets/97523900/c24e9b9f-fdf2-4d3f-87c3-b2780bd27063)


<br>
<!-- add your screenshots like this -->
<!-- ![image](url) -->

<br>

26 changes: 26 additions & 0 deletions Games/Anagram -Word-Game/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anagram Word Game</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>Anagram Word Game</h1>
<div id="game-container">
<p id="scrambled-word"></p>
<input type="text" id="guess" placeholder="Enter your guess">
<button id="submit-guess">Submit Guess</button>
<button id="give-up">Give Up</button>
<p id="result-message"></p>
<button id="next-word">Next Word</button>
</div>
<div id="score-container">
<p>Score: <span id="score">0</span></p>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
52 changes: 52 additions & 0 deletions Games/Anagram -Word-Game/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const words = ["javascript", "python", "programming", "developer", "computer"];
let currentWord = '';
let scrambledWord = '';
let score = 0;

function scrambleWord(word) {
let scrambled = word.split('').sort(() => 0.5 - Math.random()).join('');
return scrambled;
}

function pickRandomWord() {
const randomIndex = Math.floor(Math.random() * words.length);
currentWord = words[randomIndex];
scrambledWord = scrambleWord(currentWord);
document.getElementById('scrambled-word').innerText = scrambledWord;
}

function checkGuess() {
const guess = document.getElementById('guess').value.toLowerCase();
if (guess === currentWord) {
document.getElementById('result-message').innerText = `Correct! The word was "${currentWord}".`;
score += 10;
document.getElementById('score').innerText = score;
document.getElementById('next-word').style.display = 'inline-block';
document.getElementById('submit-guess').disabled = true;
document.getElementById('give-up').disabled = true;
} else {
document.getElementById('result-message').innerText = "Incorrect, try again.";
score -= 2;
document.getElementById('score').innerText = score;
}
}

function giveUp() {
document.getElementById('result-message').innerText = `The correct word was "${currentWord}".`;
document.getElementById('next-word').style.display = 'inline-block';
document.getElementById('submit-guess').disabled = true;
document.getElementById('give-up').disabled = true;
}

document.getElementById('submit-guess').addEventListener('click', checkGuess);
document.getElementById('give-up').addEventListener('click', giveUp);
document.getElementById('next-word').addEventListener('click', () => {
document.getElementById('guess').value = '';
document.getElementById('result-message').innerText = '';
document.getElementById('next-word').style.display = 'none';
document.getElementById('submit-guess').disabled = false;
document.getElementById('give-up').disabled = false;
pickRandomWord();
});

pickRandomWord();
76 changes: 76 additions & 0 deletions Games/Anagram -Word-Game/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
body {
font-family: 'Arial', sans-serif;
background: linear-gradient(135deg, #0f9997, #e9ecef);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}

.container {
text-align: center;
background-color: #fff;
padding: 20px;
border-radius: 12px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
max-width: 400px;
width: 100%;
}

h1 {
margin-bottom: 20px;
color: #343a40;
}

#game-container {
margin-top: 20px;
}

#scrambled-word {
font-size: 24px;
margin-bottom: 20px;
color: #007BFF;
font-weight: bold;
}

input {
padding: 10px;
margin: 5px;
font-size: 16px;
border: 1px solid #ced4da;
border-radius: 4px;
width: calc(100% - 22px);
}

button {
padding: 10px 15px;
margin: 5px;
font-size: 16px;
border: 1px solid #007BFF;
border-radius: 4px;
background-color: #007BFF;
color: white;
cursor: pointer;
width: calc(100% - 22px);
}

button:hover {
background-color: #0056b3;
}

#result-message {
margin-top: 20px;
font-size: 18px;
}

#next-word {
display: none;
margin-top: 20px;
}

#score-container {
margin-top: 20px;
font-size: 18px;
color: #495057;
}
12 changes: 12 additions & 0 deletions Games/Buliding Block Game/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Building Block Game

## About Building Blocks Game
Building blocks game is a fun game for kids of all ages. In this game, our target is to construct the highest tower by arranging blocks one over the other such that we never disobey Newton’s law by this line we mean no block can hang in the air. It has to be over some other block or over the ground.

Project Prerequisites
To implement this project we need to know the following :

1. Basic concepts of JavaScript
2. HTML
3. CSS

1 change: 1 addition & 0 deletions Games/Buliding Block Game/assets
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c:\Users\aasth\OneDrive\Pictures\Screenshots\Screenshot (266).png
19 changes: 19 additions & 0 deletions Games/Buliding Block Game/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<meta name="viewport" content="width=device-width,user-scalable=no">
<link rel="stylesheet" href="style.css">
<div id="container">
<div id="game"></div>
<div id="score">0</div>
<div id="instructions">Click (or press the spacebar) to place the block</div>
<div class="game-over">
<h2>Game Over</h2>
<p>You did great, you're the best.</p>
<p>Click or spacebar to start again</p>
</div>
<div class="game-ready">
<div id="start-button">Start</div>
<div></div>
</div>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/r83/three.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js'></script>
<script src="script.js"></script>
Loading

0 comments on commit 7af7ef8

Please sign in to comment.