,,,
?
, 2003
1.
2.
3. 5
4. .7
5. - 9
6. - 7
7.
8.
9.
. , , . , . ? . . , . , , .
2.
- ? Visual Basic - .
3., Form, TextBox, CommandButton, Line, ListBox, Label, Image.
Form . Ÿ . , . Add Form, , .
CommandButton , , Click(). , , . , . Enabled , . True False. , Top, , , Left, , .
TextBox , . , , , . , . Top, Left, CommandButton; ForeColor, .
Line . BorderColor , BorderStyle , BorderWidth , Visible .
ListBox . . , .
Image . bmp, wmf, ico, gif. : Image, Image . Image .
, IF CASE, WHILE FOR. IF . CASE . WHILE , , . . FOR . OpenFor .
, . , . 4 . . . , . , . 15 , . , 1000 32000. , , , , . , , . 50 50, , . , 50 50, . , , . , , , . . , 1000000 , .
. , . .
.1. .
.1.
8.
Sub GameQuestions(AnswerIsCorrect As Integer)
Dim Questions(1 To 15, 1 To 4) As String
Dim QuestionsMoney(1 To 15) As Long
Dim Answers(1 To 15, 1 To 4) As String
Dim Answer(1 To 4) As String
Dim AnswersRight(1 To 15) As String
Dim ChooseAnswer(1 To 4) As String
Dim I As Integer, J As Integer, Imass As Integer, Jmass As Integer
Dim np As Integer, fp As Integer, Score As Long, Unburned As Long
Dim BuferSTR As String
Randomize
If AnswerIsCorrect = 2 Then
I = 1
End If
If AnswerIsCorrect = 1 Then
I = LabelQuestionI.Caption + 1
End If
If I = 0 Then
WinLooseLine1.Visible = 1
WinLooseLine2.Visible = 1
WinLooseLine3.Visible = 1
WinLooseLine4.Visible = 1
LabelWinLoose.Visible = 1
LabelWinLoose.Caption = " ! : " & LabelUnburned.Caption & " !"
I = 1
EndGame 0
End If
If I = 16 Then
WinLooseLine1.Visible = 1
WinLooseLine2.Visible = 1
WinLooseLine3.Visible = 1
WinLooseLine4.Visible = 1
LabelWinLoose.Visible = 1
LabelWinLoose.Caption = ", " & TextNameInput.Text & ", !"
Score = 1000000
LabelScoreTitle.Caption = Score
LabelScore.Caption = Score
EndGame 0
Else
J = Rnd * 3 + 1
Open "C:\VB\KursKY\quemon.txt" For Input As #1
For Imass = 1 To 15
Line Input #1, BuferSTR
QuestionsMoney(Imass) = BuferSTR
Next Imass
Close #1
Open "C:\VB\KursKY\que.txt" For Input As #1
For Imass = 1 To 15
For Jmass = 1 To 4
Line Input #1, BuferSTR
Questions(Imass, Jmass) = BuferSTR
Next Jmass
Next Imass
Close #1
Open "C:\VB\KursKY\answ.txt" For Input As #1
For Imass = 1 To 15
For Jmass = 1 To 4
Line Input #1, BuferSTR
Answers(Imass, Jmass) = BuferSTR
Next Jmass
Next Imass
Close #1
Open "C:\VB\KursKY\answrig.txt" For Input As #1
For Imass = 1 To 15
Line Input #1, BuferSTR
AnswersRight(Imass) = BuferSTR
Next Imass
Close #1
BuferSTR = AnswersRight(I)
np = 1
fp = 1
ChooseAnswer(1) = SplitAnswers(np, BuferSTR, 0)
np = np + Len(ChooseAnswer(1)) + 1
ChooseAnswer(2) = SplitAnswers(np, BuferSTR, 0)
np = np + Len(ChooseAnswer(2)) + 1
ChooseAnswer(3) = SplitAnswers(np, BuferSTR, 0)
np = np + Len(ChooseAnswer(3)) + 1
ChooseAnswer(4) = SplitAnswers(np, BuferSTR, 1)
If AnswerIsCorrect = 1 Then
Score = QuestionsMoney(I - 1)
LabelScore.Caption = Score
If Score = 1000 Or Score = 32000 Then
Unburned = Score
LabelUnburned.Caption = Unburned
End If
End If
LabelQuestionI.Caption = I
LabelQuestionJ.Caption = J
QuestionNumber.Caption = " " & I & " | " & QuestionsMoney(I) & " "
LabelScoreTitle.Caption = ": " & Score
LabelQuestion.Caption = Questions(I, J)
BuferSTR = Answers(I, J)
np = 1
Answer(1) = SplitAnswers(np, BuferSTR, 0)
np = np + Len(Answer(1)) + 1
Answer(2) = SplitAnswers(np, BuferSTR, 0)
np = np + Len(Answer(2)) + 1
Answer(3) = SplitAnswers(np, BuferSTR, 0)
np = np + Len(Answer(3)) + 1
Answer(4) = SplitAnswers(np, BuferSTR, 1)
AddItemsToList Answer(1), Answer(2), Answer(3), Answer(4)
Choose1.Caption = Answer(1)
Choose2.Caption = Answer(2)
Choose3.Caption = Answer(3)
Choose4.Caption = Answer(4)
ChooseRight.Caption = ChooseAnswer(LabelQuestionJ.Caption)
End If
End Sub
9.
Visual Basic, - , . .
1. .., .. . - : , , 1996.
2. .., ... . : , , 2001.
?, 2003 1. 2. 3.
Copyright (c) 2024 Stud-Baza.ru , , , .