Generate a 40x24 map
Fill the entire map with a wall
Place a random number (5-10) of rectangular “rooms” with random sizes (3 - 8 cells in length and width)
Place a random number (3 - 5 in each direction) of vertical and horizontal passages with a width of 1 cell
Place swords (2 pcs) and health potions (10 pcs) in empty places
Place the hero in a random empty place
Place 10 opponents with random empty spaces
Make it possible to move the hero with the WASD keys (left-up-down-right)
Make it possible to attack with the spacebar ALL opponents located on neighboring cells
Make the hero attack the opponent if the hero is on the next cell with the opponent
Make random movement of opponents (to choose from, either moving along one random axis, or a random direction each turn, or searching and attacking the hero)
Make health recovery when the hero attacks the health potion (and removing the potion)
Make an increase in the hero's strike force when the hero steps on the sword (and removes the sword)
Should be triggered by opening a file index.html in the browser (without a server)
There should be no unreachable zones
HTML, CSS, JavaScript, JQuery.