Open
Conversation
Flashrob
reviewed
Nov 16, 2024
|
|
||
| The page will reload when you make changes. | ||
| You may also see any lint errors in the console. | ||
|
|
| - add the ability to create, read, update, delete a score. Betting mechanism. | ||
| - implment admin mode for the deletion and manual updating of score. Change state/UI. | ||
| - 2 ways to do: have a main where menu where the student choose to be a player or admin. Have a button for admin login for hard coded login. | ||
| What we recommend to achieve the API request, is use jsonbin. |
There was a problem hiding this comment.
One more thing we can add is how to install and how to run the app!
| import Button from "react-bootstrap/Button"; | ||
|
|
||
| function App() { | ||
| //generating a random pokemon name from the json file. |
There was a problem hiding this comment.
this comment is a bit redundant. It is not directly over the function that's being called. And the function name also tells me what is happening
| const [score, setScore] = useState(0); | ||
| const [hpLeft, setHpLeft] = useState(6); | ||
|
|
||
| //7. When the round ends, give the user an option to play again or restart the game. |
There was a problem hiding this comment.
This is the first thing I read, but labeled with 7. - confusing! Also, then name handleRestart captures this information already
|
|
||
| //7. When the round ends, give the user an option to play again or restart the game. | ||
| const handleRestart = () => { | ||
| setCurrentPokemon(getRandomPokemon()); // Reset with new Pokemon |
There was a problem hiding this comment.
Suggested change
| setCurrentPokemon(getRandomPokemon()); // Reset with new Pokemon | |
| setCurrentPokemon(getRandomPokemon()); |
| useEffect(() => { | ||
| const scramble = () => { | ||
| const letters = currPokemon.split(""); | ||
| const shuffledLetters = letters.sort(() => 0.5 - Math.random()); |
There was a problem hiding this comment.
this is where I would want to see a comment, as the math here does not mean anything to me reading the code
| @@ -0,0 +1,38 @@ | |||
| import { useState } from "react"; | |||
| import Button from "react-bootstrap/Button"; | |||
| //When the user makes a guess, add that guess to the App component's guessedPokemon state. | |||
| setCurrGuess(text); | ||
| }; | ||
| return ( | ||
| //input field for player to input guesses |
There was a problem hiding this comment.
Suggested change
| //input field for player to input guesses |
| pokeType: "Normal/Flying", | ||
| pokeImage: | ||
| "https://www.pokemon.com/static-assets/content-assets/cms2/img/pokedex/detail/021.png", | ||
| }, |
|
|
||
| export const getRandomPokemon = () => { | ||
| const randomPokedex = pokedex[randomIndex].pokeName.toLowerCase(); | ||
| //Lowercase words for simplicity |
There was a problem hiding this comment.
Suggested change
| //Lowercase words for simplicity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work in progress, trying to get the images to sync and the additional features.