Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Wordmix Game #4132

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Games/Wordmix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# **WordMix**

---

<br>

## **Description 📃**

- WordMix: Merge & Win is a captivating web-based game where players merge two given words to form a single word by alternating letters. This game not only challenges players' vocabulary skills but also tests their creativity in word manipulation, offering an immersive and enjoyable gaming experience.

## **Functionalities 🎮**

- Presents players with a pair of words to merge.
- Allows players to input their merged word.
- Provides instant feedback on the correctness of the merged word.
- Generates a new word pair for each game session.
- Features a sleek and intuitive user interface for seamless gaming.

<br>

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

1. Launch WordMix: Merge & Win in your browser.
2. Observe the pair of words presented on the screen.
3. Merge the two words by alternating letters to form a single, coherent word.
4. Enter your merged word into the provided input field.
5. Click "Check" to verify your answer.
6. If correct, you'll receive a confirmation message; otherwise, the correct merged word will be displayed.
7. Click "Next" to generate a new word pair and continue playing.

<br>

## **Screenshots 📸**

![image](https://github.com/kunjgit/GameZone/assets/97523900/63b02e06-73b6-493e-a42d-09610b7762d2)


<br>
21 changes: 21 additions & 0 deletions Games/Wordmix/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wordmix</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>Wordmix</h1>
<p id="wordPair"></p>
<input type="text" id="mergedWordInput" placeholder="Enter merged word">
<button onclick="checkMergedWord()">Check</button>
<p id="result"></p>
<button onclick="generateWordPair()">Next</button>
</div>

<script src="script.js"></script>
</body>
</html>
34 changes: 34 additions & 0 deletions Games/Wordmix/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const wordList = ['apple', 'banana', 'orange', 'mango', 'kiwi', 'grape', 'peach'];
let word1, word2;

function generateWordPair() {
do {
word1 = wordList[Math.floor(Math.random() * wordList.length)];
word2 = wordList[Math.floor(Math.random() * wordList.length)];
} while (word1 === word2);

document.getElementById('wordPair').innerText = `Merge these two words: ${word1} and ${word2}`;
}

function checkMergedWord() {
const mergedWordInput = document.getElementById('mergedWordInput').value.toLowerCase();
const correctMergedWord = mergeWords(word1, word2);

if (mergedWordInput === correctMergedWord) {
document.getElementById('result').innerText = `Correct! The merged word is: ${correctMergedWord}`;
} else {
document.getElementById('result').innerText = `Incorrect! The correct merged word is: ${correctMergedWord}`;
}
}

function mergeWords(word1, word2) {
let mergedWord = '';
const minLength = Math.min(word1.length, word2.length);
for (let i = 0; i < minLength; i++) {
mergedWord += word1[i] + word2[i];
}
mergedWord += word1.slice(minLength) + word2.slice(minLength);
return mergedWord;
}

window.onload = generateWordPair;
44 changes: 44 additions & 0 deletions Games/Wordmix/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
body {
background-color: #f0f5f9; /* Light blue-gray */
font-family: Arial, sans-serif;
}

.container {
max-width: 400px;
margin: 50px auto;
text-align: center;
background-color: #ffffff; /* White */
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

input[type="text"] {
width: calc(100% - 20px);
padding: 10px;
margin: 0 0 10px 0;
border: 1px solid #ddd;
border-radius: 5px;
}

button {
padding: 10px 20px;
background-color: #007bff; /* Blue */
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}

button:hover {
background-color: #0056b3; /* Darker blue */
}

h1 {
color: #333;
}

#result {
margin-top: 20px;
color: #333;
}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,18 @@ This repository also provides one such platforms where contributers come over an
| [Sudoku_light_theme](https://github.com/kunjgit/GameZone/tree/main/Games/Sudoku_light_theme) |
| [Find_the_ball](https://github.com/kunjgit/GameZone/tree/main/Games/Find_the_ball) |
|[Color The Page](https://github.com/kunjgit/GameZone/tree/main/Games/Color_The_Page)|


| [Wordmix](https://github.com/kunjgit/GameZone/tree/main/Games/Wordmix) |





|[Carrom Board Game](https://github.com/kunjgit/GameZone/tree/main/Games/carrom)|
| [Number_Recall_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Number_Recall_Game) |
| [Hit_the_hamster] (https://github.com/kunjgit/GameZone/tree/main/Games/Hit_the_hamster) |

| [Forest_Guardian](https://github.com/kunjgit/GameZone/tree/main/Games/Forst_Guardian) |
| [Sudoku_light_theme](https://github.com/kunjgit/GameZone/tree/main/Games/Sudoku_light_theme) |
| [Find_the_ball](https://github.com/kunjgit/GameZone/tree/main/Games/Find_the_ball) |
Expand All @@ -323,6 +332,7 @@ This repository also provides one such platforms where contributers come over an




</center>

<br>
Expand Down
Binary file added assets/images/Wordmix.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading