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

📄 findthesame.txt

📁 步步高的电子词典上的 ZWBasic语言游戏 FindTheSame.rar源码
💻 TXT
字号:
declare sub drawpic(n,x,y)
declare sub start()
declare sub readme()
declare sub runend()
const pic1!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0x80,	0x8,	0x9d,	0xc8, 	0xa2,	0x28,	0xa0,	0x28,	0xa0,	0x28,	0x90,	0x48,	0x88,	0x88, 	0x85,	0x8,	0x82,	0x8,	0x80,	0x8,	0xff,	0xf8,\
}
const pic2!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0x82,	0x8,	0x87,	0x8, 	0x87,	0x8,	0x9f,	0xc8,	0xbf,	0xe8,	0x9f,	0xc8,	0x87,	0x8, 	0x87,	0x8,	0x82,	0x8,	0x80,	0x8,	0xff,	0xf8,\
}
const pic3!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0xb0,	0x8,	0xb8,	0x8, 	0x9f,	0x8,	0x8e,	0x8,	0x8d,	0x8,	0x8a,	0x88,	0x81,	0x48, 	0x80,	0xa8,	0x80,	0x68,	0x80,	0x8,	0xff,	0xf8,\
}
const pic4!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0xb8,	0xe8,	0xa5,	0x28, 	0xa2,	0x28,	0x95,	0x48,	0x88,	0x88,	0x95,	0x48,	0xa2,	0x28, 	0xa5,	0x28,	0xb8,	0xe8,	0x80,	0x8,	0xff,	0xf8,\
}
const pic5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 	0x90,	0x48,	0x82,	0x8,	0x80,	0x8,	0xff,	0xf8,\
}
const pic10!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0x8f,	0xe8,	0x98,	0x28, 	0xbb,	0xa8,	0xa0,	0x28,	0xaf,	0xa8,	0xa0,	0x28,	0xaf,	0xa8, 	0xa0,	0x28,	0xbf,	0xe8,	0x80,	0x8,	0xff,	0xf8,\
}
const pic11!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0x80,	0x8,	0x80,	0x8, 	0x9b,	0x68,	0xa4,	0x98,	0xa0,	0x98,	0x91,	0x28,	0x8b,	0x48, 	0x84,	0x88,	0x80,	0x8,	0x80,	0x8,	0xff,	0xf8,\
}
const pic12!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0x82,	0x8,	0x82,	0x8, 	0x87,	0x8,	0x8a,	0x88,	0x97,	0x48,	0x9a,	0xc8,	0x92,	0x48, 	0x82,	0x8,	0x85,	0x8,	0x80,	0x8,	0xff,	0xf8,\
}
const pic13!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0x88,	0x88,	0x88,	0x88, 	0x95,	0x48,	0x95,	0x48,	0xa2,	0x28,	0x95,	0x48,	0x95,	0x48, 	0x88,	0x88,	0x88,	0x88,	0x80,	0x8,	0xff,	0xf8,\
}
const pic14!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0xa0,	0x8,	0x93,	0xe8, 	0x8c,	0x48,	0x8c,	0x88,	0x93,	0x8,	0x93,	0x8,	0x94,	0xc8, 	0x98,	0xe8,	0x90,	0x48,	0x80,	0x8,	0xff,	0xf8,\
}
const pic15!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x83,	0x68,	0x84,	0x98,	0x84,	0x18, 	0x82,	0x28,	0x81,	0x48,	0xb6,	0x88,	0xc9,	0x8,	0xc1,	0x8, 	0xa2,	0x8,	0x94,	0x8,	0x88,	0x8,	0xff,	0xf8,\
}
const pic16!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x82,	0x8,	0x83,	0x8,	0x82,	0x88, 	0x82,	0x48,	0x82,	0x48,	0x82,	0x88,	0x8e,	0x8,	0x96,	0x8, 	0x9e,	0x8,	0x8c,	0x8,	0x80,	0x8,	0xff,	0xf8,\
}
const pic17!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0x80,	0x8,	0x80,	0x8, 	0x8f,	0x88,	0x9a,	0xc8,	0xa7,	0x28,	0x9a,	0xc8,	0x8f,	0x88, 	0x80,	0x8,	0x80,	0x8,	0x80,	0x8,	0xff,	0xf8,\
}
const pic18!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0x90,	0x48,	0xaf,	0xa8, 	0xa0,	0x28,	0xa2,	0x28,	0xa7,	0x28,	0xa2,	0x28,	0xa2,	0x28, 	0x90,	0x48,	0x8f,	0x88,	0x80,	0x8,	0xff,	0xf8,\
}
const pic19!()={\
	0x0,	0xd,	0x0,	0xd,	0x1,	0x0,	0x0,	0x0,	0x0,	0x0, 	0x0,	0x0,	0xff,	0xf8,	0x80,	0x8,	0xb8,	0xe8,	0xa0,	0x28, 	0xaa,	0xa8,	0x82,	0x8,	0x8f,	0x88,	0x82,	0x8,	0xaa,	0xa8, 	0xa0,	0x28,	0xb8,	0xe8,	0x80,	0x8,	0xff,	0xf8,\
}




sub drawpic(n,x,y)
	select case n
		case 1
		putpct(x,y,13,13,pic1!)
		case 2
		putpct(x,y,13,13,pic2!)
		case 3
		putpct(x,y,13,13,pic3!)
		case 4
		putpct(x,y,13,13,pic4!)
		case 5
		putpct(x,y,13,13,pic5!)
		case 6
		putpct(x,y,13,13,pic6!)
		case 7
		putpct(x,y,13,13,pic7!)
		case 8
		putpct(x,y,13,13,pic8!)
		case 9
		putpct(x,y,13,13,pic9!)
		case 10
		putpct(x,y,13,13,pic10!)
		case 11
		putpct(x,y,13,13,pic11!)
		case 12
		putpct(x,y,13,13,pic12!)
		case 13
		putpct(x,y,13,13,pic13!)
		case 14
		putpct(x,y,13,13,pic14!)
		case 15
		putpct(x,y,13,13,pic15!)
		case 16
		putpct(x,y,13,13,pic16!)
		case 17
		putpct(x,y,13,13,pic17!)
		case 18
		putpct(x,y,13,13,pic18!)
	end select
end sub



sub readme()
	dim a$(16)
	a$(1)=">>>>>>>Readme<<<<<<<"
	a$(2)="===================="
	a$(3)="  选择[Start Game]然"
	a$(4)="后选择相应级别,即可 "
	a$(5)="开始游戏。          "
	a$(6)="  游戏开始时你有5秒 "
	a$(7)="的时间来记住屏幕上的"
	a$(8)="东东,5秒后所有的卡片"
	a$(9)="就会翻到背面,这时你 "
	a$(10)="可以移动方向键来选择"
	a$(11)="你要掀开的卡片,按下 "
	a$(12)="Enter即可掀开,如果连"
	a$(13)="续两次掀开同样的卡片"
	a$(14)=",分数会增加20,否则减"
	a$(15)="10。                "
	a$(16)="  <按Q键返回主界面> "
	b=1
	timerclose()
	cls
	do
		locate(1,1):print a$(b);a$(b+1);a$(b+2);a$(b+3);a$(b+4);a$(b+5)
		k=getkey()
		if k=128 then
			dec b
			if b=0 then b=1
		else if k=129 then
			inc b
			if b=12 then b=11
		else if k=113 then
			exit do
		end if
	loop
end sub



sub runend()
	timerclose()
	timeropen(100)
	cls
	locate(2,7):print "谢谢使用"
	locate(4,2):print "程序制作:Cool&Easy"
	locate(5,5):print "QQ:350220789"
	locate(6,2):print "SoCoolEasy@163.com"
	delay(100)
	do
		k=getkey()
		if k<>135 then end
		lcdreverse(0,0,158,95)
	loop
end sub



sub start()
	cls
	timerclose()
	timeropen(30)
	sysprtstrg(36,16,"  初级  4*4  ")
	sysprtstrg(36,40,"  中级  6*4  ")
	sysprtstrg(36,64,"  高级  6*6  ")
	x=44
	a=1
	delay(30)
	do
		k=getkey()
		if k=135 then
			if x<44 then
			x=44
			goto 2
			end if
			if x>28 then
			x=28
			goto 2
			end if
		else if k=128 then
			if a=1 then
				sysprtstrg(36,16,"  初级  4*4  ")
			else if a=2 then
				sysprtstrg(36,40,"  中级  6*4  ")
			else if a=3 then
				sysprtstrg(36,64,"  高级  6*6  ")
			end if
			dec a
			if a=0 then a=3
		else if k=129 then
			if a=1 then
				sysprtstrg(36,16,"  初级  4*4  ")
			else if a=2 then
				sysprtstrg(36,40,"  中级  6*4  ")
			else if a=3 then
				sysprtstrg(36,64,"  高级  6*6  ")
			end if
			inc a
			if a=4 then a=1
		else if k=13 then
			if a=1 then
				maxx=4
				maxy=4
				x=18
				y=18
				c=16
			else if a=2 then
				maxx=6
				maxy=4
				x=3
				y=18
				c=24
			else if a=3 then
				maxx=6
				maxy=6
				x=3
				y=3
				c=36
			end if
			exit do
		end if
		2 if a=1 then
			sysprtstrg(x,16,"  初级  4*4  ")
		else if a=2 then
			sysprtstrg(x,40,"  中级  6*4  ")
		else if a=3 then
			sysprtstrg(x,64,"  高级  6*6  ")
		end if
	loop
	cls
	print "读取数据中..."
	dim data(36)
	dim map(5,5)
	dim p(6,6)
	n=1
	for m=1 to 36 step 2
		data(m)=n
		data(m+1)=n
		inc n
	next m	
	for m=0 to 5
		for n=0 to 5
			map(m,n)=1
		next n
	next m
	for m=1 to maxx
		for n=1 to maxy
			d=rnd(c)+1
			p(m,n)=data(d)
			if d<>c then data(d)=data(c)
			dec c
		next n
	next m
	cls
	box(x-3,y-3,x+maxx*15,y+maxy*15)
	for m=1 to maxx
		for n=1 to maxy
			drawpic(p(m,n),x+(m-1)*15,y+(n-1)*15)
		next n
	next m
	time=5
	locate(2,14):print "Time:"
	locate(3,16):print time
	locate(4,14):print "Score:"
	locate(5,15):print 0
	timerclose()
	timeropen(100)
	delay(100)
	do
		k=getkey()
		if k=135 then
			dec time
			locate(3,16):print time
			if time=0 then
				exit do
			end if
		end if
	loop
	for m=1 to maxx
		for n=1 to maxy
			putpct(x+(m-1)*15,y+(n-1)*15,13,13,pic19!)
		next n
	next m
	score=0
	time=0
	out=0
	win=maxx*maxy
	px=x
	py=y
	lcdreverse(x,y,x+12,y+12)
	delay(100)
	do
		k=getkey()
		if k=135 then
			inc time
			locate(3,15):print "     "
			locate(3,15):print int(time/60);":";time MOD 60
		else if k=128 then
			lcdreverse(px,py,px+12,py+12)
			py=py-15
			if py<y then py=y+(maxy-1)*15
			lcdreverse(px,py,px+12,py+12)
		else if k=129 then
			lcdreverse(px,py,px+12,py+12)
			py=py+15
			if py>y+(maxy-1)*15 then py=y
			lcdreverse(px,py,px+12,py+12)
		else if k=131 then
			lcdreverse(px,py,px+12,py+12)
			px=px-15
			if px<x then px=x+(maxx-1)*15
			lcdreverse(px,py,px+12,py+12)
		else if k=130 then
			lcdreverse(px,py,px+12,py+12)
			px=px+15
			if px>x+(maxx-1)*15 then px=x
			lcdreverse(px,py,px+12,py+12)
		else if k=13 then
			if map((px-x)/15,(py-y)/15)=1 then
				if out=0 then
					px1=px
					py1=py
					out=1
					map((px-x)/15,(py-y)/15)=0
					drawpic(p((px-x)/15+1,(py-y)/15+1),px,py)
					lcdreverse(px,py,px+12,py+12)
				else if out=1 then
					out=0
					drawpic(p((px-x)/15+1,(py-y)/15+1),px,py)
					if p((px-x)/15+1,(py-y)/15+1)=p((px1-x)/15+1,(py1-y)/15+1) then
						map((px-x)/15,(py-y)/15)=0
						score=score+20
						win=win-2
						locate(5,15):print "     "
						locate(5,15):print score
					else
						map((px1-x)/15,(py1-y)/15)=1
						score=score-10
						locate(5,15):print "     "
						locate(5,15):print score
						delay(100)
						putpct(px1,py1,13,13,pic19!)
						putpct(px,py,13,13,pic19!)
					end if
					lcdreverse(px,py,px+12,py+12)
				end if
			end if
		end if
		if win=0 then
			exit do
		end if
	loop
	timerclose()
	clspart(37,13,122,66)
	box(37,13,122,66)
	locate(2,6):print "Time:";time;"s"
	locate(3,6):print "Score:";score
	sa=int(a*30*100/time)
	if sa>100 then sa=100
	sb=int(score*100/(maxx*maxy*10))
	if sb<0 then sb=0
	s=int((sa+sb)/2)
	locate(4,6):print "评价:";s;"分"
	pause
	clspart(21,29,138,48)
	box(21,29,138,48)
	locate(3,4):print "再玩一次?(Y/N)"
	do
		k=getkey()
		if k=121 then
			exit do
		else if k=110 then
			runend()
		end if
	loop
end sub



1 cls
timerclose()
timeropen(30)
sysprtstrg(40,24,"Start Game")
sysprtstrg(56,40,"Readme")
sysprtstrg(44,56,"Quit Game")
lcdreverse(40,24,120,39)
c=1
d=1
y=24
delay(30)
do
	k=getkey()
	if k=135 then
		lcdreverse(40,y,120,y+15)
		inc d
	else if k=128 then
		if d MOD 2<>0 then lcdreverse(40,y,120,y+15)
		dec c
		if c=0 then c=3
		y=8+c*16
		lcdreverse(40,y,120,y+15)
		d=1
	else if k=129 then
		if d MOD 2<>0 then lcdreverse(40,y,120,y+15)
		inc c
		if c=4 then c=1
		y=8+c*16
		lcdreverse(40,y,120,y+15)
		d=1
	else if k=13 then
		if c=1 then
			start()
			goto 1
		else if c=2 then
			readme()
			goto 1
		else if c=3 then
			runend()
		end if
	end if
loop

⌨️ 快捷键说明

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