Restart Story

I feel your arithmetic is in error.\n\n<<display "Lets Try Another">>
<<display "RealStart">>
How about that!!\n\n<<display "Lets Try Another">>
Your number divided by 5 has a remainder of?\n<<choice "choiceB0" "0">> | <<choice "choiceB1" "1">> | <<choice "choiceB2" "2">> | <<choice "choiceB3" "3">> | <<choice "choiceB4" "4">>
Your number divided by 7 has a remainder of?\n<<choice "choiceC0" "0">> | <<choice "choiceC1" "1">> | <<choice "choiceC2" "2">> | <<choice "choiceC3" "3">> | <<choice "choiceC4" "4">> | <<choice "choiceC5" "5">> | <<choice "choiceC6" "6">>
<<set $d = $d - 105>><<if $d gt 104>><<display "LoopMoreThan104">><<else>><<display "OutputTheNumber">><<endif>>
Let's try another.\n\n<<display "RoundStart">>
Let me think for a moment...\n<<set $d = (70 * $a) + (21 * $b) + (15 * $c)>><<if $d gt 104>><<display "LoopMoreThan104">><<else>><<display "OutputTheNumber">><<endif>>
<<set $b = 1>><<display "chooseC">>
<<set $c = 0>><<display "Time to Guess">>
<<set $c = 1>><<display "Time to Guess">>
<<set $c = 2>><<display "Time to Guess">>
<<set $c = 3>><<display "Time to Guess">>
<<set $a = 2>><<display "chooseB">>
<<set $c = 5>><<display "Time to Guess">>
Please think of a number between 1 and 100.\nYour number divided by 3 has a remainder of?\n<<choice "choiceA0" "0">> | <<choice "choiceA1" "1">> | <<choice "choiceA2" "2">>
<<set $a = 1>><<display "chooseB">>
<<set $c = 4>><<display "Time to Guess">>
<<set $a = 0>><<display "chooseB">>
Your number was <<print $d>> right? (<<choice "choiceConfirmY" "Y">> / <<choice "choiceConfirmN" "N">>)
<<set $c = 6>><<display "Time to Guess">>
// Needed to allow loops back through text while keeping output linear\n// Might as well suppress title and toolbar while we're at it\nPassage.prototype.render = function() {\n var passage = insertElement(null, 'div', 'passage' + this.title + 'j' + (new Date).getTime(), 'passage');\n passage.style.visibility = 'hidden';\n var body = insertElement(passage, 'div', '', 'body');\n new Wikifier(body, this.text);\n // event handlers\n passage.onmouseover = function() { passage.className += ' selected' };\n passage.onmouseout = function() { passage.className = passage.className.replace(' selected', ''); };\n return passage;\n};\n\n//And hack the choice macro - no going back!\nmacros['choice'].activate = function (el, destination) {\n var parentDiv = el.parentNode;\n while (parentDiv.className.indexOf('body') == -1)\n parentDiv = parentDiv.parentNode;\n var title = parentDiv.parentNode.id.substr(7);\n var links = parentDiv.getElementsByTagName('a');\n var trashed = [];\n for (var i = 0; i < links.length; i++)\n// if ((links[i] != el) && (links[i].className.indexOf('choice') != -1)) {\n if (links[i].className.indexOf('choice') != -1) {\n var span = document.createElement('span');\n span.innerHTML = links[i].innerHTML;\n span.className = 'disabled';\n links[i].parentNode.insertBefore(span, links[i].nextSibling);\n trashed.push(links[i]);\n };\n tale.get(title).text = '<html>' + parentDiv.childNodes[0].innerHTML + '</html>';\n state.display(destination, el);\n for (var i = 0; i < trashed.length; i++)\n trashed[i].parentNode.removeChild(trashed[i]);\n}
Nicomachus
<html><p style="text-align:center;">NICOMA</p>\n<p style="text-align:center;">Creative Computing Morriston, New Jersey</p>\n<br>\n<br></html>\nBoomerang Puzzle from //Arithmetica of Nicomachus// -- A.D. 90!\n\n<<display "RoundStart">>
<<set $b = 3>><<display "chooseC">>
<<set $b = 2>><<display "chooseC">>
.passage .title { display:none; }\nbody { background-color: #000; color: #6f3; font-family: monospace; }\n#content2, .passage, #passages, h1, h2, h3 { background-color: #030; color: #6f3; font-family: monospace; }\n#content2 { padding: 1em 2.5em; }\n#passages { padding-bottom: 5em; }\n.passage { font-size: 12px; line-height: 17px; }\na.internalLink, a.externalLink, .disabled { color: #6f0; }\n.disabled { font-style: normal; }\n#footer { position: fixed; bottom: 1em; right: 1em; width: 15em; background-color: #000; text-align: left; color: #060; }
<<set $b = 0>><<display "chooseC">>
<<set $b = 4>><<display "chooseC">>
by David Ahl (c. 1978). Conversion by Emmanuel King Turner (Oct 2012)