/***************************************

                  OptimA
           last update 10/07/87
      AMIGA-Version by Frank Kremser
PC-Original-Version by Dr. Edgar Huckent
       (C) 1987  by Markt & Technik

****************************************

Soluzione A per problemi di Editor
Soluzione standard tramite printf

***************************************/

#include <stdio.h>

#define BELL  0x07

/* Output della riga in modo positivo o inverso */
void showline(xp,yp,zadr,attrib)
int xp,yp;
char *zadr;
int attrib;
{
  if (attrib) printf("\033[%d;%dH\033[7m%s\033[0m",yp+1,xp+1,zadr);
  else        printf("\033[%d;%dH%s",yp+1,xp+1,zadr);
}   /* end showline */

void main()
{
  int n,ypos,attrib;

  ypos = 0;
  printf("\033[2J");   /* clear screen */
  putchar(BELL);
  for (n=0; n < 200; n++)
    {
     if (++ypos >= 23) ypos = 0;
     if (ypos % 2) attrib = 1;
     else          attrib = 0;
     showline(0,ypos,
       "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
     attrib);
    }
  putchar(BELL);
  printf("\033[2J\n\n");
}   /* end main */
