求助VB解题

[复制链接]
查看11 | 回复3 | 2008-11-17 13:11:23 | 显示全部楼层 |阅读模式
Game 5: Guess-A-Word Game
Assume you are given a file, called words.txt, with a number of five-letter words as follows:
b,a,s,i,c
l,a,b,e,l
s,t,o,r,e
w,o,r,d,s
q,u,e,r,y
g,u,e,s,s
r,i,g,h,t
w,r,o,n,g
t,h,i,n,k
l,o,o,p,s
Each record in the file consists of 5 fields, each containing a character of the word in the order
that they appear in the given word.
Page 5 of 6
Write a game that generates a random number (in the range 1 to number of records in the file, 10
in our case) and retrieves the random number record from the file (for example, if the random
number is 4 then the 4th record should be retrieved). The player is then asked to guess each
different character in the five-letter word. Each time the player guesses a correct letter of the
word then the character(s) should be displayed in the appropriate text box(es) on the user
interface, in the order that they appear in the word. (If a character appears more than once in a
word then all occurrences of the character should be displayed in the appropriate textboxes.) The
maximum number of incorrect guesses that the player should be allowed is 4. Each time a wrong
guess is chosen, an X should appear in one of the four “wrong guess” textboxes on the interface.
The process should stop if the player has guessed the complete word (i.e., all five textboxes
contain the letters of the word) or the maximum number of incorrect guesses has been reached
(4). In addition, your program should display an appropriate message to indicate whether the
player has guessed the complete word or not. Note, to help the user remember which letters
he/she has already guessed, each guess (correct or incorrect) should be displayed in a picture box
on the user interface as the user is playing the game.

回复

使用道具 举报

千问 | 2008-11-17 13:11:23 | 显示全部楼层
现在的学生啊。。。 日, 太懒了。 出国留学的更懒了!!! 学生=懒人+烂人出国的学生 = ((懒人+烂人)mod 懒人)+ 懒人×2 + 烂人。。。 呵呵.......
回复

使用道具 举报

千问 | 2008-11-17 13:11:23 | 显示全部楼层
的确是鸟语,不说人话,中国人就应该说中国话呀!...
回复

使用道具 举报

千问 | 2008-11-17 13:11:23 | 显示全部楼层
一个猜字游戏,我会做,但没有装VB,呵呵...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行