Your browser lacks required capabilities. Please upgrade it or switch to another to continue.
Loading…
<div style="display: flex; justify-content: space-between">
<div style="flex-basis: 20%">Player: @@#pTotal;0@@</div>
<div style="flex-basis: auto">ROUND: @@#diceRound;1@@ / 6</div>
<div style="flex-basis: 20%">Opponent: @@#oTotal;0@@</div>
</div>
<hr><br>
<div id="content">
The player with the highest score in six rounds wins. Every round you throw the die and add the result to the potential total score for the round. If you throw a 1 you lose the points for the round. How many times in a row do you dare throw the die before you end the round?<br>
<br>
<div id="links">
<<currentPlayer>>
</div>
<hr>
<div id="output"></div>
</div><<widget "currentPlayer">>
<<set _currentPlayer to $args[0]>>
<<if not _currentPlayer>>
<<set _pTotal to 0>>
<<set _oTotal to 0>>
<<set _pRound to 0>>
<<set _oRound to 0>>
<<set _diceRound to 1>>
<<currentPlayer "player">>
<</if>>
<<if _diceRound lte 6>>
<<if _currentPlayer is "player">>
<<timed 0s>><<replace "#output">><</replace>><</timed>>
<<timed 0s>><<replace "#links">>
<<link "Throw die">>
<<set _pDice to random(1, 6)>>
<<if _pDice is 1>>
<<replace "#links">>
Throw dice —
<<link "End round">>
<<set _pRound to 0>>
<<set _oTurn to 0>>
<<currentPlayer "opponent">>
<br>
<</link>>
<</replace>>
<<replace "#output">>
You throw the die and roll a _pDice...<br>
You score nothing and lose the round.<br>
<</replace>>
<<else>>
<<set _pRound += _pDice>>
<<replace "#output">>
You throw the die and roll a _pDice.<br>
Your round score is currently _pRound.<br>
<</replace>>
<</if>>
<</link>>
—
<<link "End round">>
<<replace "#links">>Throw die — End round<</replace>>
<<set _pTotal += _pRound>>
<<replace "#output">>
You decide to end the round.<br>
You add _pRound point to your total score!<br>
You hand the die over to your opponent.<br>
<</replace>>
<<timed "3000ms">>
<<set _pRound to 0>>
<<set _oTurn to 0>>
<<replace "#pTotal">>_pTotal<</replace>>
<<currentPlayer "opponent">>
<</timed>>
<br>
<</link>>
<br>
<</replace>><</timed>>
<<elseif _currentPlayer is "opponent">>
<<timed 0s>><<replace "#links">>Opponent throws die<</replace>><</timed>>
<<set _oDice to random(1, 6)>>
<<set _oTurn++>>
<<if _oDice is 1>>
<<timed 0s>><<replace "#output">>
<<timed "1000ms">>
Your opponent rolls a _oDice...<br>
They score nothing and lose the round.<br>
<</timed>>
<<timed "3000ms">>
<<if _diceRound lt 6>>
They reluctantly hand the die over to you.<br>
<<else>>
They end their round. That concludes the game.<br>
<</if>>
<</timed>>
<</replace>><</timed>>
<<timed "5000ms">>
<<set _diceRound += 1>>
<<set _oRound to 0>>
<<replace "#diceRound">><<= _diceRound.clamp(1,6) >><</replace>>
<<currentPlayer "player">>
<</timed>>
<<else>>
<<set _oRound += _oDice>>
<<if (_diceRound is 6 && (_oRound + _oTotal) > _pTotal) || (_diceRound lt 6 && (_oTurn gt 5 || _oRound gt 18))>>
<<set _diceRound += 1>>
<<set _oTotal += _oRound>>
<<timed 0s>><<replace "#output">>
<<timed "1000ms">>
Your opponent rolls a _oDice.<br>
Their round score is currently _oRound!<br>
<</timed>>
<<timed "3000ms">>
<<if _diceRound lt 6>>
They decide to end their round and hand over the die.<br>
<<else>>
They decide to end their round. That concludes this game.<br>
<</if>>
<</timed>>
<</replace>><</timed>>
<<timed "5000ms">>
<<set _oRound to 0>>
<<replace "#diceRound">><<= _diceRound.clamp(1,6) >><</replace>>
<<replace "#oTotal">>_oTotal<</replace>>
<<currentPlayer "player">>
<</timed>>
<<else>>
<<timed 0s>><<replace "#output">>
<<timed "1000ms">>
Your opponent rolls a _oDice.<br>
Their round score is currently _oRound.<br>
<</timed>>
<<timed "3000ms">>
They decide to throw the die again.<br>
<</timed>>
<</replace>><</timed>>
<<timed "5000ms">>
<<currentPlayer "opponent">>
<</timed>>
<</if>>
<</if>>
<br>
<</if>>
<<else>>
<<timed 1s>><<replace "#content">>
The game has ended.<br>
The player's total score is: _pTotal<br>
The opponent's total score is: _oTotal<br>
<br>
The winner is <<if _pTotal > _oTotal>>''the player''<<else>>''the opponent''!<</if>><br>
<br>
<center>
<<button 'RESTART'>>
<<script>>Engine.restart();<</script>>
<</button>>
</center>
<</replace>>
<</timed>>
<</if>>
<</widget>><center>
<h1>Greedy pig / Giriga grisen</h1>
<h4>Tomas Jelf Werner 2019</h4>
<br>
<<button "Svenska">>
<<goto "SV_Greedy pig">>
<</button>>
—
<<button "English">>
<<goto "EN_Greedy pig">>
<</button>>
</center><div style="display: flex; justify-content: space-between">
<div style="flex-basis: 20%">Spelaren: @@#pTotal;0@@</div>
<div style="flex-basis: auto">Runda: @@#diceRound;1@@ / 6</div>
<div style="flex-basis: 20%">Motståndaren: @@#oTotal;0@@</div>
</div>
<hr><br>
<div id="content">
Spelaren med den högsta poängen efter sex rundor vinner. Varje runda slår du med tärningen och adderar resultatet till rundans möjliga totalpoäng. Om du slår 1 förlorar du rundans poäng. Hur många gånger på rad vågar du slå med tärningen innan du avslutar rundan och säkrar poängen?<br>
<br>
<div id="links">
<<aktuellSpelare>>
</div>
<hr>
<div id="output"></div>
</div><<widget "aktuellSpelare">>
<<set _aktuellSpelare to $args[0]>>
<<if not _aktuellSpelare>>
<<set _pTotal to 0>>
<<set _oTotal to 0>>
<<set _pRound to 0>>
<<set _oRound to 0>>
<<set _diceRound to 1>>
<<aktuellSpelare "player">>
<</if>>
<<if _diceRound lte 6>>
<<if _aktuellSpelare is "player">>
<<timed 0s>><<replace "#output">><</replace>><</timed>>
<<timed 0s>><<replace "#links">>
<<link "Slå tärningen">>
<<set _pDice to random(1, 6)>>
<<if _pDice is 1>>
<<replace "#links">>
Slå tärningen —
<<link "Avsluta din tur">>
<<set _pRound to 0>>
<<set _oTurn to 0>>
<<aktuellSpelare "enemy">>
<br>
<</link>>
<</replace>>
<<replace "#output">>
Du slår med tärningen och får _pDice...<br>
Du får inga poäng och förlorar rundan.<br>
<</replace>>
<<else>>
<<set _pRound += _pDice>>
<<replace "#output">>
Du slår med tärningen och får _pDice.<br>
Din poäng denna runda är nu _pRound.<br>
<</replace>>
<</if>>
<</link>>
—
<<link "Avsluta din tur">>
<<replace "#links">>Slå tärningen — Avsluta din tur<</replace>>
<<set _pTotal += _pRound>>
<<replace "#output">>
Du bestämmer dig för att avsluta din tur.<br>
Du lägger till _pRound poäng till din totalpoäng!<br>
Du lämnar över tärningen till din motståndare.<br>
<</replace>>
<<timed "3000ms">>
<<set _pRound to 0>>
<<set _oTurn to 0>>
<<replace "#pTotal">>_pTotal<</replace>>
<<aktuellSpelare "enemy">>
<</timed>>
<br>
<</link>>
<br>
<</replace>><</timed>>
<<elseif _aktuellSpelare is "enemy">>
<<timed 0s>><<replace "#links">>Motståndaren slår tärningen<</replace>><</timed>>
<<set _oDice to random(1, 6)>>
<<set _oTurn++>>
<<if _oDice is 1>>
<<timed 0s>><<replace "#output">>
<<timed "1000ms">>
Din motståndare slår _oDice...<br>
De får inga poäng och förlorar rundan..<br>
<</timed>>
<<timed "3000ms">>
<<if _diceRound lt 6>>
De lämnar motvilligt över tärningen till dig.<br>
<<else>>
De avslutar sin tur. Spelet är nu slut.<br>
<</if>>
<</timed>>
<</replace>><</timed>>
<<timed "5000ms">>
<<set _diceRound += 1>>
<<set _oRound to 0>>
<<replace "#diceRound">><<= _diceRound.clamp(1,6) >><</replace>>
<<aktuellSpelare "player">>
<</timed>>
<<else>>
<<set _oRound += _oDice>>
<<if (_diceRound is 6 && (_oRound + _oTotal) > _pTotal) || (_diceRound lt 6 && (_oTurn gt 5 || _oRound gt 18))>>
<<set _diceRound += 1>>
<<set _oTotal += _oRound>>
<<timed 0s>><<replace "#output">>
<<timed "1000ms">>
Din motståndare slår _oDice.<br>
Deras poäng för rundan är nu _oRound!<br>
<</timed>>
<<timed "3000ms">>
<<if _diceRound lt 6>>
De bestämmer sig för att avsluta sin tur och lämna över tärningen.<br>
<<else>>
De bestämmer sig för att avsluta sin tur. Spelet är slut..<br>
<</if>>
<</timed>>
<</replace>><</timed>>
<<timed "5000ms">>
<<set _oRound to 0>>
<<replace "#diceRound">><<= _diceRound.clamp(1,6) >><</replace>>
<<replace "#oTotal">>_oTotal<</replace>>
<<aktuellSpelare "player">>
<</timed>>
<<else>>
<<timed 0s>><<replace "#output">>
<<timed "1000ms">>
Din motståndare slår _oDice.<br>
Deras poäng för rundan är nu _oRound.<br>
<</timed>>
<<timed "3000ms">>
De bestämmer sig för att slå igen.<br>
<</timed>>
<</replace>><</timed>>
<<timed "5000ms">>
<<aktuellSpelare "enemy">>
<</timed>>
<</if>>
<</if>>
<br>
<</if>>
<<else>>
<<timed 1s>><<replace "#content">>
Spelet är slut.<br>
Spelarens totalpoäng är: _pTotal<br>
Motståndarens totalpoäng är: _oTotal<br>
<br>
Vinnaren är <<if _pTotal > _oTotal>>''spelaren''<<else>>''motståndaren''!<</if>><br>
<br>
<center>
<<button 'SPELA IGEN'>>
<<script>>Engine.restart();<</script>>
<</button>>
</center>
<</replace>>
<</timed>>
<</if>>
<</widget>><div id="splash" data-passage="Splash"></div>
<div id="passages"></div><div id="splash">
BETA REL.<br>
<div class="scaling-svg-container" style="padding-bottom: 0">
<<include "magister52logo.svg">>
</div>
<div id="loading" class="blink">
<<print either(
"Regular loading expression...",
"Weighting the die...",
"This is not the game you're looking for...",
"¯\\\_(ツ)_/¯"
)>>
</div>
</div>/* THE ENTIRE SVG LOGO IN INLINE FORMAT WITH CSS CLASS BELOW */
<svg class="scaling-svg" viewBox="0 0 150 150"><g transform="translate(-30 -73)"><circle cy="149" cx="105" r="72" style="fill:#f4f7da;stroke-width:4;stroke:#9f0000"/><text y="184" x="49" style="fill:#9f0000;font-family:sans-serif;font-size:22px;letter-spacing:0px;line-height:130%;stroke-width:0.5px;word-spacing:0px"><tspan x="49" y="184"><tspan y="184" x="49" style="font-family:sans-serif;font-size:100px;font-weight:bold;line-height:130%;stroke-width:0.5px"> 52</tspan></tspan></text><rect height="23" width="120" y="135" x="45" fill="#f4f7da"/><text transform="scale(0.95 1.05)" y="148" x="51" style="fill:#9f0000;font-family:sans-serif;font-size:29px;letter-spacing:0px;line-height:130%;stroke-width:0.7;word-spacing:0px"><tspan x="51" y="148" stroke-width="0.7"><tspan y="148" x="51" style="font-family:sans-serif;font-size:23px;font-weight:bold;stroke-width:0.7"> MAGISTER</tspan></tspan></text></g></svg> <<if tags().includes("en")>>
<center>
<<link 'Restart'>>
<<script>>Engine.restart();<</script>>
<</link>>
<hr>
</center>
<<elseif tags().includes("sv")>>
<center>
<<link 'Starta om'>>
<<script>>Engine.restart();<</script>>
<</link>>
<hr>
</center>
<</if>>