Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<values>
<value name="StillAlive" type="qword">133561143336685873</value>
</values>
29 changes: 29 additions & 0 deletions Solution/JavaScript/The-Magical-Forest-of-Algora.js
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
console.log("Welcome to the Magical Forest of Algora!");
// Define the creatures and their dance moves
const creatures = ['Lox', 'Drako'];
const danceMoves = ['Twirl', 'Leap', 'Spin'];

// Function to get a random dance move
function getRandomDanceMove() {
return danceMoves[Math.floor(Math.random() * danceMoves.length)];
}

// Function to perform the sacred dance
function performSacredDance(creature1, danceMove1, creature2, danceMove2) {
console.log(`${creature1} starts to dance.`);
console.log(`${creature1} performs a ${danceMove1}.`);
console.log(`${creature2} starts to dance.`);
console.log(`${creature2} performs a ${danceMove2}.`);

if (danceMove1 === 'Twirl' && danceMove2 === 'Twirl') {
console.log('Fireflies light up the forest.');
} else if ((danceMove1 === 'Leap' && danceMove2 === 'Spin') || (danceMove1 === 'Spin' && danceMove2 === 'Leap')) {
console.log('A rainbow appears in the sky.');
} else if (danceMove1 === 'Leap' && danceMove2 === 'Leap') {
console.log('Gentle rain starts falling.');
} else {
console.log('The forest is filled with a magical aura.');
}
}

// Start the sacred dance
performSacredDance();
47 changes: 47 additions & 0 deletions Solution/JavaScript/magicalforest.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>The Magical Forest of Algora</title>
<script src="The-Magical-Forest-of-Algora.js"></script>
</head>
<body>
<h1>The Magical Forest of Algora</h1>
<form id="danceForm">
<label for="creature1">Creature 1:</label>
<select id="creature1">
<option value="Lox">Lox</option>
<option value="Drako">Drako</option>
</select>
<label for="danceMove1">Dance Move 1:</label>
<select id="danceMove1">
<option value="Twirl">Twirl</option>
<option value="Leap">Leap</option>
<option value="Spin">Spin</option>
</select>
<label for="creature2">Creature 2:</label>
<select id="creature2">
<option value="Lox">Lox</option>
<option value="Drako">Drako</option>
</select>
<label for="danceMove2">Dance Move 2:</label>
<select id="danceMove2">
<option value="Twirl">Twirl</option>
<option value="Leap">Leap</option>
<option value="Spin">Spin</option>
</select>
<button type="submit">Start Dance</button>
</form>
<div id="output"></div>
<script>
document.getElementById('danceForm').addEventListener('submit', function(event) {
event.preventDefault();
var creature1 = document.getElementById('creature1').value;
var danceMove1 = document.getElementById('danceMove1').value;
var creature2 = document.getElementById('creature2').value;
var danceMove2 = document.getElementById('danceMove2').value;
var output = performSacredDance(creature1, danceMove1, creature2, danceMove2);
document.getElementById('output').innerText = output;
});
</script>
</body>
</html>