-
Notifications
You must be signed in to change notification settings - Fork 80
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
base: main
Are you sure you want to change the base?
Conversation
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.
i like your game display :)
good work including more comments to explain your code!
keep up the good work!
board[i].push(''); | ||
} | ||
} | ||
}; |
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 work setting a board of variable size!
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); | ||
}; |
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.
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'); |
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.
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);
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?
:)