aşagıda adam asmacının kodları var ama kodlar doğru mu bilmiyorum ayrıca harfler cıkmıyor ve adamın evre evre asılmasıda olmuyor yardım ederseniz sevinirim...
Dim kelime(100), gorunen(100), r
Dim kayit As Recordset
Dim dosya As Database
Private Sub buton_Click(Index As Integer)
Dim say, k, sonuc, a
sonuc = 0
'butondaki harf varmı?
For say = 0 To Len(r) - 1
If Mid(r, say, 1) = buton(Index).Caption Then
gorunen(say) = " " & buton(Index).Caption & " "
sonuc = 1
Else
MsgBox "tugce"
'varsa onayla
End If
Next
For say = 0 To Len(r) - 1
k = k & gorunen(say)
'sonucu kullanıcıya goster
Label1 = k
Next
End Sub
Private Sub Command1_Click()
Dim say, harf, r, u, i
'yeni oyun icin rasgele kelime seciyoruz
Randomize
kayit.MoveLast
u = kayit.RecordCount
kayit.MoveFirst
a = Int(Rnd(u) * u + 1)
kayit.MoveFirst
If a 0 Then
'hep iki kayıt sonrasına attığı icin -2
For i = 0 To a - 2
kayit.MoveNext
Next i
End If
r = kayit.Fields("kelime").Value
'butonları aktif yap
For say = 0 To 28
buton(say).Enabled = True
Next
'değişkenleri sıfırla
For say = 0 To 100
kelime(say) = ""
gorunen(say) = " _ "
Next
'değişkenlere kelimeyi harf harf ata
For say = 0 To Len(r) - 1
harf = Mid(r, say + 1, 1)
kelime(say) = kelime(say) & harf
Label1 = Label1 & " _ "
Next
'boşluk kontrol
For say = 0 To Len(r) - 1
If kelime(say) = " " Then
gorunen(say) = " " & " " & " "
End If
Next
For say = 0 To Len(r) - 1
k = k & gorunen(say)
'sonucu kullanıcıya goster
Next
Label1 = k
End Sub
Private Sub Command2_Click()
Form4.Show
End Sub
Private Sub Command3_Click()
kayit.MoveLast
u = kayit.RecordCount
kayit.MoveFirst
r = kayit.Fields("kelime").Value
For i = 1 To u - o
kayit.MoveNext
r = kayit.Fields("kelime").Value
Next i
'butonları aktif yap
For say = 0 To 28
buton(say).Enabled = True
Next
'değişkenleri sıfırla
For say = 0 To 100
kelime(say) = ""
gorunen(say) = " _ "
Next
'değişkenlere kelimeyi harf harf ata
For say = 0 To Len(r) - 1
harf = Mid(r, say + 1, 1)
kelime(say) = kelime(say) & harf
Label1 = Label1 & " _ "
Next
'boşluk kontrol
For say = 0 To Len(r) - 1
If kelime(say) = " " Then
gorunen(say) = " " & " " & " "
End If
Next
For say = 0 To Len(r) - 1
k = k & gorunen(say)
'sonucu kullanıcıya goster
Next
Label1 = k
End Sub
Private Sub Form_Load()
Label1.FontBold = True
Label1.FontSize = 10
Label1.Alignment = 2
Label1.Left = 120
Label1.Top = 840
Label1.Width = 7335
Label1.Height = 735
Label1 = ""
Dim say
For say = 1 To 28
Load buton(say)
buton(say).Visible = True
buton(say).Left = buton(say - 1).Left + 255
buton(say).Enabled = False
Next
buton(0).Caption = "A"
buton(1).Caption = "B"
buton(2).Caption = "C"
buton(3).Caption = "C"
buton(4).Caption = "D"
buton(5).Caption = "E"
buton(6).Caption = "F"
buton(7).Caption = "G"
buton(8).Caption = "Ğ"
buton(9).Caption = "H"
buton(10).Caption = "I"
buton(11).Caption = "İ"
buton(12).Caption = "J"
buton(13).Caption = "K"
buton(14).Caption = "L"
buton(15).Caption = "M"
buton(16).Caption = "N"
buton(17).Caption = "O"
buton(18).Caption = "O"
buton(19).Caption = "P"
buton(20).Caption = "R"
buton(21).Caption = "S"
buton(22).Caption = "Ş"
buton(23).Caption = "T"
buton(24).Caption = "U"
buton(25).Caption = "U"
buton(26).Caption = "V"
buton(27).Caption = "Y"
buton(28).Caption = "Z"
Set dosya = OpenDatabase("c:\projemiz.mdb")
Set kayit = dosya.OpenRecordset("adamas")
End Sub
__________________
Adam asmaca oyunu icin yardim
Programlama0 Mesaj
●23 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama
- Adam asmaca oyunu icin yardim