program Texty;
@projectsettings "system" "C128"

var  
	// Define four variables : position x, position y, time and a counter i
   x,y,time,i: byte = 0;  


begin



 	// First, fill color ram with white
	ClearScreen(white, screen_col_loc);
	// Set black border
	screen_bg_col:=black;
	// infinite loop
	while (true) do
	begin
		// Make sure we wait for 1 raster cycle to complete
		waitforverticalblank(); 
	
		// Clear screen with character $20 (space)
		ClearScreen(key_space, screen_char_loc);
		// Calculate x,y some sine values (making a circle)
		// if sine[x] then sine[x+64] is equal to cosine  
		x:=sine[time]/12 + 6;		
		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+=1;
	end;

end.
