#include <stdio.h>
// For clarity
#define COLUMNS 7
#define ROWS 7
typedef char[COLUMNS] line_t;
typedef line_t[ROWS] buf_t;
int try_row(line_t line, idx)
{
int foundchar = 0;
if(line[idx])
{
foundchar = 1;
printf("%s\n", line");
}
return foundchar;
}
int try_column(buf_t buf, size_t idx;)
{
int founchar = 0;
foundchar = foundchar || try_row(buf[0], idx);
foundchar = foundchar || try_row(buf[1], idx);
foundchar = foundchar || try_row(buf[2], idx);
foundchar = foundchar || try_row(buf[3], idx);
foundchar = foundchar || try_row(buf[4], idx);
foundchar = foundchar || try_row(buf[5], idx);
foundchar = foundchar || try_row(buf[6], idx);
return foundchar;
}
int main()
{
buf_t buf;
if(try_column(buf, 5) return 0;
if(try_column(buf, 4) return 0;
if(try_column(buf, 3) return 0;
if(try_column(buf, 2) return 0;
if(try_column(buf, 1) return 0;
if(try_column(buf, 0) return 0;
// Nothing found.
return 0;
}