Skip to content

PTBC1: Diyana Ramlan #19

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

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

Conversation

diyanarmln
Copy link

Please fill out the survey before submitting the pull request. Thanks!

🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀

How many hours did you spend on this assignment?
3 hours

Please fill in one error and/or error message you received while working on this assignment.
i couldn't get the diagonal win check to work for some reason but i finally realised by variable kept resetting itself in the current placement and had to move it out of the loop

What part of the assignment did you spend the most time on?
the diagonal check

Comfort Level (1-5):
5

Completeness Level (1-5):
3 - will complete more comfortable if i had more time. weekends are a bit difficult.

What did you think of this deliverable?
nice!

Is there anything in this code that you feel pleased about?
:)

Copy link

@michelle-mok michelle-mok left a comment

Choose a reason for hiding this comment

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

i like your game display :)
good work including more comments to explain your code!
keep up the good work!

board[i].push('');
}
}
};

Choose a reason for hiding this comment

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

good work setting a board of variable size!

Comment on lines +109 to +122
const plusButtonClick = (target) => {
const currentValue = Number(target.value);
target.value = currentValue + 1;
buildEmptyBoard(target.value);
buildBoard(board);
};

const minusButtonClick = (target) => {
const currentValue = Number(target.value);
if (currentValue >= 4) {
target.value = currentValue - 1; }
buildEmptyBoard(target.value);
buildBoard(board);
};

Choose a reason for hiding this comment

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

awesome work getting the board to resize when the user clicks the + - buttons!

// create the board container element and put it on the screen
const initGame = () => {
// append message Container with defaulty message
output('Win by plotting your Xs or Os in a<br>diagonal, horizontal or vertical manner');

Choose a reason for hiding this comment

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

consider making a variable for default message to avoid repetition:

const defaultMsg = 'Win by plotting your Xs or Os in a<br>diagonal, horizontal or vertical manner';
output(defaultMsg);

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