I have a 2 dimensional boolean array and i need to compare some elements. I need to compare the neighbors of all the elements. One element has 8 neighbors, top and bottom, right and left, and then the diagonals would make 8. I also need a counter to count how many trues there are and then return the value some how. Im completely lost on how to do this so any help would be nice.
4 2489
Greetings, nickels!
Do you have anything working thus far? I think there's a lot here you can use including of mine, but you'd need to search bit.
Post what you have, see what we can help you with. Thi might also give us a clear idea what you're hoping to achieve.
I'm just passing through, others may see your post if you dd here...
In a bit!
Dököll
can you at least post you code please or your algorithm. so we could help you
ok i have to put where im counting the neighbors in the countNeighbors method. The genNextGrid is where i have to create a temporary two dimensional array and use the countNeighbors method. Depending on how many true and falses are around an element will change it to true or false or keep it where its at. Heres my code...
For any point at index (x,y) jot down the index values in terms of x and y of all of its neighbours. Do you notice any regularity?
kind regards,
Jos
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Chaz |
last post by:
Hello, I hope someone can help me out. I am going to be taking the
third step in a programming class soon(I took the previous two a while
ago at a different school) and in an effort to get back up...
|
by: Varun Sinha |
last post by:
I have an array of chars. I want to loop through it, compare each
element to different chars and depending on which character it
matches, take some action.
My problem is that I can't figure out...
|
by: Donald Grove |
last post by:
If I have two arrays, what is a good paradigm for comparing what is in
them, to determine what elements they share, or don't share?
Specifically, each array could potentially contain the integers...
|
by: psmahesh |
last post by:
Hi folks,
I am comparing two arrays and removing matches from the second array
from the first array.
Can someone take a look at this code below and mention if this is okay
and perhaps if there...
|
by: ccshine via DotNetMonster.com |
last post by:
I'm working on an app that implements a Structure to store a recordset in an
ArrayList. I used this setup to bind to a DataGrid and it worked out so well,
I thought it might be a better solution...
|
by: J Caesar |
last post by:
In C you can compare two pointers, p<q, as long as they come from the
same array or the same malloc()ated block. Otherwise you can't.
What I'd like to do is write a function
int comparable(void...
|
by: chiefychf |
last post by:
I'm working on a school project and I am having a few issues... The program calls for three arrays a,b,c that have to be sorted, then compared to even or odd and stored in arrays d & e, then merge...
|
by: subodheee |
last post by:
i have a problem in implementing script,i have to extract from below data op,offset,and i need to compare the if same offset,same op repeats in other process i need to make it as same,else no .please...
|
by: fgh.vbn.rty |
last post by:
I know that std::vector<boolis specialized to store individual bools
as single bits. I have a question about the comparison operation on a
pair of vector<bool>s.
Is the comparison done bit by...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shćllîpôpď 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |