All pastes #903863 Raw Edit

Something

public text v1 · immutable
·published 2008-02-14 15:25 UTC
rendered paste body
#include <ncurses.h>
#include <stdio.h>


char a[3][3];



int
main ()
{

  int time, n = 1, b;
  
  initscr ();
  cbreak ();
  noecho ();

  for (time = 0; time < 3; time++)
    {
      b = getch ();
      if (b==KEY_DOWN && n == 1)
	{
	  a[time][1] = '*';
	  n = 0;
	  printw ("%c\n", a[time][1]);
	  sleep (400);
	}
      else if (b==KEY_DOWN && n == 0)
	{
	  system ("clear");
	  a[time - 1][1] = ' ';
	  a[time][1] = '*';
	  printw ("%c\n", a[time][1]);
	  sleep (400);
	}
    }

}