[metapost] Unable to figure out "if"

Karel akk64 at quick.cz
Wed Aug 8 10:20:31 CEST 2012


Hello,
logical statements should be separated and the value of numeric 
anta cannot be changed by another equality. The following works:

beginfig ( 1 ) ;
  for i = -60 step 10 until 61 : anta:=
  	if (i > -31) and (i < 31) : 70 ;
  	else : 60 ;
	fi ;
	draw ( -anta, i ) -- ( anta, i ) ;
  	draw ( i, -anta ) -- ( i, anta ) ;
  endfor ;
  endfig ;
  end ;

Karel



More information about the metapost mailing list