跪求各位Java大神帮忙翻译一下程序,写一下注释!!!谢谢! 10
只是推箱子的小人与箱子的移动算法:voidmoveup(){if(map[manY-1][manX]==2||map[manY-1][manX]==4){if(maptm...
只是推箱子的小人与箱子的移动算法:
void moveup()
{
if(map[manY-1][manX]==2||map[manY-1][manX]==4)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY-1][manX]=8;
repaint();manY--;mystack.push(10);
}
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
repaint();manY++;mystack.push(20);
}
else if(map[manY+1][manX]==3)
{
if(map[manY+2][manX]==4)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
map[manY+2][manX]=9;
repaint();manY++;mystack.push(21);
}
else if(map[manY+2][manX]==2)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
map[manY+2][manX]=3;
repaint();manY++;mystack.push(21);
}
else {map[manY][manX]=5;repaint();}
}
else if(map[manY+1][manX]==9)
{
if(map[manY+2][manX]==4)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
map[manY+2][manX]=9;
repaint();manY++;mystack.push(21);
}
else if(map[manY+2][manX]==2)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
map[manY+2][manX]=3;
repaint();manY++;mystack.push(21);
}
else {map[manY][manX]=5;repaint();}
}
else if(map[manY+1][manX]==1)
{
map[manY][manX]=5;repaint();
}
}
void backdown(int t)
{
int n=t;
if(n==20)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
{
map[manY][manX]=4;
}
else map[manY][manX]=2;
}
else if(n==21)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
{
map[manY][manX]=9;
}
else map[manY][manX]=3;
if(maptmp[manY+1][manX]==4||maptmp[manY+1][manX]==9)
{
map[manY+1][manX]=4;
}
else map[manY+1][manX]=2;
}
map[manY-1][manX]=5;
repaint();manY--;
这是java程序源代码,请大神帮忙解读一下,给点注释!! 展开
void moveup()
{
if(map[manY-1][manX]==2||map[manY-1][manX]==4)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY-1][manX]=8;
repaint();manY--;mystack.push(10);
}
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
repaint();manY++;mystack.push(20);
}
else if(map[manY+1][manX]==3)
{
if(map[manY+2][manX]==4)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
map[manY+2][manX]=9;
repaint();manY++;mystack.push(21);
}
else if(map[manY+2][manX]==2)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
map[manY+2][manX]=3;
repaint();manY++;mystack.push(21);
}
else {map[manY][manX]=5;repaint();}
}
else if(map[manY+1][manX]==9)
{
if(map[manY+2][manX]==4)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
map[manY+2][manX]=9;
repaint();manY++;mystack.push(21);
}
else if(map[manY+2][manX]==2)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
map[manY][manX]=4;
else map[manY][manX]=2;
map[manY+1][manX]=5;
map[manY+2][manX]=3;
repaint();manY++;mystack.push(21);
}
else {map[manY][manX]=5;repaint();}
}
else if(map[manY+1][manX]==1)
{
map[manY][manX]=5;repaint();
}
}
void backdown(int t)
{
int n=t;
if(n==20)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
{
map[manY][manX]=4;
}
else map[manY][manX]=2;
}
else if(n==21)
{
if(maptmp[manY][manX]==4||maptmp[manY][manX]==9)
{
map[manY][manX]=9;
}
else map[manY][manX]=3;
if(maptmp[manY+1][manX]==4||maptmp[manY+1][manX]==9)
{
map[manY+1][manX]=4;
}
else map[manY+1][manX]=2;
}
map[manY-1][manX]=5;
repaint();manY--;
这是java程序源代码,请大神帮忙解读一下,给点注释!! 展开
1个回答
展开全部
ALLOFME我的全部WhatwouldIdowithoutyoursmartmouth如果口齿伶俐的你不在,我该怎么Drawmein,andyoukickmeout你把我吸引过来,然后却要把我踢开Gotmyheadspinning,nokidding,Ican'tpinyoudown你让我头昏目眩,我不是在开玩笑,我根本无法阻止你What'sgoingoninthatbeautifulmind你那美丽的心灵到底在想什么?I'monyourmagicalmysteryride我正走在你魔幻又神秘的旅程中AndI'msodizzy,don'tknowwhatwl(这个词肯定是书写错误)me现在我很晕眩,不知道我这是怎么了butI'llbealright但我会好好儿的。最后的倒数第二句有一个词不清楚,所以我只是大概地猜测了一下,可能是don'tknowwhatiswrongwithme。希望能帮到你。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询