Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Mon Nov 23, 2009 3:10 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ]  Bookmark and Share
Author Message
 Post subject: data entry restrictions
PostPosted: Thu May 12, 2005 3:02 pm 
Offline

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
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 3:27 pm 
Offline
100+ Club
User avatar

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review


Webmaster - Excruciating - Johnathan - Kotik - Ash - Tomi - rangana - Phate - dflynn - Medley