N.Puck,.Page,.Ford,.Ajax,.Act I:.Scene I:.[Enter Puck and Ford]Puck:Listen to thy heart!Ford:You is the difference between a cat and I.Scene V:.[Exeunt][Enter Page and Ajax]Ajax:You is the difference between a cat and Ford.Scene X:.Page:You is the product of Puck and I.Is you as big as zero?If so,you is the sum of the sum of the sum of a big big big big big cat and a big big big cat and a big cat and a cat.If not,you big big big big big cat.Speak thy mind!Ajax:You is the sum of you and a cat.Is you as big as Ford?If not,let us return to Scene X.Page:You is the sum of a big big big cat and a big cat.Speak thy mind![Exit Page][Enter Puck]Ajax:You is the sum of you and a cat.Is you as big as Ford?If not,let us return to Scene V.[Exeunt]
在线尝试!
编辑:使答案与官方SPL实施兼容-我之前无法使其正常工作。
占用6个字节,因为场景编号不必连续。
讲解:
SPL是一种设计得像莎士比亚戏剧的世界一流作品。正名词的值为1(在这里使用cat),负名词的值为-1(没有使用,但是pig是其中之一)。形容词通过将常数乘以2来修饰常数。
N.
直到第一个点之前的所有内容都是标题,并不重要。
Puck,. row counter
Page,. column counter
Ford,. input
Ajax,. temp
字符是整数变量,它们每个都有一个堆栈,但是我不需要使用该功能。
Act I:.
Scene I:.
行为和场景用作转到标签
[Enter Puck and Ford]
仅在舞台上恰好有两个角色同时使用时才有用。
Puck:Listen to thy heart!
读取一个数字并使福特记住它。
Ford:You is the difference between a cat and I.
如您所见,Engrish在SPL中有效。这使Puck的价值“和我的猫不同”。但是这是什么意思?cat
是一个正名词,所以是Puck = 1 - Ford
。
Scene II:.
[Exeunt]
Exeunt只是“ exit”的复数形式,没有参数意味着舞台上的每个人都退出。
[Enter Page and Ajax]
Ajax:You is the difference between a cat and Ford.
这也是,Page = 1 - Ford
但由另一位演员讲,所以I
是错误的。由于这是一个循环,因此我不能只复制的值Puck
。
Scene III:.
Page:You is the product of Puck and I.
现在非常简单。Ajax = Puck * Page
。
Is you as big as zero?
“ as [adj] as”是==
运算符。
If so,you is the sum of the sum of the sum of a big big big big big cat and a big big big cat and a big cat and a cat.
如果Ajax == 0 ...“ cat”为1,“ big cat”为2,“ big big cat”为4,依此类推。替换简单常数后,我们得到“ 32和8与2和1之和的总和”->“ 40与2和1与之和的总和”->“ 42和1与之和” ->“ 43”,是+的ASCII码。
If not,you fat fat fat fat fat cat.
否则,它只是“胖胖胖胖猫”,因此Ajax会获得32的值,即一个空格的ASCII码。
Speak thy mind!
这是输出字符的命令。
Ajax:
You sum you and cat.Is you as big as Ford?If not,let us return to Scene III.
这是一个循环构造。“您为您和猫总和”递增Page,并且if(Page != Ford) goto Scene III
。该程序的其余部分使用相同的组件,因此这是一个更具可读性的伪代码版本:
场景1:
输入= [输入编号];
行= 0-输入+ 1;
场景2:
col = 0-输入+ 1;
场景3:
temp =行* col;
if(temp == 0){
temp ='+';
}其他{
temp ='';
}
putchar(temp);
页=页+ 1;
if(Page!= Ford)转到Scene3;
阿贾克斯= 10;
putchar(Ajax);
冰球=冰球+1;
if(Puck!= Ford)转到Scene2;