Hong-Phuc Bui
2024-10-16 f8613c9ce2bd4b74b11727d2eae204f49151bcba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * dice-simulation.js
 *
 */
 
import {terminal} from "./dfhi.js";
 
/**
 * Simulation eines Würfel
 * */
window.main = function(...argv) {
    const IMG_DIR = "./dice-simulation/assert";
 
    let min = 1;
    let max = 6;
 
    let face = Math.floor(Math.random() * (max - min + 1) + min );
    let path = `${IMG_DIR}/${face}.png`;
    let img = `<img width="20px" src="${path}" />`;
    terminal.clear();
    terminal.printh(img);
};