我在这个循环中犯了某种错误,我真的想不通。这是循环:
while (true) {
System.out.print(stepName[currentTick]);
for(int i = stepName[currentTick].length() - longestNameInt; i == 0; i--)
System.out.print(" ");
System.out.print(" [");
double percentCalc = (double) stepPercent[currentTick];
int slotsRep = (int) Math.round((percentCalc * 0.2));
for(int i = slotsRep; i == 0; i--)
System.out.print("*");
for(int i = 20 - slotsRep; i == 0; i--)
System.out.print(" ");
System.out.print("] " + stepPercent[currentTick] + "% \r");
if(currentTick == totalTicks)
break;
Thread.sleep(stepTime[currentTick]);
}
基本上,它只是快速打印'(First stepname) [*] 0%'。如果它非常明显,我很抱歉,但我有点菜鸟。:)
PS如果你需要更多我的课,请问我。