OSShakespeare.004 introduces decisions in the Shakespeare Programming Language (SPL). A question tests two values, and a later sentence can send execution to a different scene. The mechanism resembles a conditional branch in assembly language, even though the source reads like a play. Readers should first study OSShakespeare.001 on play structure, OSShakespeare.002 on characters and variables, and OSShakespeare.003 on arithmetic.
Dylan Beattie, “The Art of Code,” NDC Conferences, published February 26, 2020. The conference talk provides wider context on artistic and esoteric programming languages. It is not an SPL syntax tutorial. Video identity is verified; embedded playback remains untested.
The question is a comparison
SPL characters are integer variables. With exactly two characters on stage, the current speaker can ask about the value of the listener. Am I better than you? tests whether the speaker’s value exceeds the listener’s. Am I as good as you? asks whether the values are equal. The opposite comparative worse than tests whether the first value is smaller. The original language specification, last rebuilt August 21, 2001, defines comparison grammar and the conditional mechanism.
A question records a yes-or-no result. A later sentence beginning If so, runs only when the most recent question was true; If not, runs only when it was false. The condition is not attached to a brace-delimited block. Another question can replace the stored result, so keep tests and dependent branches close together while learning.
Scenes are program labels
Let us proceed to scene III. jumps to Scene III of the current act. We shall return to scene II. is another supported form. Stage directions still matter: characters must be on stage before addressing each other, and a jump does not automatically enter or exit a character. The specification permits a jump to an act, but a scene name alone refers to the current act.
Ted Neward, “Busy Developer’s Guide to Esoteric Languages,” Voxxed Days Crete 2025. The conference presentation discusses Shakespeare programming around 23:36. The original specification remains authoritative for exact syntax; embedded playback remains untested.
A complete branching exercise
The original exercise below prints the number 1 when Juliet holds a larger value than Romeo, or 0 otherwise. nothing supplies zero, a big flower supplies two, and a flower supplies one. Character declarations, an act, named scenes, and an entrance supply the surrounding play structure.
A Debate at the Crossroads.
Romeo, a patient examiner.
Juliet, a keeper of numbers.
Act I: A Trial of Values.
Scene I: Two Figures Speak.
[Enter Romeo and Juliet]
Juliet:
You are nothing!
Romeo:
You are a big flower.
Juliet:
Am I better than you?
Romeo:
If so, let us proceed to scene III.
Scene II: The Negative Verdict.
Romeo:
You are nothing. Open your heart.
Let us proceed to scene IV.
Scene III: The Positive Verdict.
Romeo:
You are a flower. Open your heart.
Scene IV: The Curtain Falls.
[Exeunt]
Manual trace: Juliet speaks first, assigning Romeo zero. Romeo then assigns Juliet two. Juliet asks whether her value exceeds Romeo’s: 2 > 0 is true. Romeo’s If so jumps past Scene II to Scene III. Romeo assigns Juliet one and prints her value with Open your heart. Execution reaches Scene IV and the actors leave. Expected numeric output: 1. The sequence was reviewed against the grammar, but execution in an SPL interpreter was not available for independent confirmation.
Change the answer and inspect the branch
For a false branch, change Juliet’s opening line from You are nothing! to You are a big big flower!, assigning Romeo four. Juliet remains two, so 2 > 4 is false. The conditional jump is skipped, Scene II assigns Juliet zero, prints 0, and jumps to Scene IV to avoid running Scene III afterward. The second jump prevents two results from being printed.
For a third experiment, replace the comparison with Am I as good as you?. Ask which initial values make equality true. Record the predicted output before running the program, then compare against an interpreter’s actual output and error messages.
Verify the result in an interpreter
The independent shakespearelang interpreter documentation provides python -m pip install shakespearelang, a shakespeare run command, and a debugger that can show character values and a global boolean. Save the play as crossroads.spl and run shakespeare run crossroads.spl in a local environment. Do not mistake the manual trace above for a verified runtime test. Implementations can differ in supported vocabulary, parser diagnostics, and character encodings.
The underlying concepts transfer to conventional programming. Compare explicit conditionals in OSEmojicode.003 and OSZig.003. SPL is valuable for understanding state, comparison flags, branches, and labels, not for writing maintainable production services.
Editor’s Note: Technical claims were checked against the SPL authors’ original language specification and the modern shakespearelang documentation. YouTube video identities were checked against their public listings. The original code has been manually traced but not executed with an SPL interpreter. Browser playback, mobile layout and live iframe behavior remain unverified. The cover is an original 1200 × 630 colored-pencil editorial illustration.

BitcoinVersus.Tech is volunteer-run and publishes independent technical education. An optional 5,000-satoshi donation supports research. Scan the original QR from a second screen with a compatible Bitcoin wallet; on the same phone, use a wallet supporting a saved QR image. Independently verify recipient 3C9o19EH5HSiwEPyCTmEKzxhNCbo2X6TTb and the amount before sending. Bitcoin transactions are generally irreversible.
We volunteer daily to ensure the credibility of information on BitcoinVersus.Tech is Verifiably True. The lesson is educational, not a substitute for production code review, qualified engineering guidance, financial advice, or investment advice.

Leave a Reply