We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brainscrambler 是一种 EPL(Esoteric programming language), 而你的任务是给 Brainscrambler 设计一个解释器。解释器提供一个 read 方法用来解释语言。
read
有兴趣可以阅读 那些奇奇怪怪的编程语言
Brainscrambler 有 11 种指令:
read 方法提供一个参数作为输入,输入的类型为字符串,包含可能出现的命令。
输出为字符串,包含所有被输出的数字。
input: *+.
*+.
output: '1'
'1'
Test.describe('Fixed Tests', _ => { var inter = new Interpreter(); Test.it("Addition Subtraction Tests", _S => { Test.assertEquals(inter.read('*.'),'0','Current number on stack A should be outputted and be 0'); Test.assertEquals(inter.read('*++.'),'2',''); Test.assertEquals(inter.read('*+-.'),'0',''); Test.assertEquals(inter.read('*+*.'),'0',''); Test.assertEquals(inter.read('*+++-+.'),'3',''); }); Test.it("Rotation Tests", _S => { Test.assertEquals(inter.read('####*.'),'0',''); Test.assertEquals(inter.read('*.#*+.#*++.#.'),'0120',''); Test.assertEquals(inter.read('*++>#.'),'2',''); Test.assertEquals(inter.read('*+++#.'),'3',''); Test.assertEquals(inter.read('***++-+>#>#.'),'2',''); }); Test.it("Loop Tests", _A => { Test.assertEquals(inter.read(',5[.-]'),'54321',''); Test.assertEquals(inter.read(',9[.-]'),'987654321',''); Test.assertEquals(inter.read(',10>*#[-##.+#]'),'0123456789',''); Test.assertEquals(inter.read(',4>*++#[-##.++#]'),'2468',''); Test.assertEquals(inter.read(',9[.--]'),'97531',''); }); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Brainscrambler 是一种 EPL(Esoteric programming language), 而你的任务是给 Brainscrambler 设计一个解释器。解释器提供一个
read
方法用来解释语言。指令
Brainscrambler 有 11 种指令:
重要概念
输入
read 方法提供一个参数作为输入,输入的类型为字符串,包含可能出现的命令。
输出
输出为字符串,包含所有被输出的数字。
示例
input:
*+.
output:
'1'
Test
The text was updated successfully, but these errors were encountered: