代码分享
1、创建一个文件名为main.c,然后用任意一个款你熟悉的文本编辑软件,比如说记事本,在里面输入下面的代码,记住,要用文本文件编辑软件,不能用word的。
2、然后用gcc编译程序:
gcc ./main.c
你会得到一个a.out文件。
3、运行a.out
扩展资料:
c语言小游戏实现原理
1、二维数组实现棋盘
二维数组,用两个for 循环,随便输出一个固定符号做棋盘,如 *
2、判定玩家
设计一个计步变量step, 每走一步 step++, 则玩家=step%2+1;
3、判定输赢(重点)
设计方向数组 dircX[4] ,dircY[4],因为如果要判断是否练成五子,只有1竖着2横着3斜下4斜上
竖着的话就是 x-1,y不变
横着的话就是x不变,y+1; 斜下: x+1,y+1; 斜上 x-1;y+1
这样你就可以赋值dircX={-1,0,1,-1} dercY={0,1,1,1}
每当玩家落下一子,就全局判断每个子的四个方向有没有第二子,如果有,循环判断有没有第三子(利用 x+=dircX[1]),直到五子完成,结束。
代码分享
QQ空间开场动画代码(感同身受):javascript:window.top.space_addItem(14,26501,0,0,0,0,0);
QQ边框代码(爱的甜蜜蜜): javascript:window.top.space_addItem(16,21903,0,80,500,500,0);
QQ空间模块代码(去除横幅代码): javascript:window.top.space_addItem(19,15330,0,0,0,0,10000);
QQ空间皮肤代码 (七色彩虹): javascript:window.top.space_addItem(1,8674,0,80,100,100,94);
QQ空间漂浮物代码: javascript:window.top.space_addItem(5,1097,0,0,4,1,0);
QQ空间免费导航代码(摘星 ): javascript:window.top.space_addItem(13,5145,0,0,200,600,0);
QQ空间免费播放器代码:javascript:window.top.space_addItem(6,702,0,0,200,200,0);公代码:
透明公告栏`LOOK javascript:window.top.space_addItem(12,1238,0,0,96,96,1)
透明公告栏LOVELETTER javascript:window.top.space_addItem(12,1072,0,0,96,96,1)
透明公告栏`爱情碰碰杯 javascript:window.top.space_addItem(12,1073,0,0,96,96,1)
开场代码
欢迎来我家 javascript:window.top.space_addItem(14,4386,0,0,1,1,0);
与你分享 javascript:window.top.space_addItem(14,4387,0,0,1,1,0);
月光马 javascript:window.top.space_addItem(14,5077,0,0,1,1,0);
幽夜幕 javascript:window.top.space_addItem(14,5002,0,0,1,1,0);
分享 javascript:window.top.space_addItem(14,5329,0,0,1,1,0);
国旗 javascript:window.top.space_addItem(14,5423,0,0,1,1,0);
加冕日 javascript:window.top.space_addItem(14,5242,0,0,1,1,0);
蓝色美女 javascript:window.top.space_addItem(14,7982,0,0,1,1,0);
09年最新可用免费皮肤代码
静悄悄 javascript:window.top.space_addItem(1,8669,100,80,100,100,94);
最美的花 javascript:window.top.space_addItem(1,4693,0,80,0,0,94);
静悄悄(改版,没有花,黑紫竖条) javascript:window.top.space_addItem(1,8669,80,80,100,100,93);
静悄悄(改版小窝) javascript:window.top.space_addItem(1,8669,80,80,100,100,20);
最美的花 (改版,就是粉色)javascript:window.top.space_addItem(1,4693,0,80,0,0,93);
最美的花 (改版,小窝)javascript:window.top.space_addItem(1,4693,0,80,0,0,20);
3.0小窝皮肤免费代码
乐肤洁1 javascript:window.top.space_addItem(1,4963,0,0,1,1,0);
乐肤洁2 javascript:window.top.space_addItem(1,4964,0,0,1,1,0);
小牛1 javascript:window.top.space_addItem(1,6572,0,0,1,1,0);
小牛2 javascript:window.top.space_addItem(1,6573,0,0,1,1,0);
小牛3 javascript:window.top.space_addItem(1,6574,0,0,1,1,0);
小牛4 javascript:window.top.space_addItem(1,6575,0,0,1,1,0);
小牛5 javascript:window.top.space_addItem(1,6576,0,0,1,1,0);
灰色BUG javascript:window.top.space_addItem(1,10426,0,0,1,1,0);
右移全灰小窝:javascript:window.top.space_addItem(1,10426,200,80,0,0,20);
09年最新QQ边框代码:
黑色相册边框 javascript:window.top.space_addItem(16,23235,300,80,420,420,0);
LOVE HOME javascript:window.top.space_addItem(16,23211,330,80,600,600,0);
爱的故事 javascript:window.top.space_addItem(16,23213,330,80,600,600,0);
蝶影 javascript:window.top.space_addItem(16,23215,330,80,600,600,0);
love you javascript:window.top.space_addItem(16,23227,330,80,600,600,0);
圣殿的烛光 javascript:window.top.space_addItem(16,23237,330,80,600,600,0);
悠扬芭蕾舞 javascript:window.top.space_addItem(16,23239,330,80,600,600,0);
爱的甜蜜蜜 javascript:window.top.space_addItem(16,21903,0,80,500,500,0);
爱你一生不变 javascript:window.top.space_addItem(16,21904,0,80,500,500,0);
爱情轨迹 javascript:window.top.space_addItem(16,21905,0,80,500,500,0);
爱情之旅 javascript:window.top.space_addItem(16,21906,0,80,650,650,0);
有你真精彩 javascript:window.top.space_addItem(16,21911,0,80,500,500,0);
真的很想你 javascript:window.top.space_addItem(16,21912,0,80,500,500,0);
隐藏导航代码 javascript:window.top.space_addItem(13,1333,0,80,0,0,94);
隐藏播放器代码javascript:window.top.space_addItem(6,676,1899,0,200,200,0);
黄钻专用去横幅代码:javascript:window.top.space_addItem(19,15330,0,0,0,0,10000);
非黄钻专用去横幅代码:javascript:window.top.space_addItem(19,14692,0,0,0,0,4);(需支付2.1QB)
QQ空间导航代码
粉色女生 :javascript:window.top.space_addItem(13,9758,0,0,200,600,0);
竖着的五星:jjavascript:window.top.space_addItem(13,5145,0,0,200,600,0);
美妙音符:javascript:window.top.space_addItem(13,5330,0,0,200,600,0);
鱼:javascript:window.top.space_addItem(13,5003,0,0,200,600,0);
清甜爽口:javascript:window.top.space_addItem(13,4384,0,0,150,700,0);
流金岁月:javascript:window.top.space_addItem(13,5330,0,0,150,700,0);
摘星:javascript:window.top.space_addItem(13,5145,0,0,150,700,0);
深海奥妙:javascript:window.top.space_addItem(13,5003,0,0,150,700,0);
竖着的导航:javascript:window.top.space_addItem(13,1,100,80,0,0,94);
心爱花藤:javascript:window.top.space_addItem(13,9114,0,0,200,600,0);
QQ空间鼠标代码
大青蛙 javascript:window.top.space_addItem(4,4966,0,0,0,1,0);
好色哦 javascript:window.top.space_addItem(4,5535,0,0,1,1,0);
dangerous javascript:window.top.space_addItem(4,5837,0,0,1,1,0);
老鹰 javascript:window.top.space_addItem(4,1151,0,0,0,1,0);
QQ空间播放器代码
旋律 javascript:window.top.space_addItem(6,1228,0,0,200,200,0);
茶色 javascript:window.top.space_addItem(6,702,0,0,200,200,0);
水晶年代 javascript:window.top.space_addItem(6,703,0,0,200,200,0);
09年最新QQ空间漂浮物代码
向上飘的粉色雪花 javascript:window.top.space_addItem(16,23732,350,80,500,600,0);
雪花英文闪字 javascript:window.top.space_addItem(16,23725,350,80,500,600,0);
白色向左飘浮 javascript:window.top.space_addItem(16,23214,350,80,500,600,0);
下雪了 javascript:window.top.space_addItem(16,23699,330,80,600,600,0);
鼠迎新岁 javascript:window.top.space_addItem(16,23727,330,80,600,600,0);
五彩世界 javascript:window.top.space_addItem(16,23734,330,80,600,600,0);
迎新春 javascript:window.top.space_addItem(16,23736,330,80,600,600,0);
下雪FLASH挂件:javascript:window.top.space_addItem(16,23232,50,80,620,350,0);
LOVE HOME javascript:window.top.space_addItem(16,23212,330,80,600,600,0);
爱的故事 javascript:window.top.space_addItem(16,23214,330,80,600,600,0);
蝶影 javascript:window.top.space_addItem(16,23216,330,80,600,600,0);
love you javascript:window.top.space_addItem(16,23226,330,80,600,600,0);
纯纯爱恋 javascript:window.top.space_addItem(16,23228,330,80,600,600,0);
冬夜息乐园 javascript:window.top.space_addItem(16,23230,330,80,600,600,0);
记忆心音 javascript:window.top.space_addItem(16,23232,330,80,600,600,0);
迷离蝴蝶 javascript:window.top.space_addItem(16,23234,330,80,600,600,0);
圣殿的烛光 javascript:window.top.space_addItem(16,23236,330,80,600,600,0);
悠扬芭蕾舞 javascript:window.top.space_addItem(16,23238,330,80,600,600,0);
我是公主:javascript:window.top.space_addItem(16,22097,50,80,250,250,0);
任性的我:javascript:window.top.space_addItem(16,22098,50,80,250,250,0);
会飞的人参果:javascript:window.top.space_addItem(16,22103,50,80,250,250,0);
爱情天使 (单个) javascript:window.top.space_addItem(5,1097,0,0,1,1,0);
爱情天使( 多个) javascript:window.top.space_addItem(5,1097,0,0,4,1,0);
09年最新QQ空间免费挂件代码:
踢足球 javascript:window.top.space_addItem(2,5797,0,0,1,1,0);
巴西万岁 javascript:window.top.space_addItem(2,5875,0,0,1,1,0);
加油法兰西 javascript:window.top.space_addItem(2,5876,0,0,1,1,0);
前进!葡萄牙 javascript:window.top.space_addItem(2,5877,0,0,1,1,0);
为意大利欢呼 javascript:window.top.space_addItem(2,5878,0,0,1,1,0);
我为德国狂 javascript:window.top.space_addItem(2,5879,0,0,1,1,0);
西班牙冲冲冲 javascript:window.top.space_addItem(2,5880,0,0,1,1,0);
英格兰必胜 javascript:window.top.space_addItem(2,5881,0,0,1,1,0)
QQ边框代码(爱的甜蜜蜜): javascript:window.top.space_addItem(16,21903,0,80,500,500,0);
QQ空间模块代码(去除横幅代码): javascript:window.top.space_addItem(19,15330,0,0,0,0,10000);
QQ空间皮肤代码 (七色彩虹): javascript:window.top.space_addItem(1,8674,0,80,100,100,94);
QQ空间漂浮物代码: javascript:window.top.space_addItem(5,1097,0,0,4,1,0);
QQ空间免费导航代码(摘星 ): javascript:window.top.space_addItem(13,5145,0,0,200,600,0);
QQ空间免费播放器代码:javascript:window.top.space_addItem(6,702,0,0,200,200,0);公代码:
透明公告栏`LOOK javascript:window.top.space_addItem(12,1238,0,0,96,96,1)
透明公告栏LOVELETTER javascript:window.top.space_addItem(12,1072,0,0,96,96,1)
透明公告栏`爱情碰碰杯 javascript:window.top.space_addItem(12,1073,0,0,96,96,1)
开场代码
欢迎来我家 javascript:window.top.space_addItem(14,4386,0,0,1,1,0);
与你分享 javascript:window.top.space_addItem(14,4387,0,0,1,1,0);
月光马 javascript:window.top.space_addItem(14,5077,0,0,1,1,0);
幽夜幕 javascript:window.top.space_addItem(14,5002,0,0,1,1,0);
分享 javascript:window.top.space_addItem(14,5329,0,0,1,1,0);
国旗 javascript:window.top.space_addItem(14,5423,0,0,1,1,0);
加冕日 javascript:window.top.space_addItem(14,5242,0,0,1,1,0);
蓝色美女 javascript:window.top.space_addItem(14,7982,0,0,1,1,0);
09年最新可用免费皮肤代码
静悄悄 javascript:window.top.space_addItem(1,8669,100,80,100,100,94);
最美的花 javascript:window.top.space_addItem(1,4693,0,80,0,0,94);
静悄悄(改版,没有花,黑紫竖条) javascript:window.top.space_addItem(1,8669,80,80,100,100,93);
静悄悄(改版小窝) javascript:window.top.space_addItem(1,8669,80,80,100,100,20);
最美的花 (改版,就是粉色)javascript:window.top.space_addItem(1,4693,0,80,0,0,93);
最美的花 (改版,小窝)javascript:window.top.space_addItem(1,4693,0,80,0,0,20);
3.0小窝皮肤免费代码
乐肤洁1 javascript:window.top.space_addItem(1,4963,0,0,1,1,0);
乐肤洁2 javascript:window.top.space_addItem(1,4964,0,0,1,1,0);
小牛1 javascript:window.top.space_addItem(1,6572,0,0,1,1,0);
小牛2 javascript:window.top.space_addItem(1,6573,0,0,1,1,0);
小牛3 javascript:window.top.space_addItem(1,6574,0,0,1,1,0);
小牛4 javascript:window.top.space_addItem(1,6575,0,0,1,1,0);
小牛5 javascript:window.top.space_addItem(1,6576,0,0,1,1,0);
灰色BUG javascript:window.top.space_addItem(1,10426,0,0,1,1,0);
右移全灰小窝:javascript:window.top.space_addItem(1,10426,200,80,0,0,20);
09年最新QQ边框代码:
黑色相册边框 javascript:window.top.space_addItem(16,23235,300,80,420,420,0);
LOVE HOME javascript:window.top.space_addItem(16,23211,330,80,600,600,0);
爱的故事 javascript:window.top.space_addItem(16,23213,330,80,600,600,0);
蝶影 javascript:window.top.space_addItem(16,23215,330,80,600,600,0);
love you javascript:window.top.space_addItem(16,23227,330,80,600,600,0);
圣殿的烛光 javascript:window.top.space_addItem(16,23237,330,80,600,600,0);
悠扬芭蕾舞 javascript:window.top.space_addItem(16,23239,330,80,600,600,0);
爱的甜蜜蜜 javascript:window.top.space_addItem(16,21903,0,80,500,500,0);
爱你一生不变 javascript:window.top.space_addItem(16,21904,0,80,500,500,0);
爱情轨迹 javascript:window.top.space_addItem(16,21905,0,80,500,500,0);
爱情之旅 javascript:window.top.space_addItem(16,21906,0,80,650,650,0);
有你真精彩 javascript:window.top.space_addItem(16,21911,0,80,500,500,0);
真的很想你 javascript:window.top.space_addItem(16,21912,0,80,500,500,0);
隐藏导航代码 javascript:window.top.space_addItem(13,1333,0,80,0,0,94);
隐藏播放器代码javascript:window.top.space_addItem(6,676,1899,0,200,200,0);
黄钻专用去横幅代码:javascript:window.top.space_addItem(19,15330,0,0,0,0,10000);
非黄钻专用去横幅代码:javascript:window.top.space_addItem(19,14692,0,0,0,0,4);(需支付2.1QB)
QQ空间导航代码
粉色女生 :javascript:window.top.space_addItem(13,9758,0,0,200,600,0);
竖着的五星:jjavascript:window.top.space_addItem(13,5145,0,0,200,600,0);
美妙音符:javascript:window.top.space_addItem(13,5330,0,0,200,600,0);
鱼:javascript:window.top.space_addItem(13,5003,0,0,200,600,0);
清甜爽口:javascript:window.top.space_addItem(13,4384,0,0,150,700,0);
流金岁月:javascript:window.top.space_addItem(13,5330,0,0,150,700,0);
摘星:javascript:window.top.space_addItem(13,5145,0,0,150,700,0);
深海奥妙:javascript:window.top.space_addItem(13,5003,0,0,150,700,0);
竖着的导航:javascript:window.top.space_addItem(13,1,100,80,0,0,94);
心爱花藤:javascript:window.top.space_addItem(13,9114,0,0,200,600,0);
QQ空间鼠标代码
大青蛙 javascript:window.top.space_addItem(4,4966,0,0,0,1,0);
好色哦 javascript:window.top.space_addItem(4,5535,0,0,1,1,0);
dangerous javascript:window.top.space_addItem(4,5837,0,0,1,1,0);
老鹰 javascript:window.top.space_addItem(4,1151,0,0,0,1,0);
QQ空间播放器代码
旋律 javascript:window.top.space_addItem(6,1228,0,0,200,200,0);
茶色 javascript:window.top.space_addItem(6,702,0,0,200,200,0);
水晶年代 javascript:window.top.space_addItem(6,703,0,0,200,200,0);
09年最新QQ空间漂浮物代码
向上飘的粉色雪花 javascript:window.top.space_addItem(16,23732,350,80,500,600,0);
雪花英文闪字 javascript:window.top.space_addItem(16,23725,350,80,500,600,0);
白色向左飘浮 javascript:window.top.space_addItem(16,23214,350,80,500,600,0);
下雪了 javascript:window.top.space_addItem(16,23699,330,80,600,600,0);
鼠迎新岁 javascript:window.top.space_addItem(16,23727,330,80,600,600,0);
五彩世界 javascript:window.top.space_addItem(16,23734,330,80,600,600,0);
迎新春 javascript:window.top.space_addItem(16,23736,330,80,600,600,0);
下雪FLASH挂件:javascript:window.top.space_addItem(16,23232,50,80,620,350,0);
LOVE HOME javascript:window.top.space_addItem(16,23212,330,80,600,600,0);
爱的故事 javascript:window.top.space_addItem(16,23214,330,80,600,600,0);
蝶影 javascript:window.top.space_addItem(16,23216,330,80,600,600,0);
love you javascript:window.top.space_addItem(16,23226,330,80,600,600,0);
纯纯爱恋 javascript:window.top.space_addItem(16,23228,330,80,600,600,0);
冬夜息乐园 javascript:window.top.space_addItem(16,23230,330,80,600,600,0);
记忆心音 javascript:window.top.space_addItem(16,23232,330,80,600,600,0);
迷离蝴蝶 javascript:window.top.space_addItem(16,23234,330,80,600,600,0);
圣殿的烛光 javascript:window.top.space_addItem(16,23236,330,80,600,600,0);
悠扬芭蕾舞 javascript:window.top.space_addItem(16,23238,330,80,600,600,0);
我是公主:javascript:window.top.space_addItem(16,22097,50,80,250,250,0);
任性的我:javascript:window.top.space_addItem(16,22098,50,80,250,250,0);
会飞的人参果:javascript:window.top.space_addItem(16,22103,50,80,250,250,0);
爱情天使 (单个) javascript:window.top.space_addItem(5,1097,0,0,1,1,0);
爱情天使( 多个) javascript:window.top.space_addItem(5,1097,0,0,4,1,0);
09年最新QQ空间免费挂件代码:
踢足球 javascript:window.top.space_addItem(2,5797,0,0,1,1,0);
巴西万岁 javascript:window.top.space_addItem(2,5875,0,0,1,1,0);
加油法兰西 javascript:window.top.space_addItem(2,5876,0,0,1,1,0);
前进!葡萄牙 javascript:window.top.space_addItem(2,5877,0,0,1,1,0);
为意大利欢呼 javascript:window.top.space_addItem(2,5878,0,0,1,1,0);
我为德国狂 javascript:window.top.space_addItem(2,5879,0,0,1,1,0);
西班牙冲冲冲 javascript:window.top.space_addItem(2,5880,0,0,1,1,0);
英格兰必胜 javascript:window.top.space_addItem(2,5881,0,0,1,1,0)
代码分享,代码分享
首先进入空间, 在点击装扮空间,在把你的代码复制到网址栏里,在回车。 就行额了。 最后点击保存!
代码分享,代码分享
利用encodeURI函数转码,利用decodeURI函数解码;
现在qq空间代码怎么做?
先把你的空间打开
把你要的图片的代码输入到地址栏里去
再摁装扮空间
最后保存
就可以了
把你要的图片的代码输入到地址栏里去
再摁装扮空间
最后保存
就可以了
现在qq空间代码怎么做?
http://wenku.baidu.com/link?url=RMa7Qh578xCqQIhD2CH4o7WlphcwAEfymieobCUfkEJSatbEG4FstWyfjWtyrg5ItScq6uEOMY5-F3wxI5dKNwolTbWGBs_TqzgQzxlNCU7
百度文档
百度文档
还没有评论,来说两句吧...