|
Your time now: Mon Nov 23, 2009 3:10 pm
|
View unanswered posts | View active topics
| Author |
Message |
|
charndex
|
Post subject: data entry restrictions Posted: Thu May 12, 2005 3:02 pm |
|
Joined: Fri Apr 29, 2005 11:14 am Posts: 3 Location: leeds
|
|
hie guys, i`m almost done with snakes and ladders thanx to you. i need a bit of help though.
i need to specify the following restrictions in data entry.
;a square can only contain one of
the top of a ladder
the foot of a ladder
the head of a snake
the tail of a snake
No ladder goes off the board
no snake goes off the board
how do i go about it. i simply need the code for this.
any help would be solely appreciated
|
|
| Top |
|
 |
|
dafunkymunky
|
Post subject: Posted: Fri May 13, 2005 3:27 pm |
|
 |
| 100+ Club |
 |
Joined: Fri Apr 08, 2005 8:32 am Posts: 182 Location: India
|
|
see this is what you do
declare a two dimensional array and initially save all the entries to zero
the no of rows and columns in your array should be equal to the no of rows and columns in your board , i think i told you in youyr earlier post how to redeclare the size of the array
this is done by
for i = 0 to <the no of rows in your array>
for j=0 to <no of columns in your array>
array(i,j)=0
next j
next i
now as the user or whoever puts something store a certain value like say if the square contains the head or tail store 1 or 2 and if ti contains the foot or the end of the ladder store 3 or 4 to the corresponding row and col of the array as that of the board
this way every time the user begins is ladder or ends his ladder you just check if the value in the array element of that row and column is 0 otherwise display error mesage
and the snake and ladder going out of the box can be checked by checking if the row or coulmn the ladder or snake begins or ends is outside the arrray limits remember the ubound and lbound tags
and man please ask for the eact code if you reaaly dont understand evenafter my post or atleasst tick solved and post you solution so that one can understand the discussion is complete
i think it would be bettter if you would post a link to you game once it is completed everyone can see and appriciate you work
_________________ --------DAFUNKYMUNKY--------
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|
|