243:
Scene I: The insulting of Romeo. Hamlet: You lying stupid fatherless big smelly half-witted coward! You are as stupid as the difference between a handsome rich brave hero and thyself! Speak your mind! You are as brave as the sum of your fat little stuffed misused dusty old rotten codpiece and a beautiful fair warm peaceful sunny summer's day. You are as healthy as the difference between the sum of the sweetest reddest rose and my father and yourself! Speak your mind! You are as cowardly as the sum of yourself and the difference between a big mighty proud kingdom and a horse. Speak your mind. Speak your mind! Scene II: The praising of Juliet. Hamlet: Thou art as sweet as the sum of the sum of Romeo and his horse and his black cat! Speak thy mind! Scene III: The praising of
Ophelia. Hamlet: Thou art as beautiful as the difference between Romeo and the square of a huge green peaceful tree. Speak thy mind! Thou art as lovely as the product of a large rural town and my amazing bottomless embroidered purse. Speak thy mind! Thou art as loving as the product of the bluest clearest sweetest sky and the sum of a squirrel and a white horse. Thou art as beautiful as the difference between Juliet and thyself. Speak thy mind! Act II: Behind Hamlet's back. Scene I: Romeo and Juliet's conversation. Romeo: Speak your mind. You are as worried as the sum of yourself and the difference between my small smooth hamster and my nose. Speak your mind! Juliet: Speak YOUR mind! You are as bad as Hamlet! You are as small as the difference between the square of the difference between my little pony and your big hairy hound and the cube of your sorry little codpiece. Speak your mind! Scene II: Juliet and Ophelia's conversation. Juliet: Thou art as good as the quotient between Romeo and the sum of a small furry animal and a leech. Speak your mind! Ophelia: Thou art as disgusting as the quotient between Romeo and twice the difference between a mistletoe and an oozing infected blister! Speak your mind!
176:
have a value of -1. Any adjective multiplies a noun by 2, and adjectives can be compounded. Possessive pronouns are ignored by the parser, while words pertaining to basic arithmetic are recognized as operations, such as "sum", "quotient", and "cube". A sentence that assigns a value to a character starts with "You", "Thou", or "Thee", may optionally continue with "are as as", and then gives the mathematical formula in nouns, adjectives, variables, and operations for the new value. Examples of such lines follow:
679:
216:. A variable will have an integer pushed onto its stack if a line tells the character to "remember" an appropriate value, such as "Remember me", or "Remember yourself". The topmost value in the stack is popped (i.e., the variable assumes this value) if the character is told to "recall" anything; all text after this word is treated as a comment.
201:
falsehood of the original condition. A goto statement begins "Let us", "We shall", or "We must", continues "return to" or "proceed to", and then gives an act or scene. A scene will be parsed as that scene in the current act; a goto statement cannot call a scene in a different act. A conditional statement to call a goto would look like this:
242:
Do Not Adieu, a play in two acts. Romeo, a young man with a remarkable patience. Juliet, a likewise young woman of remarkable grace. Ophelia, a remarkable woman much in dispute with Hamlet. Hamlet, the flatterer of
Andersen Insulting A/S. Act I: Hamlet's insults and flattery.
235:
for each character of the string and print it using the "Speak your mind" command. For instance, the first line of dialog said by Hamlet uses a combination of arithmetic operations to assign the decimal value 72 (binary 1001000) to the other protagonist Romeo, which in ASCII corresponds to the letter
200:
An if/then statement is phrased as a question posed by a character. The words "as as" represent a test for equality, while "better" and "worse" correspond to greater than and less than, respectively. A subsequent line, starting "if so" or "if not", determines what happens in response to the truth or
191:
Lines can also call for a variable to give output or receive input. "Open your heart" outputs the variable's numerical value, while "Speak your mind" outputs the corresponding ASCII character. "Listen to your heart" or "Open your mind" cause the variable to receive input from the user; the former for
175:
Constants are represented by combinations of nouns and adjectives; the language recognizes a finite list of each, and both lists are separated into those having positive, negative, or neutral tone, as perceived by Ă…slund and
Hasselström. Positive and neutral nouns have a value of 1 and negative nouns
166:
Lines are represented as dialogue spoken by a character, and consist of at least one sentence. Each sentence may assign a new value to a variable, direct a variable to output its value, or direct it to receive an input. Lines can also manipulate stacks or act as if/then or goto statements. A line
143:
Individual lines of code generally take the form of a piece of dialogue spoken by one character to another; this is how the value of a variable (the character spoken to) is assigned, changed, or output. A character can only be addressed as "You", "Thou", or "Thee". Thus, there must typically be
182:
The mathematical formulae can also use the names of other characters (even if those characters are not on stage) to utilize the current value of that character in a computation, or "yourself" or "thyself" for the character being spoken to.
57:, naturally with names like "Romeo" and "Juliet". These characters enter into dialogue with each other in which they manipulate each other's topmost values, push and pop each other, and do
576:
167:
starts with a character's name and a colon. Since this character is the speaker, the other character on stage is the variable that is addressed as "You", "Thou", or "Thee".
335:
569:
156:
calls more than one character to leave, or in the case that no characters are listed all the characters will leave the stage. The following format is used:
311:
82:
The first line in a
Shakespeare program is called the 'title'. The compiler considers anything from the first line to the first period to be a comment.
701:
682:
562:
362:
144:
exactly two characters "on stage" whenever lines are spoken: one to speak, and the other to be spoken to. To call a variable to the stage the
666:
460:
267:
179:
Hamlet: You lying stupid fatherless big smelly half-witted coward! Juliet: You are as villainous as the square root of Romeo!
90:
This is the section where variables are declared. Each variable can hold a signed integer value and is of the following form:
596:
104:
is ignored by the compiler. The compiler will recognize only those names that correspond to actual
Shakespearean characters.
225:
585:
257:
39:
345:
706:
646:
516:
252:
651:
631:
405:
213:
470:
507:
232:
62:
43:
425:
315:
54:
544:
384:
456:
66:
46:, it is designed to make programs appear to be something other than programs — in this case,
132:
label. Any code after the colon is considered a comment. They are written in the form:
695:
520:
430:
340:
621:
502:
554:
549:
367:
47:
17:
606:
452:
529:
204:
Juliet: Am I better than you? Hamlet: If so, let us proceed to scene II.
661:
641:
616:
611:
511:
262:
471:"StackHack - Shakespeare Programming Language - Datorföreningen Stacken"
636:
601:
135:
Act I: Hamlet's insults and flattery. Scene I: The insulting of Romeo.
53:
A character list in the beginning of the program declares a number of
626:
539:
497:
61:. The characters can also ask each other questions which behave as
535:
426:"Aus dem Alltag eines Sysadmin: Shakespeare Programming Language"
385:"Esoteric Programming, Teil 2: Shakespeare Programming Language"
558:
525:
152:
command tells exactly one listed character to leave the stage.
363:"Know Your Language: Coding Toil and Trouble with Shakespeare"
58:
449:
Coding
Literacy: How Computer Programming is Changing Writing
148:
command is used with a list of one or more characters. The
65:. On the whole, the programming model is very similar to
128:is numbered with a Roman numeral and serves as a
42:designed by Jon Ă…slund and Karl Wiberg. Like the
336:"The A-Z of Programming Languages: Shakespeare"
120:in which characters (variables) interact. Each
383:Lang, Mirco; Augsten, Stephan (12 July 2017).
112:A piece of code in Shakespeare is broken into
570:
517:The A-Z of Programming Languages: Shakespeare
306:
304:
302:
300:
298:
296:
294:
292:
290:
288:
8:
536:Shakespeare to C Compiler written in Python
577:
563:
555:
192:a number and the latter for a character.
410:English Theater and Literature in London
284:
312:"The Shakespeare Programming Language"
7:
361:Byrne, Michael (26 September 2015).
406:"Shakespeare Programming Language"
171:Constants and assignment of values
25:
526:SPL Interpreter written in Python
424:KĂĽhnast, Charly (December 2010).
268:Timeline of programming languages
678:
677:
657:Shakespeare Programming Language
508:Shakespeare Programming Language
196:Conditional statements and gotos
100:is the name of the variable and
32:Shakespeare Programming Language
550:Online interpreter and debugger
334:Herrick, Chloe (27 June 2011).
702:Esoteric programming languages
586:Esoteric programming languages
1:
404:Nelson, Andy (2 March 2014).
258:Esoteric programming language
40:esoteric programming language
27:Esoteric programming language
647:One-instruction set computer
253:Natural language programming
231:The idea is to generate the
723:
208:Pushing and popping stacks
73:Programming in Shakespeare
675:
592:
44:Chef programming language
226:"Hello, World!" program
69:but much more verbose.
139:Enter, exit and exeunt
63:conditional statements
447:Vee, Annette (2017).
455:. pp. 124–125.
707:William Shakespeare
545:shakespearelang.org
348:on 11 November 2018
212:Each variable is a
475:www.stacken.kth.se
327:General references
93:Name, Description
689:
688:
530:GitHub repository
451:. Cambridge, MA:
279:Inline references
86:Dramatis Personae
67:assembly language
16:(Redirected from
714:
681:
680:
579:
572:
565:
556:
503:SourceForge page
486:
484:
482:
466:
443:
441:
439:
420:
418:
416:
400:
398:
396:
379:
377:
375:
357:
355:
353:
344:. Archived from
320:
319:
314:. Archived from
308:
187:Input and output
155:
151:
147:
131:
127:
123:
119:
115:
103:
99:
21:
18:Karl Hasselström
722:
721:
717:
716:
715:
713:
712:
711:
692:
691:
690:
685:
671:
588:
583:
494:
489:
480:
478:
469:
463:
446:
437:
435:
423:
414:
412:
403:
394:
392:
382:
373:
371:
360:
351:
349:
333:
329:
324:
323:
310:
309:
286:
281:
276:
249:
244:
239:
222:
210:
205:
198:
189:
180:
173:
164:
159:
153:
149:
145:
141:
136:
129:
125:
121:
117:
113:
110:
108:Acts and scenes
101:
97:
94:
88:
80:
75:
28:
23:
22:
15:
12:
11:
5:
720:
718:
710:
709:
704:
694:
693:
687:
686:
676:
673:
672:
670:
669:
664:
659:
654:
649:
644:
639:
634:
629:
624:
619:
614:
609:
604:
599:
593:
590:
589:
584:
582:
581:
574:
567:
559:
553:
552:
547:
542:
533:
523:
514:
505:
500:
493:
492:External links
490:
488:
487:
467:
461:
444:
421:
401:
389:dev-insider.de
380:
358:
330:
328:
325:
322:
321:
318:on 2022-07-21.
283:
282:
280:
277:
275:
272:
271:
270:
265:
260:
255:
248:
245:
241:
221:
218:
209:
206:
203:
197:
194:
188:
185:
178:
172:
169:
163:
160:
158:
140:
137:
134:
116:which contain
109:
106:
92:
87:
84:
79:
76:
74:
71:
26:
24:
14:
13:
10:
9:
6:
4:
3:
2:
719:
708:
705:
703:
700:
699:
697:
684:
674:
668:
665:
663:
660:
658:
655:
653:
650:
648:
645:
643:
640:
638:
635:
633:
630:
628:
625:
623:
620:
618:
615:
613:
610:
608:
605:
603:
600:
598:
595:
594:
591:
587:
580:
575:
573:
568:
566:
561:
560:
557:
551:
548:
546:
543:
541:
537:
534:
531:
527:
524:
522:
521:Computerworld
518:
515:
513:
509:
506:
504:
501:
499:
496:
495:
491:
476:
472:
468:
464:
462:9780262036245
458:
454:
450:
445:
433:
432:
431:Linux-Magazin
427:
422:
411:
407:
402:
390:
386:
381:
370:
369:
364:
359:
347:
343:
342:
341:Computerworld
337:
332:
331:
326:
317:
313:
307:
305:
303:
301:
299:
297:
295:
293:
291:
289:
285:
278:
273:
269:
266:
264:
261:
259:
256:
254:
251:
250:
246:
240:
237:
234:
229:
227:
224:The standard
219:
217:
215:
207:
202:
195:
193:
186:
184:
177:
170:
168:
161:
157:
138:
133:
107:
105:
91:
85:
83:
77:
72:
70:
68:
64:
60:
56:
51:
49:
48:Shakespearean
45:
41:
37:
33:
19:
656:
622:Iota and Jot
479:. Retrieved
477:(in Swedish)
474:
448:
436:. Retrieved
429:
413:. Retrieved
409:
393:. Retrieved
388:
372:. Retrieved
366:
350:. Retrieved
346:the original
339:
316:the original
238:
233:ASCII values
230:
223:
220:Example code
211:
199:
190:
181:
174:
165:
142:
111:
95:
89:
81:
52:
35:
31:
29:
481:10 November
438:10 November
434:(in German)
415:10 November
395:10 November
391:(in German)
374:10 November
368:Motherboard
352:10 November
102:Description
696:Categories
667:Whitespace
274:References
607:Brainfuck
453:MIT Press
683:Category
662:Unlambda
642:Malbolge
617:INTERCAL
612:FRACTRAN
512:Slashdot
498:Homepage
263:Inform 7
247:See also
38:) is an
637:LOLCODE
602:Befunge
597:Beatnik
50:plays.
627:JSFuck
540:GitHub
459:
154:Exeunt
118:Scenes
96:Where
55:stacks
236:'H'.
214:stack
162:Lines
146:Enter
126:Scene
78:Title
652:Piet
632:Leet
483:2018
457:ISBN
440:2018
417:2018
397:2018
376:2018
354:2018
150:Exit
130:GOTO
124:and
114:Acts
98:Name
30:The
538:on
519:on
510:on
122:Act
59:I/O
36:SPL
698::
473:.
428:.
408:.
387:.
365:.
338:.
287:^
228::
578:e
571:t
564:v
532:)
528:(
485:.
465:.
442:.
419:.
399:.
378:.
356:.
34:(
20:)
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.