Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread David Hershberger
; >> then >> >> -1,-1,27 >> -1,01,04 >> -1,27,04 >> >> then >> >> -1,-1,27 >> -1,01,04 >> 01,27,04 >> >> then >> >> -1,36,27 >> -1,01,04 >> 01,27,04 >> >> then >> >> -1,36,2

RE: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Paul Steven
Hershberger Sent: 11 March 2009 18:50 To: Flash Coders List Subject: Re: [Flashcoders] Advice on creating random grid of pairs for a game Jonathan, When you "match" a pair, you pull them off the grid. Therefore after removing the pair of 2s, there are only empty squares in the path betw

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Anthony Pace
01,04 01,27,04 then 00,36,27 36,01,04 01,27,04 -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of David Hershberger Sent: 11 March 2009 17:40 To: Flash Coders List Subject: Re: [Flashcoders] Advice on creating random

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Anthony Pace
36,27 36,01,04 01,27,04 -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of David Hershberger Sent: 11 March 2009 17:40 To: Flash Coders List Subject: Re: [Flashcoders] Advice on creating random grid of pairs for a

RE: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Paul Steven
] Advice on creating random grid of pairs for a game My first thought for your algorithm is to essentially follow the solution path that your user might end up taking. Your user will be clearing areas out, opening them up. Your algorithm could start with an empty grid and fill in around a starting seed

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread David Hershberger
to generate an entire grid. > > > > Perhaps this process is really time consuming and I need to leave it for > > hours to generate a grid but I wouldn't have thought so. > > > > Any advice much appreciated! > > > > Thanks > > > > Paul > > >

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Anthony Pace
leaf.com] On Behalf Of Anthony Pace Sent: 11 March 2009 16:31 To: Flash Coders List Subject: Re: [Flashcoders] Advice on creating random grid of pairs for a game Sounds like one of my old high-school projects, I see several ways of doing what you want that make sense: * -random population alwa

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Anthony Pace
Oh man... I just got to thinking along those lines and you beat me to it; however, I was thinking that, in order to avoid them being placed side by side, you could place a restriction on minimum distance and force it to be 2 or more. Then I was thinking your could cross hatch; however, I thin

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread jonathan howe
;> hours to generate a grid but I wouldn't have thought so. >> >> Any advice much appreciated! >> >> Thanks >> >> Paul >> >> >> -Original Message- >> From: flashcoders-boun...@chattyfig.figleaf.com >> [mailto:flashcoders-

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread jonathan howe
ul > > > -Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com > [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Anthony > Pace > Sent: 11 March 2009 16:31 > To: Flash Coders List > Subject: Re: [Flashcoders] Advice on creating ra

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread David Hershberger
My first thought for your algorithm is to essentially follow the solution path that your user might end up taking. Your user will be clearing areas out, opening them up. Your algorithm could start with an empty grid and fill in around a starting seed, growing the tile array outward. 1) empty gri

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Ian Thomas
for > hours to generate a grid but I wouldn't have thought so. > > Any advice much appreciated! > > Thanks > > Paul > > > -Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com > [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of A

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Anthony Pace
lashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Anthony Pace Sent: 11 March 2009 16:31 To: Flash Coders List Subject: Re: [Flashcoders] Advice on creating random grid of pairs for a game Sounds like one of my old high-school projects, I see several ways of

RE: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Paul Steven
ubject: Re: [Flashcoders] Advice on creating random grid of pairs for a game Sounds like one of my old high-school projects, I see several ways of doing what you want that make sense: * -random population always of an array 81 units long (80 if you want the last to always be blank) o -

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Anthony Pace
Sounds like one of my old high-school projects, I see several ways of doing what you want that make sense: * -random population always of an array 81 units long (80 if you want the last to always be blank) o --you could create a function that loops 41(or 40 if last al

[Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Paul Steven
I am trying to write the code to populate a 9 by 9 grid of tiles with 40 pairs of matching tiles. I have 4 different types of tiles and I want to create a grid that has 40 matching pairs and 1 blank tile. I do not want the pairs all to be next to each other but there needs to be at least one solu

Re: [Flashcoders] Advice on creating random grid of pairs for a game

2009-03-11 Thread Glen Pike
Jobe Makar's book about Flash Games Demystified has a wordsearch that shuffles words in a grid - it will keep shuffling upto a point, then decide that it is getting nowhere and try again. There may be some examples of this sort of thing online - I have the book at home if not :) Paul Steven w