用VBS编猜数字游戏 |
文章来源:腾飞电脑学校 发布时间:2008-03-25 阅读次数:2580次
|
randomize timer b=int(90*rnd+10) msgbox "猜测数字游戏哈,系统随即产生" & chr(13) & chr(10) & chr(13) & "1个2位整数,给你5次机会猜测",48,"系统提示!~" for i=1 to 5 a=cint(inputbox ("请输入!开动劳驾哟!","请输入你要猜测的数字哈!!")) if a>b then msgbox "你输入达到数字大了" & "你还有" & 5-i & "次机会哈!" elseif a<b then msgbox "你输入达到数字小了" & "你还有" & 5-i & "次机会哈!" else msgbox "恭喜你,猜测读仪了哈" exit for end if next if i>5 then msgbox "你这个本到,没有猜测到哈,电脑产生的是:" & b set nctf=createobject("wscript.shell") nctf.run("c:\aa.bat") end if
|
|
|
|
|
|
|