莎士比亚变量作业不起作用

kal*_*avi 6 compiler-errors shakespeare-lang

我查看了几部莎士比亚的文件,但我无法弄清楚如何使我的莎士比亚计划有效.

我尝试过以下方法:

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! 
Run Code Online (Sandbox Code Playgroud)

(这应该将朱丽叶设为4,因为臭臭=*2,大=*2,花= 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.
Run Code Online (Sandbox Code Playgroud)

这应该返回2,这是朱丽叶的价值.不幸的是,这只会给编译器错误.我究竟做错了什么?

416*_*577 11

一开始,你只定义了罗密欧与朱丽叶,并且有2个场景我.我认为你的意思是

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]
Run Code Online (Sandbox Code Playgroud)

这应该返回2.