俄罗斯C语言经典代码(国外英文资料)
俄罗斯C语言经典代码(国外英文资料)
# include < DOS. H >
# include < conio. H >
# include < graphics. H >
# include < stdlib. H >
# ifdef __cplusplus
# define __CPPARGS...
# the else
# define __CPPARGS
# endif
# define MINBOXSIZE 20 / * the size of the smallest square * /
# define BGCOLOR 6 / * background color * /
# define GX 200
# define 10 GY
The # define SJNUM 10000 / * whenever a player hits 10,000 levels plus one
/ * key code * /
# define VK_LEFT 0x4b00
# define VK_RIGHT 0 x4d00
Pound sign define VK_DOWN 0x5000
Pound sign define VK_UP 0x4800
Pound sign define VK_HOME 0x4700
# define VK_END 0x4f00
# define VK_SPACE 0 x3920
Pound sign define VK_ESC 0x011b
# define VK_ENTER 0 x1c0d
/ * define the direction of tetris (I define him 4) * /
# define F_DONG 0
# define F_NAN 1
# define F_XI 2
# define F_BEI 3
# define NEXTCOL 20 / * the vertical coordinate of the next block. * /
# define NEXTROW 12 / * the cross of the next block is from the standard * /
# define MAXROW 14 / * game screen size * /
# define MAXCOL 20
# define SCCOL 50 / * the relative position of the large screen of a game screen
# define SCROW 30
# define X_Z 0 / * defines the square of the block (eight kinds) * /
# define X_REZ 1
# define X_7 2
# define X_RE7 3
# define X_I 4
# define X_REI 5
# define X_TIAN 6
# define X_T 7
Int gril [22]. / * game screen coordinates * /
Int col = 1, row = 7; / * the horizontal axis of the current block * /
Int boxfx = 0, boxgs = 0; / * the shape and direction of the temple block
Int nextboxfx nextboxgs, maxcol = 22; / * the shape and direction of the next square
Int minboxcolor nextminboxcolor;
Int num = 0; / the game is divided by
Int DJ = 0, gamedj [10] = {18, 16, 16, 14, 12, 6, 4, 2, 1}; / * game class * /
Struct all {
Int x, y;
Int fangxiang;
Int gesu.
};
/ * the following USES a 3-dimensional array to record the initial shape and direction of the square
Int boxstr [8] [4] [4] = {{{{{
{0, 0, 0, 0,
{0, 0, 0, 0,
{0, 1, 1, 0},
{0, 0, 1, 1},
{
{0, 0, 0, 0,
{0, 0, 0, 0,
{0, 0, 1, 1},