Skip to content

Instantly share code, notes, and snippets.

[[section1]]:
This is section 1. [[Next]](section2)
{some shared text}
[[section2]]:
This is section 2. [Some passage]
[Some passage]:
{some shared text}
[[¯\_(ツ)_/¯]]
[[😂]]
[[中华人民共和国]]
[[¯\_(ツ)_/¯]]:
OK.
[[😂]]:
@set score=0
Choose an answer:
[The right answer](right)
[The wrong anser](wrong)
[right]:
@inc score
squiffy.story.go ("next")
$(document).on("click", "#enter-name", function () {
alert('ok...');
});
<button id="enter-name">Enter name</button>
@set a=2
Try two variables the [same](next, b=2) or [different](next, b=3).
[next]:
set("same", get("a") == get("b"));
a = {a}, b = {b}, same = {same}.
Increase by [one], increase by [ten], see the [[result]].
[one]:
@inc value
Value is {value}.
[ten]:
set ("value", get("value") + 10);
var randomnumber = function rng(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
set ("mynumber", randomnumber(1,6));
Generated {mynumber}.
Squiffy is a tool for creating interactive stories. This is sample is stored in a GitHub Gist.
You write your story in a text file. Each choice is represented by a [[new section]]. You can create links to new sections by surrounding them in double square brackets.
[[new section]]:
In addition to sections, Squiffy has the concept of passages. These are sections of text that don't advance the story. For example, you can click this [passage link], and this [other passage link], but the story won't advance until you click this [[section link]].
[passage link]:
@alexwarren
alexwarren / qktest.yaml
Last active August 29, 2015 14:15
QuestKit test
title: QuestKit demo via GitHub Gist
---
location: room
description: This is a simple example of a room in QuestKit, and it was delivered via a Gist.
south: another room
---
object: book
look: This is an object. You can pick me up and drop me somewhere else.