// ~cs35/win_1.cpp    More graphics; to show blinking and movement.

#include "CS35win.h"
int main ()
{
	const int MAXL = 80;
	int counter, y, length, i;
	char name[MAXL];
	char  ch;
	double time = .3;
		
	beginwin();
	
	move (2,1);
	addstr("You are now in grafix-land.");
	move (4,1);
	addstr ("What is your name? ");
	getstr (name);
	length = strlen(name);
	
	move (6,1);
	addstr ("Welcome, ");
	
	counter = 0;
	while (counter < 10)
	{
		move (6, 10);
		addstr (name);
		move (23,0);
		refresh();
		hesitate (time);
		move (6, 10);
		for (i = 0; i < length; i++) addch(' ');
		move (23,0);
		refresh();
		hesitate (time);
		counter++;
	}

	y = 5;
	while (y < 20)
	{
		time = time*.9;
		move (y, 10);
		addstr (name);
		move (23,0);
		refresh();
		hesitate (time);
		move (y, 10);
		for (i = 0; i < length; i++) addch(' ');
		move (23,0);
		refresh();
		hesitate (time);
		y++;
	}

	move (22, 1);
	addstr ("Hit \"Return\" to end program: ");
	getch();
	endwin();
	return 0;
}

