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

basics beat that #145

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

basics beat that #145

wants to merge 3 commits into from

Conversation

ayupermhm
Copy link

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

" Player 2 has rolled " +
player2Result +
"<br><br>" +
winner +
Copy link

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 +
Copy link

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 +
Copy link

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!";
Copy link

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";
Copy link

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.

@codeclimate
Copy link

codeclimate bot commented Aug 4, 2021

Code Climate has analyzed commit 7850a54 and detected 49 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 5
Duplication 2
Clarity 13
Bug Risk 29

Note: there are 43 critical issues.

View more on Code Climate.

Copy link

@eddiejpot eddiejpot left a 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 !

Comment on lines +131 to +132
player1Result = player1DICEROLL.join((seperator = " ")); //to join and remove separator
player2Result = player2DICEROLL.join((seperator = " "));

Choose a reason for hiding this comment

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

Good use of join !

Comment on lines +141 to +142
player1DICEROLL = [];
player2DICEROLL = [];

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 :) !

Comment on lines +25 to +39
//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);
}
};

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

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.

2 participants