console.log('hello, developer!')
const form = document.getElementById('form')
form.addEventListener('submit', function(e) {
// stopper nettsiden fra å laste inn på nytt
e.preventDefault()
console.log('', Sum_av_tretti_seks)
var Sum_av_tretti_seks = 0
var melding = "Du får ressurser "
var melding2 = " av 36 kast. We hope you enjoyed CatanMath, if you wanna use it online we recommend:"
const tall2 = document.getElementById('tall2').value
const tall1 = document.getElementById('tall1').value
const tall3 = document.getElementById('tall3').value
console.log(tall1)
var muligheter = []
for (var i = 1; i < 7; i++) {
for (var n = 1; n < 7; n++) {
muligheter.push(i, n);
if ((i + n == tall1) || (i + n == tall2) || (i + n == tall3)) {
Sum_av_tretti_seks += 1
}
}
}
//console.log(x)
const output = document.getElementById('output')
//output.innerHTML = 'Du fikk ', (Sum_av_tretti_seks), "ut av 36"
document.write(melding)
document.write(Sum_av_tretti_seks)
document.write(melding2)
})
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.