java
最后编辑: 2020-03-12
public classGame {Current position应该设置为飞船类的一个属性。
A B 各是一个飞船类的实例。
实际上还有个Planet class, 列出9个行星的名字。Current position可以设计为一个enum, 列出那些行星。
没有设静态啊别把currentPosition设置成静态变量就好了。
没懂这个设计有点问题
Array是reference type. 两个地方改动,会冲突,不要改动它。
你要给AB分别一个位置数字,用数字去决定planet名字就可以了。
急啊,三个晚上2点睡了。这孩子看的让人着急啊
比很多学生强 哈哈这孩子看的让人着急啊
A Planet which is where the spaceship is (the current planet)private Planete currentPlanet
大概改成private int currentPlanet