main.cpp

来自「linux 下的 仿联众版俄罗斯方块游戏。qt3 实现。 具有 人机交互功能。」· C++ 代码 · 共 47 行

CPP
47
字号
/*********************************************************************** * * *    linux版仿联众俄罗斯方块 v1.0 *    该软件在GPL(GNU通用公共许可证)下发布 * *    Copyright (C)   <codeky@126.com> * *   This source code is licensed under the GNU General Public License * ************************************************************************/#include <qapplication.h>#include <stdlib.h>#include <unistd.h>#include "qmainwidget.h"char curPath[PATH_MAX];int main( int argc, char **argv ){	QApplication app( argc, argv );	int rt = readlink("/proc/self/exe", curPath, PATH_MAX);	if(rt< 0||rt >=PATH_MAX){		rt =0;	}	curPath[rt] = '\0';	int pos = strlen(curPath)-1;	while(pos>=0){		if(curPath[pos]=='/'){			break;		}		pos--;	}	curPath[pos+1]='\0';	QMainWidget w;	app.setMainWidget( &w );	w.setCaption("linux-tetris -- Codekey@126.com");	w.show();	return app.exec();}

⌨️ 快捷键说明

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