program Texty;

@projectsettings "petmodel" "8032"

var  
	// Define four variables : position x, position y, time and a counter i
   x,y,time,i: byte = 0;  
begin
	moveto(0,0,hi(screen_char_loc));
	// infinite loop
	ClearScreen($20, screen_char_loc);
	while (true) do
	begin
		for i:=0 to 200 do wait(20);
		
		printstring("                ",0,40);

		// Calculate x,y some sine values (making a circle)
		// if sine[x] then sine[x+64] is equal to cosine  
		x:=sine[time]/6 + 12;		
		y:=sine[time+64]/16 + 4;		
		// move "screenmemory" cursor to x,y at screen memory $0400
		moveto(x,y,hi(screen_char_loc));
		
		i:=time/64; // i will now have values between 0 and 3 (since time is between 0 and 255)
		// Print some random string
		case i of
			0:	printstring("I AM FISH",0,40);
			1:	printstring("ARE YOU FISH",0,40);
			2:	printstring("ME AM CAT",0,40);
			3:	printstring("OM NOM NOM",0,40);
		end;
		// Increase the timer
		time:=time+1;
	end;

end.
