Skip to content

Instantly share code, notes, and snippets.

@AnnaBoro
Last active October 27, 2015 20:20
Show Gist options
  • Select an option

  • Save AnnaBoro/a0f9f343e179b545c699 to your computer and use it in GitHub Desktop.

Select an option

Save AnnaBoro/a0f9f343e179b545c699 to your computer and use it in GitHub Desktop.
lesson4-BattleField-Frame6
package lesson4;
/**
* Created by anna on 27.10.15.
*/
public class BattleField {
private int BF_WIDTH = 576;
private int BF_HEIGHT = 576;
private String[][] battleField = {
{"B", " ", "B", "B", "B", "B", "B", "B", "B"},
{"B", " ", " ", " ", " ", " ", " ", " ", "B"},
{"B", "B", " ", " ", "B", " ", " ", "B", "B"},
{"B", " ", "B", " ", " ", " ", "B", " ", "B"},
{"B", " ", "B", " ", " ", " ", " ", " ", "B"},
{" ", " ", " ", "B", " ", "B", " ", "B", "B"},
{" ", "B", " ", " ", " ", " ", " ", "B", "B"},
{" ", " ", " ", "B", "B", "B", " ", " ", "B"},
{"B", " ", " ", "B", " ", " ", " ", " ", "B"}};
public BattleField() {
}
public int getBF_WIDTH() {
return BF_WIDTH;
}
public int getBF_HEIGHT() {
return BF_HEIGHT;
}
public String scanQuadrant(int v, int h) {
return battleField[v][h];
}
public void updateQuadrant(int v, int h, String str) {
battleField[v][h] = str;
}
public int getDimensionX() {
return battleField[0][0].length();
}
public int getDimensionY() {
return battleField[0].length;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment