File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes Problem with loop in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Problem with loop in java" Watch "Problem with loop in java" New topic

Problem with loop in java

carlos novoa

Joined: Sep 02, 2013
Posts: 8
Good evening dear forum colleagues,
I have a problem with a loop. I am programming the movements of the horse in a loop in java.
I use the backtracking algorithm and the program works well and prints the whole board with all the movements.
I want to print the movement of the horse every time on the board with a new board each time but I dont know how to do it.
The array I use is tabla, this array comes from the method with the backtracking algorithm.

Any help will be appreciated.

The code I use is this:

public void escribirTablerofinal () {
int i = 0;
int j = 0;
for (i = 0; i < FILAS; i++) {
System.out.println(" -----------------------------------------");
for (j = 0; j < COLUMNAS; j++) {
if (tabla[i][j] > 9) {
System.out.print(" | " + tabla[i][j]);
else {
System.out.print(" | " + tabla[i][j] + " ");
System.out.println(" |");
System.out.println(" -----------------------------------------");
I agree. Here's the link:
subject: Problem with loop in java
It's not a secret anymore!