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

added customized player names #71

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

nikitaghps
Copy link

Added the functionality by which the players can change their names before starting the game and also after starting a new game.

app.js Outdated
Comment on lines 83 to 84
var r = confirm("Would you like to change the name of players?");
if (r == true) {
Copy link
Owner

Choose a reason for hiding this comment

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

This is not how variables should declare.

app.js Outdated
@@ -80,6 +80,13 @@ function newGame() {
score1.textContent = '0';
current0.textContent = '0';
current1.textContent = '0';
var r = confirm("Would you like to change the name of players?");
if (r == true) {
var person = prompt("Please enter your name", player0);
Copy link
Owner

Choose a reason for hiding this comment

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

use ' ' here

app.js Outdated
var r = confirm("Would you like to change the name of players?");
if (r == true) {
var person = prompt("Please enter your name", player0);
document.getElementById("name-0").innerHTML =person;
Copy link
Owner

Choose a reason for hiding this comment

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

use ' ' here

app.js Outdated
if (r == true) {
var person = prompt("Please enter your name", player0);
document.getElementById("name-0").innerHTML =person;
var person2 = prompt("Please enter your name", player1);
Copy link
Owner

Choose a reason for hiding this comment

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

use ' ' here

app.js Outdated
var person = prompt("Please enter your name", player0);
document.getElementById("name-0").innerHTML =person;
var person2 = prompt("Please enter your name", player1);
document.getElementById("name-1").innerHTML =person2;
Copy link
Owner

Choose a reason for hiding this comment

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

use ' ' here too

index.html Outdated
Comment on lines 80 to 82
if (player0 != null) {
document.getElementById("name-0").innerHTML =player0;
}
Copy link
Owner

Choose a reason for hiding this comment

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

This is not properly indented.

index.html Outdated
Comment on lines 84 to 85
if (player1 != null) {
document.getElementById("name-1").innerHTML =player1;
Copy link
Owner

Choose a reason for hiding this comment

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

This is not properly indented too.

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