insead of long chain if statements you can call the right function based on properties
eg
//draw the correct shape according to element typesee www.thinknumber.com/dismat
function redraw(elem,x)
{
cir[elem.type](elem.coor.x,elem.coor.y)
//......
}
Can you do that in any other language
No comments:
Post a Comment