dustin kab

Greenhorn
+ Follow
since Mar 29, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by dustin kab




(I switched to Lists because Sets were eliminating these points on entry.)

I'm wondering how I could check to see if BOTH of the points were entered earlier, and then remove those 2 points from lists. Keeping every entry unique and lined up correctly.
12 years ago
Well there are duplicate points in the array such as:

coordinates[400][0]; //x
coordinates[300][1]; //y


coordinates[400][0]; /x
coordinates[10][1]; //y

using the example:
-- It would remove the second 400 that is found, but then the 10 would be matched up with another X obscuring the points.--

I need to check both x and y, and only remove them if they're both the same as another previous two x and y's.
12 years ago
I was wondering if it is possible to plug an array of arrays into a set.
(I'll refer to array of arrays as 2D arrays to make it easier.)

Basically the problem I have is that my 2d array contains coordinates, and these coordinates get messed up if I make 2 sets and then add the coordinates to it.




Ultimately I want to remove duplicate rows in an array of arrays.
12 years ago
Thanks for the tips, I'll be more clear next time. Either way, it's working now, thanks for the help.
12 years ago
Hey thanks! I've never worked with sets before.

In order to get both points I figured I had to create 2 separate sets.



I got it going converting 2 single arrays into an array of arrays:


Thanks a ton, if you know how to make this more efficient I'm all ears.

12 years ago
I want to come up with a 2D array of points that each POINT is an individual. So there are no duplicate points, if there is a cleaner way of simply removing those points and shrinking that Array I would like to do that.

(by POINT I mean, both [x][y] are not the same as any other [x][y])

Ultimate Goal:
- Create a 2D array that contains no duplicate points.
12 years ago
I'm importing a txt file, and then filling the 2D array with the points, all that is working fine. I can't for the life of me get it working where I can find duplicate points and then basically create a new array with only single points, no duplicates.

Since they're coordinates I only want to remove a duplicate POINT, so both X and Y have to match. If only X or only Y match, the points should stay.

I'm using the processing IDE.


12 years ago