project "ex_pic"

global Predicates

 determ loadPic(string,integer,integer,integer,integer,integer,integer) 
	- (i,i,i,i,i,i,i) language c
   /* load_pic(FileName,StartRowPicFile,StartColPicFile,
		StartRowScreen,StartColScreen,NoofRows,NoofCols)
   */
 determ SavePic(string) - (i) language c

include "tdoms.pro"
include "tpreds.pro"

PREDICATES
  picture(string)        
    
GOAL
	picture(X),
	graphics(1,1,2),
	loadpic(X,0,0,0,0,200,320),readchar(_),
	graphics(1,1,3),
	write("\nPIC 1: Whole screen"),readchar(_),
	loadpic(X,0,0, 0,0,200,320),readchar(_),clearwindow,
	write("\nPIC 2: Upper Left Hand Corner "),readchar(_),
	loadpic(X,0,0, 0,0,100,160),readchar(_),clearwindow,
	write("\nPIC 3: Bottom Left Hand Corner "),readchar(_),
	loadpic(X,100,0, 100,0,100,160),readchar(_),clearwindow,
	write("\nPIC 4: Bottom Right Hand Corner "),readchar(_),
	loadpic(X,100,160,100,160,100,160),readchar(_),clearwindow,
	write("\nPIC 5: Upper Right Hand Corner "),readchar(_),
	loadpic(X,0,160, 0,160,100,160),readchar(_),clearwindow,
	write("\nPIC 6: Top Left Corner ===> Bottom Right Corner "),readchar(_),
	loadpic(X,0,0,100,160,100,160),readchar(_),clearwindow,
	write("\nPIC 7: Middle ===> Upper Left Hand\n                   Corner "),readchar(_),
	loadpic(X,50,80, 0,0,100,160),readchar(_),clearwindow,fail.

CLAUSES
  picture("Welcome.pic").
  picture("Test.pic").
