"The North Remembers" - or the html boilerplate (if you have no source-code editor)

The boilerplate is something everyone needs and, at least I, never remembers. So for all the times I do not want to search for it while not using a source-code editor, I am posting it here.

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>title</title>

</head>

<body>

</body>

</html>

My first javascript ... thing

After few days of course and at least 2 monts of watching how other people are writing apps in js, I am going somewhere. It is not much, and it is only a part of the dice roll, BUT, but - it is working and the whole thing for, lets say, RPGs will be here :)

My teacher for js is Colt Steele and I am going through his full web dev bootcamp on Udemy.

const d6 = Math.floor(Math.random() * 6) +1;

d6;

That is for a six-sided die.

First we need to set the variable name (here it is const d6 ) and give it value. Value here is a math object - Math.[property or method].

The method we give here first is floor to remove decimal. Next is Math.random() to... randomize :)

We choose the amount of numbers we want to have access to (here for a d6 is 6: 1-6), so we multiply the result by 6: * 6

Last we need to add 1, because the indexing starts with 0, so: + 1 and we close with ;

Now we can call it with d6; and get the result.

This is just vanila js, and needs to be implemented, so we do not have to run it from the console. This is coming :D