1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-01 00:08:35 +09:00
This commit is contained in:
syuilo 2018-03-10 03:01:01 +09:00
parent 6e1a821e1c
commit 859ea79f31

View File

@ -81,12 +81,12 @@ export default class Othello {
public transformPosToXy(pos: number): number[] {
const x = pos % this.mapWidth;
const y = Math.floor(pos / this.mapHeight);
const y = Math.floor(pos / this.mapWidth);
return [x, y];
}
public transformXyToPos(x: number, y: number): number {
return x + (y * this.mapHeight);
return x + (y * this.mapWidth);
}
/**