Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 'Battleship' matrix

Author
Message
Salop
20
Years of Service
User Offline
Joined: 8th Feb 2004
Location:
Posted: 8th Feb 2004 12:41
Hi, Im currently trying to create a seating program based on battleships. To do this i want to create a matrix which returns numbers dependent on the square occupied. Therefore if a square is occupied all the rest of the squares in the matrix will be allocated a number in relation to their distance from the occupied square. The next seat occupied can then be selected with these numbers considered (e.g. only select a seat 5 away from the nearest person. Is there a way of returning numbers from matrices with regard to position or am I barking up the wrong tree altogether?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 8th Feb 2004 15:34
if you know the division size of a matrix eg: 10

and say your matrix was 100,100 then you would know an object within the zone 80 - 90 , 80 -90 is in a particular zone.

Im suggesting it has to be done with maths.

you could also set up an array eg: zone(x,z) and store a number in each zone regarding whether it is used or clear.

zone(8,5)=0 as an example would be clear etc..


zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 8th Feb 2004 19:22
Do you mean numerical arrays or the matrix object which is a 3D object?

Login to post a reply

Server time is: 2024-09-21 20:47:01
Your offset time is: 2024-09-21 20:47:01