Skip to content

Commit

Permalink
A game when claude roleplayed a child
Browse files Browse the repository at this point in the history
  • Loading branch information
ToonTalk committed Apr 23, 2024
1 parent 857a216 commit d6a91c9
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
Binary file not shown.
59 changes: 59 additions & 0 deletions apps/chatgpt helps claude roleplaying a child/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<title>My Click Score Game</title>
<style>
body {
background-color: #f0f8ff; /* Light blue background */
font-family: Arial, sans-serif; /* Makes the text Arial font */
}
h1 {
color: #ff4500; /* Orange color for the score */
}
button {
background-color: #4CAF50; /* Green background for the button */
color: white; /* White text */
padding: 15px 32px; /* Makes the button bigger */
text-align: center;
font-size: 16px;
margin: 4px 2px;
cursor: pointer; /* Changes the mouse cursor to a pointer when over the button */
}
</style>
</head>
<body>
<h1>Score: <span id="score">0</span></h1>
<button onclick="increaseScore()">Click me to score!</button>
<audio id="mySound">
<source src="click-sound.wav" type="audio/mp3">
</audio>
<script>
var score = 0; // This keeps track of your score

function increaseScore() {
var pointsToAdd = Math.floor(Math.random() * 3);
if (pointsToAdd === 0) {
pointsToAdd = 1;
} else if (pointsToAdd === 1) {
pointsToAdd = 5;
} else {
pointsToAdd = 10;
}

score += pointsToAdd;
document.getElementById('score').innerHTML = score;
document.getElementById('mySound').play();

var colorIndex = Math.floor(Math.random() * colors.length);
document.querySelector('button').style.backgroundColor = colors[colorIndex];

// Check if score is 50 or more and display a message
if (score >= 50) {
alert("Wow, you got to 50 points! Good job!");
}
}
var colors = ['red', 'blue', 'green', 'yellow', 'purple', 'orange']; // Add more if you like!

</script>
</body>
</html>

0 comments on commit d6a91c9

Please sign in to comment.