Jojoxx.net logotyp

 

 

Användare ikonAnvändare
Besökare just nu: 38
Snabblänkar ikonSnabblänkar
JavaScript-arkivet
Perl
FAQ

Sök på Jojoxx.net


Maxi Yatzy formulär

Exempel

Maxi Yatzy

Kod


<style type="text/css">
.yatzycell { height:20px; border-right:solid black 1px; border-bottom: solid black 1px; }
.yatzyheading { font-weight: bold; border-bottom: solid black 2px; border-right:solid black 1px; }
.yatzyMax { color:rgb(100,100,100); }
</style>
<h4>Maxi Yatzy</h4>
<table cellspacing="0" style="font-family:Verdana; font-size:10px; border: solid black 2px;">
<script type="text/javascript">
var visaMax=true;
var players=6;
var field=[
	{ name:"Ettor", max:6 },
	{ name:"Tvåor", max:12 },
	{ name:"Treor", max:18 },
	{ name:"Fyror", max:24 },
	{ name:"Femor", max:30 },
	{ name:"Sexor", max:36 },
	{ name:"Summa", style:"font-weight:bold;border-top:solid black 1px;border-bottom:solid black 2px;" },
	{ name:"Bonus", max:100 },
	{ name:"Ett par", max:12 },
	{ name:"Två par", max:22 },
	{ name:"Tre par", max:30 },
	{ name:"Tretal", max:18 },
	{ name:"Fyrtal", max:24 },
	{ name:"Femtal", max:30 },
	{ name:"Liten straight", max:15 },
	{ name:"Stor straight", max:20 },
	{ name:"Full straight", max:21 },
	{ name:"Kåk (2+3)", max:28 },
	{ name:"Hus (3+3)", max:33 },
	{ name:"Torn (2+4)", max:34 },
	{ name:"Chans", max:36 },
	{ name:"Maxi Yatzy", max:100 },
	{ name:"Summa", style:"font-weight:bold;border-top:solid black 1px;border-bottom:solid black 2px;" }
];

document.write("<tr><td class=\"yatzyheading\">Spelare</td>");
if(visaMax){ document.write("<td class=\"yatzyheading yatzyMax\" style=\"text-align:center;\">Maxpoäng</td>"); }
for(var p=0;p<players;p++){
	document.write("<td class=\"yatzyheading\"> </td>");
}
document.write("</tr>");
var totalSumma=0;
for(var i in field){
	document.write("<tr><td class=\"yatzycell\" style=\""+field[i].style+" width:80px;\">"+field[i].name+"</td>");
	totalSumma+=(field[i].max)?field[i].max:0;
	if(visaMax){ document.write("<td class=\"yatzycell yatzyMax\" style=\""+field[i].style+" width:80px;text-align:center;\">"+((field[i].max)?field[i].max:totalSumma)+"</td>"); }
	for(var p=0;p<players;p++){
		document.write("<td class=\"yatzycell\" style=\""+field[i].style+" width:50px;\"> </td>");
	}
	document.write("</tr>");
}
</script>
</table>

Kommentar

Scriptet genererar en enkel Maxi Yatzy plan. Bara att skriva ut och spela.

,