void v_putpart3()
{
if(nxtshape==0){
Temp=0;
putelement(virtual,v_posn_i-1,v_posn_j-1);
putelement(virtual,v_posn_i-1,v_posn_j);
putelement(virtual,v_posn_i-1,v_posn_j+1);
putelement(virtual,v_posn_i,v_posn_j+1);
}
else if(nxtshape==1){
Temp=0;
putelement(virtual,v_posn_i,v_posn_j-1);
putelement(virtual,v_posn_i-1,v_posn_j-1);
putelement(virtual,v_posn_i-2,v_posn_j-1);
putelement(virtual,v_posn_i-2,v_posn_j);
}
else if(nxtshape==2){
Temp=0;
putelement(virtual,v_posn_i-1,v_posn_j-1);
putelement(virtual,v_posn_i,v_posn_j-1);
putelement(virtual,v_posn_i,v_posn_j);
putelement(virtual,v_posn_i,v_posn_j+1);
}
else if(nxtshape==3){
Temp=0;
putelement(virtual,v_posn_i,v_posn_j-1);
putelement(virtual,v_posn_i,v_posn_j);
putelement(virtual,v_posn_i-1,v_posn_j);
putelement(virtual,v_posn_i-2,v_posn_j);
}
}
void putpart4() /*此函数功能:根据全局变量shape的值画出相应的形状*/
{ /*此函数并不对移动后的合法性做判断,这个在调用的时候判断*/
/*参量ischange的值仅仅是1或0,用于判断是否改变形状*/
if(formershape==0 || formershape==2){ /*擦掉以前的东西*/
Temp=0;
putelement(bkclr,formerposn_i-1,formerposn_j-1);
putelement(bkclr,formerposn_i-1,formerposn_j);
putelement(bkclr,formerposn_i,formerposn_j);
putelement(bkclr,formerposn_i,formerposn_j+1);
}
else if(formershape==1 || formershape==3){
Temp=0;
putelement(bkclr,formerposn_i,formerposn_j-1);
putelement(bkclr,formerposn_i-1,formerposn_j-1);
putelement(bkclr,formerposn_i-1,formerposn_j);
putelement(bkclr,formerposn_i-2,formerposn_j);
}
if(shape==0 || shape==2){ /*写入新的东西*/
Temp=0;
putelement(element_clr,posn_i-1,posn_j-1);
putelement(element_clr,posn_i-1,posn_j);
putelement(element_clr,posn_i,posn_j);
putelement(element_clr,posn_i,posn_j+1);
}
else if(shape==1 || shape==3){
Temp=0;
putelement(element_clr,posn_i,posn_j-1);
putelement(element_clr,posn_i-1,posn_j-1);
putelement(element_clr,posn_i-1,posn_j);
putelement(element_clr,posn_i-2,posn_j);
}
}
void v_putpart4()
{
if(nxtshape==0 || nxtshape==2){
Temp=0;
putelement(virtual,v_posn_i-1,v_posn_j-1);
putelement(virtual,v_posn_i-1,v_posn_j);
putelement(virtual,v_posn_i,v_posn_j);
putelement(virtual,v_posn_i,v_posn_j+1);
}
else if(nxtshape==1 || nxtshape==3){
Temp=0;
putelement(virtual,v_posn_i,v_posn_j-1);
putelement(virtual,v_posn_i-1,v_posn_j-1);
putelement(virtual,v_posn_i-1,v_posn_j);
putelement(virtual,v_posn_i-2,v_posn_j);
}
}
void putpart5() /*此函数功能:根据全局变量shape的值画出相应的形状*/
{ /*此函数并不对移动后的合法性做判断,这个在调用的时候判断*/
/*参量ischange的值仅仅是1或0,用于判断是否改变形状*/
if(formershape==0 || formershape==2){ /*擦掉以前的东西*/
Temp=0;
putelement(bkclr,formerposn_i,formerposn_j-1);
putelement(bkclr,formerposn_i,formerposn_j);
putelement(bkclr,formerposn_i-1,formerposn_j);
putelement(bkclr,formerposn_i-1,formerposn_j+1);
}
else if(formershape==1 || formershape==3){
Temp=0;
putelement(bkclr,formerposn_i-2,formerposn_j);
putelement(bkclr,formerposn_i-1,formerposn_j);
putelement(bkclr,formerposn_i-1,formerposn_j+1);
putelement(bkclr,formerposn_i,formerposn_j+1);
}
if(shape==0 || shape==2){ /*写入新的东西*/
Temp=0;
putelement(element_clr,posn_i,posn_j-1);
putelement(element_clr,posn_i,posn_j);
putelement(element_clr,posn_i-1,posn_j);
putelement(element_clr,posn_i-1,posn_j+1);
}
else if(shape==1 || shape==3){
Temp=0;
putelement(element_clr,posn_i-2,posn_j);
putelement(element_clr,posn_i-1,posn_j);
putelement(element_clr,posn_i-1,posn_j+1);
putelement(element_clr,posn_i,posn_j+1);
}
}
|