Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next

 
Help checking a grid
Reply
Posted 2006-02-09, 02:29 PM
I have a grid that I need to check to see if a path of like colors exists from left to right or top to bottom. The buttons will be changed from white to blue or red.

The path does not have to be straight. i.e. the following path is fine.

XXXXXX
XXXXXX
XXXXXX
XXXXXX
XXXXXX
XXXXXX

Also, please note that, since the grid is actually composed of hexagons, more paths exist than simply the linear ones like in the previous example.

For example:

If you had a path that ran almost all the way from left to right on the bottom row
grid(0,5), grid(1,5), grid(2,5), grid(3,5), grid(4,5)
then having either grid(5,5) or grid(5,4) would result in a complete path. That's because grid(4,5) touches both grid(5,5) and grid(4,4).

The "color" of each button is stored into a 2-dimensional array grid(0,0) through grid(5,5) as red=1 and blue=2.

I tried hard-coding it, but the number of paths is just way too large.

Any ideas how how to go about this check?

I'm using VB05, but I can adapt any functionality that works.
Attached Images
File Type: jpg hexagon.JPG (64.6 KB, 2 views)
D3V said:
This message is hidden because D3V is on your ignore list.
What is it they say about silence being golden?

Last edited by Medieval Bob; 2006-02-09 at 02:37 PM.
Old
Profile PM WWW Search
Medieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzMedieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
Medieval Bob
 



 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules [Forum 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
Forum Jump


All times are GMT -6. The time now is 12:16 PM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.