Untitled
unknown
plain_text
2 years ago
15 kB
4
Indexable
// Define the qualities and their weights const qualities = [ { name: "kindness", weight: 0.3 }, { name: "generosity", weight: 0.25 }, { name: "empathy", weight: 0.2 }, { name: "integrity", weight: 0.15 }, { name: "resilience", weight: 0.1 } ]; // Function to determine someone's character function determineCharacter() { let totalScore = 0; // Calculate the score for each quality for (const quality of qualities) { const score = getRandomScore(); const weightedScore = score * quality.weight; totalScore += weightedScore; print(`${quality.name}: ${score}`); } // Calculate the overall character score const characterScore = Math.round(totalScore * 100) / 100; // Map the character score to descriptive labels let characterLabel; if (characterScore >= 80) { characterLabel = "Excellent"; } else if (characterScore >= 60) { characterLabel = "Good"; } else if (characterScore >= 40) { characterLabel = "Average"; } else { characterLabel = "Needs improvement"; } // Output the character score and label print(`Character Score: ${characterScore}`); print(`Character Label: ${characterLabel}`); } // Function to generate a random score between 0 and 100 function getRandomScore() { return Math.floor(Math.random() * 101); } // Call the function to determine someone's character determineCharacter(); // Define the qualities and their weights const qualities = [ { name: "kindness", weight: 0.2 }, { name: "generosity", weight: 0.15 }, { name: "empathy", weight: 0.25 }, { name: "integrity", weight: 0.3 }, { name: "resilience", weight: 0.1 }, { name: "altruism", weight: 0.2 }, { name: "genuineness", weight: 0.2 }, { name: "crudeAndCallous", weight: 0.1 }, { name: "forgetfulness", weight: 0.1 }, { name: "selfishness", weight: 0.1 }, { name: "impactOnOthers", weight: 0.3 } ]; // Function to determine someone's character function determineCharacter() { let totalScore = 0; // Calculate the score for each quality for (const quality of qualities) { const score = getRandomScore(); const weightedScore = score * quality.weight; totalScore += weightedScore; print(`${quality.name}: ${score}`); } // Calculate the overall character score const characterScore = Math.round(totalScore * 100) / 100; // Map the character score to descriptive labels let characterLabel; if (characterScore >= 80) { characterLabel = "Excellent"; } else if (characterScore >= 60) { characterLabel = "Good"; } else if (characterScore >= 40) { characterLabel = "Average"; } else { characterLabel = "Needs improvement"; } // Output the character score and label print(`Character Score: ${characterScore}`); print(`Character Label: ${characterLabel}`); } // Function to generate a random score between 0 and 100 function getRandomScore() { return Math.floor(Math.random() * 101); } // Call the function to determine someone's character determineCharacter(); // Define the qualities and their weights const qualities = [ { name: "kindness", weight: 0.2 }, { name: "generosity", weight: 0.15 }, { name: "empathy", weight: 0.25 }, { name: "integrity", weight: 0.3 }, { name: "resilience", weight: 0.1 }, { name: "altruism", weight: 0.2 }, { name: "genuineness", weight: 0.2 }, { name: "crudeAndCallous", weight: 0.1 }, { name: "forgetfulness", weight: 0.1 }, { name: "selfishness", weight: 0.1 }, { name: "impactOnOthers", weight: 0.3 } ]; // Function to determine someone's character function determineCharacter() { let totalScore = 0; // Calculate the score for each quality for (const quality of qualities) { const score = getRandomScore(); const weightedScore = score * quality.weight; totalScore += weightedScore; print(`${quality.name}: ${score}`); } // Calculate the overall character score const characterScore = Math.round(totalScore * 100) / 100; // Output the character score print(`Character Score: ${characterScore}`); } // Function to generate a random score between 0 and 100 function getRandomScore() { return Math.floor(Math.random() * 101); } // Call the function to determine someone's character determineCharacter(); // Define the qualities and their weights const qualities = [ { name: "kindness", weight: 0.2 }, { name: "generosity", weight: 0.15 }, { name: "empathy", weight: 0.25 }, { name: "integrity", weight: 0.3 }, { name: "resilience", weight: 0.1 }, { name: "altruism", weight: 0.2 }, { name: "genuineness", weight: 0.2 }, { name: "crudeAndCallous", weight: 0.1 }, { name: "forgetfulness", weight: 0.1 }, { name: "selfishness", weight: 0.1 }, { name: "impactOnOthers", weight: 0.3 } ]; // Function to determine someone's character function determineCharacter() { let totalScore = 0; // Calculate the score for each quality for (const quality of qualities) { const score = getRandomScore(); const weightedScore = score * quality.weight; totalScore += weightedScore; print(`${quality.name}: ${score}`); } // Calculate the overall character score const characterScore = Math.round(totalScore * 100) / 100; // Output the character score print(`Character Score: ${characterScore}`); // Return the character score without any further influence return characterScore; } // Function to generate a random score between 0 and 100 function getRandomScore() { return Math.floor(Math.random() * 101); } // Call the function to determine someone's character const characterScore = determineCharacter(); // Output a neutral message based on the character score if (characterScore >= 80) { print("Your character score indicates a strong set of qualities."); } else if (characterScore >= 60) { print("Your character score reflects positive attributes."); } else if (characterScore >= 40) { print("Your character score suggests room for improvement."); } else { print("Your character score indicates areas that may need attention."); } // Define the qualities and their weights const qualities = [ { name: "kindness", weight: 0.2 }, { name: "generosity", weight: 0.15 }, { name: "empathy", weight: 0.25 }, { name: "integrity", weight: 0.3 }, { name: "resilience", weight: 0.1 }, { name: "altruism", weight: 0.2 }, { name: "genuineness", weight: 0.2 }, { name: "crudeAndCallous", weight: 0.1 }, { name: "forgetfulness", weight: 0.1 }, { name: "selfishness", weight: 0.1 }, { name: "impactOnOthers", weight: 0.3 } ]; // Function to determine someone's character function determineCharacter() { let totalScore = 0; const scores = []; // Calculate the score for each quality for (const quality of qualities) { const score = getRandomScore(); const weightedScore = score * quality.weight; totalScore += weightedScore; scores.push({ name: quality.name, score: score }); } // Calculate the overall character score const characterScore = Math.round(totalScore * 100) / 100; // Return the character score and scores return { characterScore, scores }; } // Function to generate a random score between 0 and 100 function getRandomScore() { return Math.floor(Math.random() * 101); } // Call the function to determine someone's character const { characterScore, scores } = determineCharacter(); // Output the character score print(`Character Score: ${characterScore}`); // Provide assessment and interpretation if (characterScore >= 80) { print("Congratulations! Your character score indicates a strong set of qualities."); print("You possess admirable kindness, generosity, empathy, and integrity."); } else if (characterScore >= 60) { print("Well done! Your character score reflects positive attributes."); print("Continue to nurture your kindness, generosity, empathy, and integrity."); } else if (characterScore >= 40) { print("Your character score suggests room for improvement."); print("Focus on enhancing your kindness, generosity, empathy, and integrity."); } else { print("Your character score indicates areas that may need attention."); print("Consider working on developing your kindness, generosity, empathy, and integrity."); } // Provide option for quantitative representation only const wantQuantitativeOnly = true; if (wantQuantitativeOnly) { print("Quantitative Representation:"); for (const score of scores) { print(`${score.name}: ${score.score}`); } } // Define the qualities and their weights const qualities = [ { name: "kindness", weight: 0.2 }, { name: "generosity", weight: 0.15 }, { name: "empathy", weight: 0.25 }, { name: "integrity", weight: 0.3 }, { name: "resilience", weight: 0.1 }, { name: "altruism", weight: 0.2 }, { name: "genuineness", weight: 0.2 }, { name: "crudeAndCallous", weight: 0.1 }, { name: "forgetfulness", weight: 0.1 }, { name: "selfishness", weight: 0.1 }, { name: "impactOnOthers", weight: 0.3 } ]; // Function to determine someone's character function determineCharacter() { let totalScore = 0; // Calculate the score for each quality for (const quality of qualities) { const score = getRandomScore(); const weightedScore = score * quality.weight; totalScore += weightedScore; print(`${quality.name}: ${score}`); } // Calculate the overall character score const characterScore = Math.round(totalScore * 100) / 100; return characterScore; } // Function to generate a random score between 0 and 100 function getRandomScore() { return Math.floor(Math.random() * 101); } // Call the function to determine someone's character const characterScore = determineCharacter(); // Output the character score print(`Character Score: ${characterScore}`); // Define the qualities and their weights const qualities = [ { name: "kindness", weight: 0.2 }, { name: "generosity", weight: 0.15 }, { name: "empathy", weight: 0.25 }, { name: "integrity", weight: 0.3 }, { name: "resilience", weight: 0.1 }, { name: "altruism", weight: 0.2 }, { name: "genuineness", weight: 0.2 }, { name: "crudeAndCallous", weight: 0.1 }, { name: "forgetfulness", weight: 0.1 }, { name: "selfishness", weight: 0.1 }, { name: "impactOnOthers", weight: 0.3 } ]; // Function to determine someone's character function determineCharacter() { let totalScore = 0; // Calculate the score for each quality for (const quality of qualities) { const score = getRandomScore(); const weightedScore = score * quality.weight; totalScore += weightedScore; print(`${quality.name}: ${score}`); } // Calculate the overall character score const characterScore = Math.round(totalScore * 100) / 100; // Output the character score print(`Character Score: ${characterScore}`); // Return the character score without any further influence return characterScore; } // Function to generate a random score between 0 and 100 function getRandomScore() { return Math.floor(Math.random() * 101); } // Call the function to determine someone's character const characterScore = determineCharacter(); // Output a neutral message based on the character score if (characterScore >= 80) { print("Your character score indicates a strong set of qualities."); } else if (characterScore >= 60) { print("Your character score reflects positive attributes."); } else if (characterScore >= 40) { print("Your character score suggests room for improvement."); } else { print("Your character score indicates areas that may need attention."); } import random # Define the qualities and their weights qualities = [ { 'name': 'kindness', 'weight': 0.2 }, { 'name': 'generosity', 'weight': 0.15 }, { 'name': 'empathy', 'weight': 0.25 }, { 'name': 'integrity', 'weight': 0.3 }, { 'name': 'resilience', 'weight': 0.1 }, { 'name': 'altruism', 'weight': 0.2 }, { 'name': 'genuineness', 'weight': 0.2 }, { 'name': 'crudeAndCallous', 'weight': 0.1 }, { 'name': 'forgetfulness', 'weight': 0.1 }, { 'name': 'selfishness', 'weight': 0.1 }, { 'name': 'impactOnOthers', 'weight': 0.3 } ] # Define the desires and their weights desires = [ { 'name': 'love', 'weight': 0.25 }, { 'name': 'achievement', 'weight': 0.2 }, { 'name': 'freedom', 'weight': 0.15 }, { 'name': 'adventure', 'weight': 0.1 }, { 'name': 'security', 'weight': 0.2 }, { 'name': 'creativity', 'weight': 0.15 }, { 'name': 'knowledge', 'weight': 0.15 } ] # Define the likes and their weights likes = [ { 'name': 'music', 'weight': 0.15 }, { 'name': 'nature', 'weight': 0.12 }, { 'name': 'art', 'weight': 0.1 }, { 'name': 'sports', 'weight': 0.08 }, { 'name': 'books', 'weight': 0.1 }, { 'name': 'travel', 'weight': 0.12 }, { 'name': 'food', 'weight': 0.1 }, { 'name': 'technology', 'weight': 0.1 }, { 'name': 'animals', 'weight': 0.13 }, { 'name': 'movies', 'weight': 0.1 } ] # Define the dislikes and their weights dislikes = [ { 'name': 'rudeness', 'weight': 0.15 }, { 'name': 'inequality', 'weight': 0.1 }, { 'name': 'injustice', 'weight': 0.13 }, { 'name': 'dishonesty', 'weight': 0.12 }, { 'name': 'violence', 'weight': 0.1 }, { 'name': 'pollution', 'weight': 0.1 }, { 'name': 'discrimination', 'weight': 0.1 }, { 'name': 'negativity', 'weight': 0.1 }, { 'name': 'ignorance', 'weight': 0.1 }, { 'name': 'greed', 'weight': 0.12 } ] # Function to determine someone's character score def determine_character_score(): total_score = 0 # Calculate the score for qualities for quality in qualities: score = get_random_score() weighted_score = score * quality['weight'] total_score += weighted_score # Calculate the score for desires for desire in desires: score = get_random_score() weighted_score = score * desire['weight'] total_score += weighted_score # Calculate the score for likes for like in likes: score = get_random_score() weighted_score = score * like['weight'] total_score += weighted_score # Calculate the score for dislikes for dislike in dislikes: score = get_random_score() weighted_score = score * dislike['weight'] total_score -= weighted_score # Return the character score return round(total_score, 2) # Function to generate a random score between 0 and 100 def get_random_score(): return random.uniform(0, 100) # Call the function to determine someone's character score character_score = determine_character_score() # Output the character score print('Character Score:', character_score)
Editor is loading...