# How make coordinates from text at position 1,1 beter readable from program below.

Halo ? Can some person solve this.

question view of coordinates will be easier to read in this program below.

!*****************************************************
! choose point with the mouse and click to draw horse*
!*****************************************************
option nolet
set window 0,10,0,10
set color "green"
draw knight
do
set color "black"
get mouse x,y,s
pause .4
if s=2 then ! click mouse button
! plot text,at 1,1:str\$(x) & "," & str\$(y)
set color 15*rnd ! random color for the horse
draw bigknight(x,y,2,75)
! angle =75 degree
! scale= double
plot text,at 1,1:str\$(x) & "," & str\$(y) ! "problem here"
pause .7
end if
if key input then get key k
loop until k=27 ! use escape to exit
end

PICTURE Knight ! Picture of knight=horse
PLOT .2,.1;.8,.1;.8,.2;
PLOT .7,.25;.7,.3;.8,.4;.65,.7;.6,.9;.55,.9;
PLOT .5,.82;.2,.75;.2,.6;.3,.6;.4,.55;
PLOT .25,.45;.2,.37;.3,.3;.3,.25;.2,.2;.2,.1
END PICTURE

picture bigknight(x,y,v,r)
option angle degrees
! this sequention must be hold
draw knight with scale(v)*rotate(r)*shift(x,y)
!1e first scale.
!2e rotate scaled picture.
!3e rotate the scaled picture and the mouse shifted to
! a position and draw this picture with random color.
end picture

best regards

peter

### re:print coordinate position

box clear 1,3,1.5,1

before

plot text,at 1,1:str\$(x) & "," & str\$(y) ! "problem here"

You might also want to change

set color 15*rnd

to

set color 15*rnd + 2

so that the knight and text are not done in the background color '1' which is white.

If you want the text coordinates more easily visible--set the color to black just before the plot text statement--looks like you were going to do that and then commented it out.

This method could suffer from erasing over one of your drawn knights. You could narrow the box clear coordinates more to just erase the text.

I tried to print over the previous plot text with the same text in the background color. That worked sometimes and sometimes not. Below is the code for this, but the plot text in white doesn't seem to always fall exactly on top of the old printing--reason unknown.

option nolet
set window 0,10,0,10
set back "white" ! be sure background is white
set color "green"
draw knight
do
set color "black"
get mouse x,y,s
pause .4
if s=2 then ! click mouse button
! plot text,at 1,1:str\$(x) & "," & str\$(y)
kcolor = 15*rnd+2 !save the knight color
set color kcolor ! random color for the horse
draw bigknight(x,y,2,75)
! angle =75 degree
! scale= double
set color "white" ! set color white and print the previous coordinate (this will be blank the first time)
plot text,at 1,1:coord\$ ! This 'almost' erases the previous text, but not always??
set color "black" !makes text more readable
coord\$ = str\$(x) & "," & str\$(y) !save the text to plot in coord\$
plot text,at 1,1:coord\$ !
pause .7
end if
if key input then get key k
loop until k=27 ! use escape to exit
end