⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zhangjiiii.txt

📁 步步高的电子词典上的 ZWBasic语言游戏占据(双人版).txt 4.1KB 打开 源码
💻 TXT
字号:
declare sub start()
declare sub readme()
declare sub runend()





const say$(14)={"",\
"   【操作&说明】   ",\
"  在19*11的棋盘上, ",\
"两个人轮流下棋,每下",\
"一颗棋,周围的棋格中",\
"无论是空的,或是敌方",\
"的棋,都会变成你的棋",\
",你自己的棋则不变,",\
"这样直到整个棋盘填满",\
"为止。              ",\
"  下棋时只要是空位就",\
"可以下,无其它限制。",\
"方向键移动光标,Enter",\
"确定。              ",\
"     <按Q键返回>    "}







sub readme()
	timerclose()
	a=1
	do
		locate(1,1):print say$(a);say$(a+1);say$(a+2);say$(a+3);say$(a+4);say$(a+5)
		k=getkey()
		if k=128 then
			dec a
			if a=0 then a=1
		else if k=129 then
			inc a
			if a=10 then a=9
		else if k=113 then
			exit do
		end if
	loop
end sub





sub runend()
	timerclose()
	cls
	locate(2,7):print "谢谢使用"
	locate(4,2):print "程序制作:Cool&Easy"
	locate(5,5):print "QQ:350220789"
	locate(6,2):print "SoCoolEasy@163.com"
	pause
	end
end sub






sub start()
	dim map(19,11)
	cls
	locate(3,7):print "整理中..."
	for a=1 to 11
		for b=1 to 19
			map(b,a)=0
		next b
	next a
	cls
	timerclose()
	locate(3,7):print "白棋先下"
	locate(4,7):print "黑棋先下"
	lcdreverse(48,32,112,47)
	a=1
	do
		k=getkey()
		if k=13 then
			p=a
			exit do
		else
		lcdreverse(48,32,112,63)
		a=a+1
		if a=3 then a=1
		end if
	loop
	cls
	for a=1 to 12
		line(a*8-5,3,a*8-5,91)
		line(3,a*8-5,155,a*8-5)
	next a
	for a=13 to 20
		line(a*8-5,3,a*8-5,91)
	next a
	x=7
	y=7
	dim q(2)
	q(1)=0
	q(2)=0
	timeropen(30)
	lcdreverse(4,4,10,10)
	mm=1
	do
		k=getkey()
		if k=135 then
			lcdreverse(x-3,y-3,x+3,y+3)
			mm=mm+1
		else if k=113 then
			exit do
		else if k=128 then
			if mm mod 2=1 then lcdreverse(x-3,y-3,x+3,y+3)
			y=y-8
			if y<7 then y=87
			lcdreverse(x-3,y-3,x+3,y+3)
			mm=1
		else if k=129 then
			if mm mod 2=1 then lcdreverse(x-3,y-3,x+3,y+3)
			y=y+8
			if y>87 then y=7
			lcdreverse(x-3,y-3,x+3,y+3)
			mm=1
		else if k=131 then
			if mm mod 2=1 then lcdreverse(x-3,y-3,x+3,y+3)
			x=x-8
			if x<7 then x=151
			lcdreverse(x-3,y-3,x+3,y+3)
			mm=1
		else if k=130 then
			if mm mod 2=1 then lcdreverse(x-3,y-3,x+3,y+3)
			x=x+8
			if x>151 then x=7
			lcdreverse(x-3,y-3,x+3,y+3)
			mm=1
		else if k=13 then
			a=(x+1)/8
			b=(y+1)/8
			if map(a,b)=0 then
				clspart(x-3,y-3,x+3,y+3)
				if p=1 then
					circle(x,y,2)
				else if p=2 then
					fillcircle(x,y,2)
				end if
				q(p)=q(p)+1
				map(a,b)=p
				c=a-1:d=b-1:gosub CHECK
				c=a-1:d=b:gosub CHECK
				c=a-1:d=b+1:gosub CHECK
				c=a:d=b-1:gosub CHECK
				c=a:d=b+1:gosub CHECK
				c=a+1:d=b-1:gosub CHECK
				c=a+1:d=b:gosub CHECK
				c=a+1:d=b+1:gosub CHECK
				if q(1)+q(2)>=209 then
					if q(1)>q(2) then
						locate(3,8):print "白方胜"
					else if q(1)<q(2) then
						locate(3,8):print "黑方胜"
					else if q(1)=q(2) then
						locate(3,8):print "平局啊"
					end if
					box(55,31,104,48)
					timerclose()
					pause
					exit do
				end if
				if p=1 then
					p=2
				else if p=2 then
					p=1
				end if
				lcdreverse(x-3,y-3,x+3,y+3)
				mm=1
			end if
		end if
	loop
	goto 6
	CHECK:
	if c>0 and c<20 and d>0 and d<12 then
		clspart(c*8-4,d*8-4,c*8+2,d*8+2)
		e=p+1
		if e=3 then e=1
		if map(c,d)=0 then
			q(p)=q(p)+1
		else if map(c,d)=e then
			q(p)=q(p)+1
			q(e)=q(e)-1
		end if
		map(c,d)=p
		if p=1 then
			circle(c*8-1,d*8-1,2)
		else if p=2 then
			fillcircle(c*8-1,d*8-1,2)
		end if
	end if
	return
	6 a=0
end sub










3 cls
sysprtstrg(40,24,"Start Game")
sysprtstrg(56,40,"Readme")
sysprtstrg(43,56,"Quit Game")
lcdreverse(40,24,119,39)
timerclose()
a=1
do
	k=getkey()
	if k=128 then
		lcdreverse(40,8+16*a,119,23+16*a)
		dec a
		if a=0 then a=3
		lcdreverse(40,8+16*a,119,23+16*a)
	else if k=129 then
		lcdreverse(40,8+16*a,119,23+16*a)
		inc a
		if a=4 then a=1
		lcdreverse(40,8+16*a,119,23+16*a)
	else if k=13 then
		if a=1 then
			start()
			exit do
		else if a=2 then
			readme()
			exit do
		else if a=3 then
			runend()
		end if
	end if
loop
goto 3
end

⌨️ 快捷键说明

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