11-12-2023, 06:33 AM
Would this little method basically be what you're looking for?
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 matches.
Code: (Select All)
CONST 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
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 matches.