<<set $r1 to random(1,6)>>
<<if $r1 is 1>> Oof, you rolled $r1
You lose! [[restart?|start]] Or, stop [[here?|end]]
<<else>> $r1 ?
Nice! Roll [[again|r2]]?
Or, stop [[here|end]]
<</if>>
<<set $r2 to random(1,6)>><<if $r2 is 1>>
Oh no! you rolled a $r2! You lost all your points [[restart?|start]] Or, stop [[here?|end]]<<else>><<set $r2 to $r1+$r2>> $r2 ?!?!
Wow, you're on fire! [[roll again?|r3]],
Or, stop [[here|end]]
<</if>>
<<set $r3 to random(1,6)>><<if $r3 is 1>>Dang! lost your points. [[Restart?|start]] Or, stop [[here?|end]]<<else>><<set $r3 to $r2+$r3>>$r3 -- incredible. Let's [[see what your final score is|end]]
<</if>><<if visited("start") is 4>>
Sorry, you have run out of turns.
GAME OVER
<<else>>
[[Roll the die|r1]]
<</if>>
<<if $r3 gte 1>> You've earned $r3
<<elseif $r2 gte 1>> You've earned $r2
<<elseif $r1 gte 1>> You've earned $r1
<</if>>
<<button "THE END" "credits">><<script>>/* (code) */<</script>><</button>>
<em>This is a prototype derived from the game of PIG, and is the foundation for Twine narrative #2 development.</em>
The goal in this simplified solo version of PIG is to accumulate high points and to avoid rolling ones over the course of three rounds, using a 6-sided die.
If you roll a 1 you lose all your points and can either:
<ul>
<li>Restart (up to 3 times)</li>
<li>Or you can quit</li>
</ul>If you roll anything else you can either:
<ul>
<li>Roll again, accumulating points each round</li>
<li>Or you can quit with the points you have</li>
</ul>
Each of the three rounds you potentially accumulate more points, or you can quit while you're ahead. There's always the chance you will lose all your points. You have three chances to restart if you roll a 1.
[[START THE GAME|start]]here is where you can put end credits
Here is a restart option using an "open in new browser tab" HTML trick.
By using a new browser tab, you will erase any accumulated variable values.
You'll need to edit the URL below to match your own Twine file of the finished game that you have uploaded to your own neocities account!
<a href="https://clogosphere.neocities.org/if/pig_prototype_v2" target="_blank">Restart</a>