DIGIT-ARC read-only archive · snapshot: July 23, 2026

Please help me in VB code

8 posts · originally from https://geek.digit.in/community/threads/please-help-me-in-vb-code.78510/

Chetan1991
Chetan1991 Original post #1
Jan 18, 2008 at 8:07 PM
Hi Guys!
The following text is the source code of my multiplayer snakes and ladders game in VB.
I am not getting the desired result with it. Please tell me what are the errors in it.
--------------------------------------------------------------------------
'General Declarations
Dim C_1, C_2, C_3, C_4, C_5, C_6, C_7, C_8, C As Integer
Dim p, pcol, Last
'Decorations
Private Sub blink_Timer()
On Error Resume Next
Dim po00 As Byte
po00 = Int((Rnd * 15) + 1)
title.ForeColor = QBColor(po00)
bound1.BorderColor = QBColor(po00 + 1)
bound2.BorderColor = QBColor(po00 + 3)
End Sub

Private Sub reset_Click()
Form_Load
e(C_p).BackColor = &H80FF&
For y = 1 To 100
If y <> Cur Then e(y).BackColor = &H80000016
Next y
End Sub

Private Sub exit_Click()
End
End Sub

Private Sub Form_Load()
'obtaining the number of players from other form
Last = Val(number.num.Text)
p = "1"
C_p = 1
End Sub

Private Sub roll_Click()
Label3.Caption = Str(C_p)
'changing turns
If p = Last Then
p = 1
Else
p = p + 1
End If
'Generating a random number from 1 to 6
Randomize
C = Int((Rnd * 6) + 1)
'Displaying the number on dice
Select Case C
Case 1
dot(4).Visible = True
dot(0).Visible = False
dot(1).Visible = False
dot(2).Visible = False
dot(3).Visible = False
dot(5).Visible = False
dot(6).Visible = False
Case 2
dot(5).Visible = True
dot(0).Visible = False
dot(1).Visible = False
dot(2).Visible = True
dot(3).Visible = False
dot(4).Visible = False
dot(6).Visible = False
Case 3
dot(4).Visible = True
dot(0).Visible = False
dot(1).Visible = False
dot(2).Visible = True
dot(3).Visible = False
dot(5).Visible = True
dot(6).Visible = False
Case 4
dot(4).Visible = False
dot(0).Visible = True
dot(1).Visible = True
dot(2).Visible = True
dot(3).Visible = False
dot(5).Visible = True
dot(6).Visible = False
Case 5
dot(4).Visible = True
dot(0).Visible = True
dot(1).Visible = True
dot(2).Visible = True
dot(3).Visible = False
dot(5).Visible = True
dot(6).Visible = False
Case 6
dot(4).Visible = False
dot(0).Visible = True
dot(1).Visible = True
dot(2).Visible = True
dot(3).Visible = True
dot(5).Visible = True
dot(6).Visible = True
End Select

'Deciding winning condition
If C_p + C >= 100 Then
MsgBox (" Player " + p + "You Win!!!")
C = 0
reset_Click
End If

'Code for Snakes and ladders
If e(C_p + C).Tag = "snake" Then
MsgBox ("Caught by a snake!")
C = -1 * (Int((Rnd * 10) + C))
ElseIf e(C_p + C).Tag = "ladder" Then
MsgBox ("You got a ladder!!")
C = Int((Rnd * 10) + (C + 4))
End If

'colouring the current position
e(C_p + C).BackColor = QBColor(p)

'setting the new block as current block
C_p = C_p + C

'removing color from other blocks
For k = 1 To 100
If k <> C_p Then e(k).BackColor = &H80000016
Next k
End Sub
--------------------------------------------------------------------------
ruturaj3
Jan 18, 2008 at 11:09 PM
if u can provide entire project then i can try. only source wont work.
CadCrazy
Jan 19, 2008 at 1:16 AM
Digit forum is not multithreading campatible
*www.thinkdigit.com/forum/showthread.php?p=724561
utsav
utsav #4
Jan 19, 2008 at 1:23 AM
It may have happened by mistake .i am sure abt it
RCuber
RCuber #5
Jan 19, 2008 at 1:58 AM
Digit forum is not multithreading campatible
*www.thinkdigit.com/forum/showthread.php?p=724561
its a double post.. I had reported one .. but it was not delete.
utsav
utsav #6
Jan 19, 2008 at 11:23 AM
Apna cadcrazy aajkal voluntary mod ban gaya hai :D
dOm1naTOr
Jan 19, 2008 at 7:20 PM
U can do multithreading only in here:
*www.thinkdigit.com/forum/showthread.php?t=78324
Chetan1991
Jan 20, 2008 at 1:40 PM
I've uploaded the project. Here's the link :
*en.uploadtornado.com/12YP0BLT5ODY/snakes'n'ladders.zip