areaposition.java

来自「用JAVA编写的数独游戏源代码,帮助你快速得到游戏的答案」· Java 代码 · 共 27 行

JAVA
27
字号


class AreaPosition {
	 int i ;
	 int j ;
	 
	 AreaPosition(int row_index , int column_index ) {
	 	this.i = row_index ;
	 	this.j = column_index ;
	 }
	
	 int getDatasRow_index( AreaCellPosition cellPosition ) {
	 	return   3*i + cellPosition.i ;
	 }

	 int getDatasColumn_index( AreaCellPosition cellPosition ) {
	 	return   3*j + cellPosition.j ;
	 }
	 
	 
	 static AreaPosition getAreaPosition( int datasRow_index , int datasColumns_index ) {
	 	return new AreaPosition( datasRow_index/3 , datasColumns_index/3 ) ;
	 }

	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?