34 lines
795 B
JavaScript
34 lines
795 B
JavaScript
import Agent from '../objects/Agent.js';
|
|
|
|
var regaly = ['1-1', '1-3', '1-4', '1-6', '1-7', '1-9', '2-1', '2-9', '3-3', '3-4', '3-6', '3-7', '4-1', '4-9', '5-1', '5-3', '5-4', '5-6', '5-7', '5-9']
|
|
|
|
function start(){
|
|
ponumerujPola();
|
|
pokolorujRegaly();
|
|
umiescAgenta();
|
|
}
|
|
|
|
function pokolorujRegaly(){
|
|
let x;
|
|
for(x = 0; x < regaly.length; x++){
|
|
document.getElementById(regaly[x]).className = 'regal';
|
|
}
|
|
}
|
|
|
|
function ponumerujPola(){
|
|
let x,y
|
|
for(x = 0; x < 7; x++){
|
|
for(y = 0; y < 11; y++){
|
|
id = x.toString() + "-" + y.toString();
|
|
document.getElementById(id).innerHTML = id;
|
|
}
|
|
}
|
|
}
|
|
|
|
function umiescAgenta() {
|
|
const agent = new Agent(3, 0);
|
|
id = agent.getid();
|
|
document.getElementById(id).className = 'regal';
|
|
}
|
|
|