# [Fixed] Fill the Holes Gradually !

0 favourites
• 15 posts
From the Asset Store
An educational game for Fill in the Blanks. An easy to use template for developers to build larger games
• Hey Guys ! Guess What ... Another Array Issue ! Yay ... I'm so happy , I'm going to launch myself from the windows !

This one is more detailled , I want to gradually fill the holes that are inclused by 3 or more blocks ... Screenie !

<img src="http://dl.dropbox.com/u/89532891/Others/Example%20!.png" border="0">

Thanks for all !

• Bump it , Bump it , Bump it !

• Come on , People ! Is this too hard ?

• Alright, say you go over all the xy elements (for each xy element), and check what the value was (current value), and suppose we say if that value was one then there should be a wall there.... easy right?

Now what if you do compare at xy, and compare what the value was for the next xy, or cell? Say for example current x +1, and current y.

What cell would that be?

What would current x, and current y+1 be?

Current x-1, and current y?

Current x, and current y-1?

Wouldn't that essentially check all 4 cells around the current cell?

And say what if one of those cells returned the value of zero instead of 1.

Would that give you any ideas as far as what to do?

• newt , I did indeed think of that a while ago !

The only thing that I can't do is to implement it to C2 , I'm new to arrays and I did my best , but I simply can't do it ...

• Well first of all, you have to define what you really want to do.

Like define a hole first.

What is a hole?

• Hole | an opening through something; gap; aperture: a hole in the roof; a hole in my sock.

the holes that are inclused by 3 or more blocks

newt , Now , what do I do ?

• Don't get snippy, besides I think the word you are looking for is enclosed,or included not inclused.

A hole would be defined as a current value of zero, and current x+1, current y with a value of 1, and current x, current y-1 with a value of 1, and current x-1, current y with a value of 1, and current x, currenty-1 with a value of 1.

That's my definition of a hole with all 4 side with a wall.

You want that definition and what other definitions?

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• If you want ... I made an algorithm that I can't get going on C2

For Each Elements (X,Y)

• Compare : CurrValue < 8.25

-- ( I'm stuck after dat >.< )

I could make another array and do that all round but I don't know how to do it efficiently ...

• The definition that I would prefer is enclosed by 3 or more walls

• newt ? What do I have to do ?

• I think this is what you're after. Hope you understand my drunken commenting ;)

dl.dropbox.com/u/666574/array%20filling%20in%20gaps.capx

• oooh that looks good. I'm not adept at the Array funciton in C2. I was thinking more of a brute for method, but I like yours :)

just commenting :D

• Whiteclaws, you might want to update the title to 'fixed' since I'm pretty sure the issue was resolved in the Skype group ;)

• jayderyu, arrays are pretty powerful as you know. Here's a little update that I toyed with to amuse my drunken self..

Very simple stuff but hopefully it helps someone understand the power of arrays a little better.

• 15 posts