-
Notifications
You must be signed in to change notification settings - Fork 659
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
basics beat that #145
base: main
Are you sure you want to change the base?
basics beat that #145
Conversation
" Player 2 has rolled " + | ||
player2Result + | ||
"<br><br>" + | ||
winner + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'winner' is not defined.
"Player 1 has rolled " + | ||
player1Result + | ||
" Player 2 has rolled " + | ||
player2Result + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'player2Result' is not defined.
|
||
return ( | ||
"Player 1 has rolled " + | ||
player1Result + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'player1Result' is not defined.
} else if (player2Result > player1Result) { | ||
winner = "player 2 wins"; | ||
} else { | ||
winner = "it's a tie!"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'winner' is not defined.
var player2DICEROLL = []; | ||
|
||
//game modes | ||
var mode_DICE_ROLL = "mode_DICE_ROLL"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier 'mode_DICE_ROLL' is not in camel case.
Code Climate has analyzed commit 7850a54 and detected 49 issues on this pull request. Here's the issue category breakdown:
Note: there are 43 critical issues. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good job ! Next level would be to think about what happens if you have more than 2 players. But don't worry about that yet and start on the next project :)
Looking forward to it !
player1Result = player1DICEROLL.join((seperator = " ")); //to join and remove separator | ||
player2Result = player2DICEROLL.join((seperator = " ")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of join !
player1DICEROLL = []; | ||
player2DICEROLL = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used to 'restart' the game ?
If so, it'll be cleaner to have a function that handles the restarting of the game :) !
//to set current player with Dice Roll | ||
var playerDiceRolls = function () { | ||
console.log("worked"); | ||
//Assigning dice rolls to player | ||
//if player = 1 | ||
if (currentPlayer == 1) { | ||
player1DICEROLL = [randomDiceNumber(), randomDiceNumber()]; | ||
console.log(player1DICEROLL); | ||
} | ||
//if player != 1, it is player 2 | ||
else { | ||
player2DICEROLL = [randomDiceNumber(), randomDiceNumber()]; | ||
console.log(player2DICEROLL); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job with handling the diceRolls in 1 function
Please fill out the survey before submitting the pull request. Thanks!
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
How many hours did you spend on this assignment?
Please fill in one error and/or error message you received while working on this assignment.
What part of the assignment did you spend the most time on?
Comfort Level (1-5): 5
Completeness Level (1-5): 2
What did you think of this deliverable? the order of steps
Is there anything in this code that you feel pleased about? the neatness