Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 18-01-2008, 08:07 PM   #1 (permalink)
In The Zone
 
Chetan1991's Avatar
 
Join Date: Jan 2007
Location: Shimla
Posts: 285
Question Please help me in VB code


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
--------------------------------------------------------------------------
Chetan1991 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 18-01-2008, 11:09 PM   #2 (permalink)
In The Zone
 
ruturaj3's Avatar
 
Join Date: Feb 2007
Location: Mumbai
Posts: 214
Default Re: Please help me in VB code

if u can provide entire project then i can try. only source wont work.
ruturaj3 is offline  
Old 19-01-2008, 01:16 AM   #3 (permalink)
in search of myself
 
CadCrazy's Avatar
 
Join Date: Sep 2006
Location: Gurgaon
Posts: 1,720
Default Re: Please help me in VB code

Digit forum is not multithreading campatible
http://www.thinkdigit.com/forum/showthread.php?p=724561
__________________
::::::::::::::::::::
Unban Praka123
::::::::::::::::::::
Vista is my Secretary | Mac is my Girlfriend | Linux is my Wife
"Ek Se Mera Kya Hoga" :lol:
CadCrazy is offline  
Old 19-01-2008, 01:23 AM   #4 (permalink)
damn busy...
 
utsav's Avatar
 
Join Date: Sep 2006
Location: Jhansi/Meerut
Posts: 1,991
Default Re: Please help me in VB code

It may have happened by mistake .i am sure abt it
__________________
MSI GX660 with ATI 5870 :grin: ultimate gaming lappy :grin:
Dell Studio 15(1555)
1TB+1.5TB external|N86|ZTE Blade|5230|E63|EP-630|Soundmagic PL50|Sennheiser CXL 400|Meelec M11P+
www.techjunkiez.com
utsav is offline  
Old 19-01-2008, 01:58 AM   #5 (permalink)
Rubik's Uncle!!
 
Charan's Avatar
 
Join Date: Sep 2004
Location: ಬೆಂಗಳೂರು (Bengaluru)
Posts: 3,783
Default Re: Please help me in VB code

Quote:
Originally Posted by CadCrazy View Post
Digit forum is not multithreading campatible
http://www.thinkdigit.com/forum/showthread.php?p=724561
its a double post.. I had reported one .. but it was not delete.
Charan is offline  
Old 19-01-2008, 11:23 AM   #6 (permalink)
damn busy...
 
utsav's Avatar
 
Join Date: Sep 2006
Location: Jhansi/Meerut
Posts: 1,991
Default Re: Please help me in VB code

Apna cadcrazy aajkal voluntary mod ban gaya hai
__________________
MSI GX660 with ATI 5870 :grin: ultimate gaming lappy :grin:
Dell Studio 15(1555)
1TB+1.5TB external|N86|ZTE Blade|5230|E63|EP-630|Soundmagic PL50|Sennheiser CXL 400|Meelec M11P+
www.techjunkiez.com
utsav is offline  
Old 19-01-2008, 07:20 PM   #7 (permalink)
Wise Old Owl
 
dOm1naTOr's Avatar
 
Join Date: Mar 2005
Location: shhhh!!!!! on a sniper point
Posts: 4,200
Default Re: Please help me in VB code

U can do multithreading only in here:
Your Favourite Thread ??
__________________
G1: PII X4 B50 4.0 | TRUE 120*2 | TA790GXB A2+ | 4GB DDR2 GSkill 1200 | Audigy 2 | HD4870 | HEC 550 | MX 518.
G2: AII 240 | M2N 68AM+ | 3GB| 8800GT | Zebby Plat 500
G3: XPS M1530 |
FZ 16.
dOm1naTOr is offline  
Old 20-01-2008, 01:40 PM   #8 (permalink)
In The Zone
 
Chetan1991's Avatar
 
Join Date: Jan 2007
Location: Shimla
Posts: 285
Default Re: Please help me in VB code

I've uploaded the project. Here's the link :
http://en.uploadtornado.com/12YP0BLT5ODY/snakes'n'ladders.zip
Chetan1991 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
lock code..not security code magneticme200 Mobiles and Tablets 3 29-12-2007 07:15 PM
Need a code... Ron QnA (read only) 4 17-12-2006 01:42 AM
Help with Code Mr.Cool QnA (read only) 10 09-12-2006 02:37 PM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:48 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2