on.c

来自「嵌入式系统基础课件」· C语言 代码 · 共 22 行

C
22
字号
#include "libepc.h"
#include "tetris.h"

/* ------------------------------------------------------------ */
/* Each tetris object is a 2x4 (rows x cols) array that can be	*/
/* rotated 0, 90, 180, or 270 degrees.  This function returns	*/
/* TRUE if the specified cell of the array is filled or empty.	*/ 
/* ------------------------------------------------------------ */
BOOL On(int rot, int row, int col)
	{
	static char on[4][2][2] =
		{
		{{1,0},{1,1}},
		{{1,1},{1,0}},
		{{1,1},{0,1}},
		{{0,1},{1,1}}
		} ;

	return on[rot][row][col/2] ;
	}

⌨️ 快捷键说明

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