Skip to content

Hole03 - #1

Open
D4rkP4ng0l1n wants to merge 9 commits into
mainfrom
hole03
Open

Hole03#1
D4rkP4ng0l1n wants to merge 9 commits into
mainfrom
hole03

Conversation

@D4rkP4ng0l1n

Copy link
Copy Markdown
Collaborator

No description provided.

@Julesc002

Copy link
Copy Markdown
Owner

Remplacer les nombres de "TileAt" par des constantes nommées "NUMBER_ROW" ou "NUMBER_COLUMN" (ex : FIRST_ROW ou FIRST_COLUMN)

@Julesc002

Copy link
Copy Markdown
Owner

Créer une constante EMPTY_SYMBOL pour stocker le char ' '

@Julesc002

Copy link
Copy Markdown
Owner

Créer la constante PLAYER_O pour stocker le char 'O'

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
if (this._lastSymbol == ' ') {
//if player is X
if (symbol == 'O') {
if (player == 'O') {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Passer le 'O' dans une constante nommée PLAYER_O

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
}

private validateFirstMove(player: string) {
if (this._lastSymbol == ' ') {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Passer le ' ' dans une constante nommée EMPTY_SYMBOL

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
}

private validatePositionIsEmpty(x: number, y: number) {
if (this._board.TileAt(x, y).Symbol != ' ') {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Passer le ' ' dans une constante nommée emptySymbol

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
return this._toto.TileAt(0, 0)!.Symbol;
}
if (this.isFirstRowFull() && this.isFirstRowFullWithSameSymbol()) {
return this._board.TileAt(0, 0)!.Symbol;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

return this._board.TileAt(FIRST_ROW, FIRST_COLUMN)!.Symbol;

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
return this._toto.TileAt(1, 0)!.Symbol;
}
if (this.isSecondRowFull() && this.isSecondRowFullWithSameSymbol()) {
return this._board.TileAt(1, 0)!.Symbol;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

return this._board.TileAt(SECOND_ROW, FIRST_COLUMN)!.Symbol;

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
return this._toto.TileAt(2, 0)!.Symbol;
}
if (this.isThirdRowFull() && this.isThirdRowFullWithSameSymbol()) {
return this._board.TileAt(2, 0)!.Symbol;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

return this._board.TileAt(THIRD_ROW, FIRST_COLUMN)!.Symbol;

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
return (
this._board.TileAt(0, 0)!.Symbol != ' ' &&
this._board.TileAt(0, 1)!.Symbol != ' ' &&
this._board.TileAt(0, 2)!.Symbol != ' '

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this._board.TileAt(FIRST_ROW, FIRST_COLUMN)!.Symbol != EMPTY_SYMBOL &&
this._board.TileAt(FIRST_ROW, SECOND_COLUMN)!.Symbol != EMPTY_SYMBOL &&
this._board.TileAt(FIRST_ROW, THIRD_COLUMN)!.Symbol != EMPTY_SYMBOL

Comment thread src/12_RefactoringGolf/hole1/kata.ts Outdated
}

private validatePositionIsEmpty(x: number, y: number) {
if (this._board.TileAt(x, y).Symbol != ' ') {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Remplacer ' ' par la constante emptySymbol créé précédemment

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.

3 participants