Shakespeare Variable Assignments Not Working
Asked Answered
W

2

6

I have looked through several Shakespeare documentations, but I cannot figure out how to make my Shakespeare program work.

I have tried the following:

Shakespeare, A Program.
Romeo, A young man.
Juliet, a young woman
Act I: A test of variables.
Scene I: The first scene.
[Enter Romeo and Juliet]
Hamlet: You are as stupid as a smelly big flower! 

(This should set Juliet to 4, because smelly = *2, big = *2, and flower = 1)

Juliet: Proceed to Scene II.
[Exeunt]
Scene I: The second scene.
[Enter Romeo and Juliet]
Juliet: Am I better than you?
Romeo: If so, you are as intelligent as the square root of Juliet.
Romeo: Open your heart.

This should return 2, which is Juliet's value. Unfortunately, this just gives a compiler error. What am I doing wrong?

Wilbert answered 26/11, 2014 at 2:16 Comment(0)
L
11

In the beginning, you only defined Romeo and Juliet, and had 2 Scene I's. I think that what you meant to do is

Shakespeare, A Program.

Romeo, A young man.
Juliet, a young woman.

Act I: A test of variables.

Scene I: The first scene.
[Enter Romeo and Juliet]
Romeo: <<This is important, because Hamlet is not defined!
You are as stupid as a smelly big flower!
Juliet: Proceed to Scene II.
[Exeunt]  

Scene II: The second scene. <<You need to change it to Scene II!
[Enter Romeo and Juliet] 
Juliet: Am I better than you?
Romeo: If so, you are as intelligent as the square root of Juliet.
Romeo: Open your heart.
[Exeunt]

This should return 2.

Lob answered 26/11, 2014 at 2:20 Comment(2)
For amusement I have created my own SPL "IDE" and tested this program with it. See the program called "Stack Overflow example" hereOpportina
Wow, this is great!Lob
C
1

Also, it is not typical practice by the compiler to have all characters exeunt at the end of a scene, if said characters are going to be brought back for the next scene. Also, the "proceed to scene 2 isn't necessary (but it is helpful). eg

Juliet: Proceed to Scene II

Scene II: The second scene.
....
Cincture answered 23/10, 2015 at 13:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.