Back to project page droidgol.
The source code is released under:
MIT License
If you think the Android project droidgol listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.rubyspa.droidgol; // w w w . ja v a2s .com import android.util.Pair; public class GamePrinter { public static String print(final Game game) { StringBuilder gamePrintout = new StringBuilder(); Pair<Integer,Integer> dimensions = game.dimensions(); for (int y = 1; y <= dimensions.second; y++) { for (int x = 1; x <= dimensions.first; x++) { if (game.stateAt(Pair.create(x, y)) == Boolean.TRUE) gamePrintout.append('o'); else gamePrintout.append(' '); } if (y < dimensions.second) gamePrintout.append('\n'); } return gamePrintout.toString(); } }