(11-12-2023, 06:33 AM)SMcNeill Wrote: Would this little method basically be what you're looking for?
Code: (Select All)It counts the matches for each column and then shows the total at the bottom. All you'd have to do at this point is just search for the highest value and then display those that have that number of matchCONST columns = 20, rows = 10
DIM a(1 TO rows) AS STRING
FOR i = 1 TO rows
FOR j = 1 TO columns
IF INT(RND * 2) THEN a(i) = a(i) + "*" ELSE a(i) = a(i) + "-"
NEXT
PRINT a(i)
NEXT
DIM matches(columns)
FOR i = 1 TO rows
FOR j = 1 TO columns
IF MID$(a(i), j, 1) = "*" THEN matches(j) = matches(j) + 1
NEXT
NEXT
FOR i = 1 TO columns '
PRINT _TRIM$(STR$(matches(i)));
NEXT
Thanks for the reply.
This is very similar to my initial attempt but I need something more exhaustive. It seems logical that the columns with the most
occurrences would also produce the most horizontal matches but I am not sure that's the case. It's the horizontal matches that
interest me the most. The file I linked is a small sample and while the columns will always equal 112 the number of lines can
be several thousand. I thought about using a brute force method but the number of permutations put the breaks on that idea.
Something like 10^23. I will say that you code makes mine look like crap so thanks, I will use it as my base and try to build on
it.
Thanks again
R1
Need custom sorting algorithm
|
|
« Next Oldest | Next Newest »
|
Users browsing this thread: 4 Guest(s)