gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under
the git version control system
a5e8a1574e305c25da47fc73967029f737240d43
2 public final static int IZLAZ
= -99;
3 public final static int ZID
= -11;
4 public final static int ERROR
= Integer
.MIN_VALUE
;
6 private int visina
, sirina
;
8 private boolean[][] pos
;
10 public int getSirina() {
14 public int getVisina() {
18 public void setPos(int x
, int y
, boolean b
) {
19 if (0 <= x
&& x
< sirina
&& 0 <= y
&& y
< visina
) {
24 public boolean getPos(int x
, int y
) {
25 if (0 <= x
&& x
< sirina
&& 0 <= y
&& y
< visina
) {
32 public int getMat(int x
, int y
) {
33 if (0 <= x
&& x
< sirina
&& 0 <= y
&& y
< visina
) {
40 public Mapa(int sirina
, int visina
) {
43 mat
= new int[sirina
][visina
];
44 pos
= new boolean[sirina
][visina
];
47 public static Mapa
ucitajIzFajla(String imeFajla
) {
48 if (!Svetovid
.testIn(imeFajla
)) {
52 int sirina
= Svetovid
.in(imeFajla
).readInt();
53 int visina
= Svetovid
.in(imeFajla
).readInt();
54 if (sirina
>= 0 && visina
>= 0) {
55 Mapa res
= new Mapa(sirina
, visina
);
56 for (int j
= 0; j
< visina
; j
++)
57 for (int i
= 0; i
< sirina
; i
++)
58 res
.mat
[i
][j
] = Svetovid
.in(imeFajla
).readInt();
59 Svetovid
.closeIn(imeFajla
);
62 Svetovid
.closeIn(imeFajla
);
67 public void stampaj() {
68 if (visina
!= 0 && sirina
!= 0) {
69 System
.out
.println(visina
+ " " + sirina
);
70 for (int j
= 0; j
< visina
; j
++) {
71 for (int i
= 0; i
< sirina
; i
++) {
72 System
.out
.print(mat
[i
][j
] + "\t");
Svarog.pmf.uns.ac.rs/gitweb
maintanance
Doni Pracner