package com.test.pm;
import com.rosiminc.pm.game.PipesManiaGame;
import com.rosiminc.pm.game.Tile;
import java.io.*;
import java.util.Scanner;
public class TestMainApp01 {
private static String chars;
public static void main(String[] args)
{
PipesManiaGame game = new PipesManiaGame(5,10);
Tile[][] board = game.getBoard();
displayBoard(board);
}
private static void displayBoard(Tile[][] board) {
for(Tile[] tileArray: board)
{
System.out.println("");
for(Tile tile: tileArray)
{
System.out.print(" " + getTileString(tile));
}
}
}
private static char getTileString(Tile tile) {
int num = tile.getTileNumber();
if(chars == null)
createChars();
return chars.charAt(num);
}
private static void createChars() {
Scanner reader = null;
try {
reader = new Scanner(new FileInputStream(new File("Characters.txt")));
chars = reader.nextLine();
reader.close();
} catch (FileNotFoundException e) {
chars = "abcdefghijklmnop";
}
}
}