《VB课程设计报告--英语词汇游戏》由会员分享,可在线阅读,更多相关《VB课程设计报告--英语词汇游戏(15页珍藏版)》请在金锄头文库上搜索。
1、VB课程设计报告题目:英语词汇游戏 姓 名: xxx 学 号:xxxxx 院 系: xxxx 指导老师: xxxx目录一. 课程设计目的.1二. 课程设计题目及简介.1三. 设计方法简介.1四. 局部源代码实现.2五. 运行结果截图显示.7六. 心得与体会.。.15一 课程设计目的: 随着计算机、计算机应用技术的不断开展,计算机应用已经深入到政治、经济、军事、教育、生活的各个领域,计算机软件是计算机应用的核心内容,作为开发计算机软件的程序设计显得尤为重要。VB程序开发语言以其简单易学的特性,在全社会得到广泛的使用和推广,各行各业的人员通过学习VB程序开发语言,能够很快的成为计算机和信息技术应用
2、的开发者。 本次课程设计为学生提供了一个既动手又动脑的,独立实践的时机,将课本上的理论知识和实践有机的结合起来,锻炼学生的分析解决实际问题的能力,提高学生适应实际,实践编程的能力。二课程设计题目及简介: 英语词汇连接游戏通过在给出的英语单词和中文含义之间进行连接来学习英语。游戏按照英语字典的顺序,系统地安排从A到Z的不同游戏小局,用户可以根据自己的情况选择进行娱乐学习,并给出学习效果评价。通过反复游戏,用户可以提高英语单词词汇量,在用户从A到Z地选择不同游戏小局后,将在显示界面上出现10个英语单词的英文及对应中文卡片,同时进行10s计时,时间到了,将出现下一组10个英语单词的英文及对应的中文卡
3、片,直至游戏小局结束。同时,对连接正确的进行计数,给出学习效果。三 设计方法简介: 本次课程设计英语单词按照文件进行组织,从A到Z组织成26个文件。每个文件每一行由单词英文,单词中文构成,例如:单词1英文、单词1中文、单词2英文、单词2中文、.、单词n英文,单词n中文。 数据流程图如下: 功能结构图如下:四 局部源代码实现如下:ublic Class wordlink Dim currentgame As String = Dim gamenow As String = 0 Dim gameover As Boolean = False Dim words(10, 2) As String D
4、im wordscoor(10, 2) As String Dim first As Integer = -1 Dim second As Integer = -1 Dim nums As Integer = 0 Dim totalwords As String = Dim wordstring As String = Dim currentwords As Integer = 1 Dim openmidi As Boolean = False Dim seconds As Integer = 0 Private Declare Function mciExecute Lib winmm.dl
5、l Alias mciExecute () Private Sub game_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles game.SelectedIndexChanged Dim filename As String currentgame = game.GetItemText(game.SelectedItem) filename = currentgame + .text If readwords(filename) Then nums = 0 match
6、num.Text = nums.ToString ProgressBar1.Value = 0 checkclear(0) checkclear(3) first = -1 second = -1 wordstring = getwords() splitword() ProgressBar1.Step = Int(550 / (5 * currentwords / 2) checkclear(2) Timer2.enabled = True End If End Sub Private Function readwords(ByVal file As String) As Boolean r
7、eadwords = False If System.IO.File.Exists(file) Then totalwords = System.IO.File.ReadAllText(file) If totalwords.Trim.Length = 0 Then MsgBox(file + 文件没有内容!, MsgBoxStyle.Exclamation, 请检查文件!) gameover = True Else gameover = False readwords = True End If Else MsgBox(file + 文件不存在!, MsgBoxStyle.Exclamati
8、on, 请检查文件!) gameover = True End If End Function Private Function getwords() As String Dim mystr As String = Dim temp As String = Dim i As Integer = 0 Do While i = 0 And temp.Trim.Length 1 Then mystr = mystr + temp currentwords = i + 1 Else mystr = mystr + , End If Loop If totalwords.Trim.Length 0 Th
9、en gameover = False Else gameover = True End If getwords = mystr End Function Private Sub splitword() Dim aword() As String Dim i, j As Integer Dim splitchar() As String = , Dim gen As New System.Random Dim ok As Boolean = False Dim tempstr As String tempstr = wordstring For i = 0 To 9 wordscoor(i,
10、0) = wordscoor(i, 1) = Next i = 0 j = 0 aword = tempstr.Split(splitchar(0) For i = 0 To 9 words(i, 0) = aword(2 * i) words(i, 1) = aword(2 * i + 1) Next For i = 0 To 9 ok = False Do While Not ok j = Int(gen.NextDouble * 10) tempstr = wordscoor(j, 0) If System.String.IsNullOrEmpty(tempstr) Then wordscoor(j, 0) = words(i, 0) ok = True End If Loop Next For i = 0 To 9 ok = False Do While Not ok j = Int(gen.NextDouble * 10) tempstr = wordscoor(j, 1) If System.String.IsNullOrEmpty(tempstr) Then wordscoor(j, 1) = words(i, 1) ok = True End If