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

feat: randomized turtle dialogue #102

Merged

Conversation

johannemoresco
Copy link
Collaborator

Summary

Closes #96

I modified Turtle.tsx and LessonSide.tsx in order to make the turtle's dialogue box display a randomized statement with every new exercise.
In Turtle.tsx, I changed the props to take a number rather than a string, and also changed the labelling of the different dialogue IDs from strings to numbers. This was needed in order to create an efficient way to pick random dialogue. To go along with these modifications, I also had to change LessonSide.tsx to set TurtleID as a randomTurtleMessage, which is gathered from an additional function called getRandomNumber, which takes in a range of numbers that correspond to the amount of dialogues there are to choose from. It then returns that random number and sets the randomTurtleMessage to it, thus setting the TurtleID to a random dialogue. There are no new dependencies that are required for this change.

Test Plan

In order to test my code, I made sure to run through the website in play multiple times to see if the Turtle Dialogue box on the side would change for each exercise. It works upon refreshing the page, when moving to a new exercise, as well as when navigating back and forth within exercises.
Start of Website
Screenshot 2024-04-24 at 18 40 41
Finished Exercise 1, onto Exercise 2
Screenshot 2024-04-24 at 18 41 25
Go back to Exercise 1
Screenshot 2024-04-24 at 18 41 47
Refreshing the Website
Screenshot 2024-04-24 at 18 43 31

Modified Turtle.tsx and LessonSide.tsx in orde
r to make the turtle's dialogue box display a randomized statement wit
h every new exercise.
@johannemoresco johannemoresco linked an issue Apr 25, 2024 that may be closed by this pull request
1 task
Copy link

netlify bot commented Apr 25, 2024

Deploy Preview for pen-pals ready!

Name Link
🔨 Latest commit 06a1956
🔍 Latest deploy log https://app.netlify.com/sites/pen-pals/deploys/6629ca6944dbbc0008677441
😎 Deploy Preview https://deploy-preview-102--pen-pals.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@SanjnaT41756 SanjnaT41756 self-requested a review April 25, 2024 02:47
Copy link
Contributor

@SanjnaT41756 SanjnaT41756 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 😎

@SanjnaT41756 SanjnaT41756 merged commit e25d56d into main Apr 25, 2024
6 checks passed
@SanjnaT41756 SanjnaT41756 deleted the 96-feature-change-the-turtles-dialogue-for-each-exercise branch April 25, 2024 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 Feature: Change the turtle's dialogue for each exercise
2 participants