Back
Close

Text Coding in Text Coding

Statement

 Goal

You should make Text Coding Program with Text Coding.


print hello world : output
hello world

put a: output a
set a 70 : set a to 70
math * a 39 : set a to a*39
math / a b : set a to a/b
inputi a : read an integer and set a to the integer
input a : read a string and set a to the string
if (condition) (command) : If (condition) is true, play the (command)
else : If (condition) is false


------------------------------
If Error occured: Output this
Error occured: Line line_num
> (command)

-----------------------------
If EOF Error occured: Output this:
EOF Error
Input
Line 1:
Output
Constraints
Example
Input
1 0
print hello world
Output
hello world

Tags
ConditionsLoops

Difficulty
Medium

Test cases
1 Basic Program Test
Input
1 0 print hello world
Output
hello world

1 Basic Program Validator
Input
1 0 print hello, world!
Output
hello, world!

2 Math Test
Input
3 0 set a 14 math + a 32 put a
Output
46

2 Math Validator
Input
3 0 set x 14 math * x 2 put x
Output
28

3 Input Test
Input
4 2 inputi a inputi b math * a b put a 128 128
Output
16384

3 Input Validator
Input
4 2 inputi a inputi b math / a b put a 1200 1200
Output
1.0

4 Input 2 Test
Input
4 1 input a print Hello, put a print ! Nobody
Output
Hello, Nobody!

4 Input 2 Validator
Input
4 1 input a print Hellooooo, put a print ! Nobody
Output
Hellooooo, Nobody!

5 Conditions Test
Input
4 1 inputi a math % a 12 if a=0 print divide by 12 else print not divide by 12 108
Output
divide by 12

5 Conditions Validator
Input
4 1 inputi a math % a 12 if a=0 print divide by 12 else print not divide by 12 100
Output
not divide by 12

6 Error Test
Input
3 1 inputi a math + a b put a 9999999999
Output
Error occured: Line 3 > math + a b

6 Error Validator
Input
5 3 inputi a inputi b inpti c math + a b put a 453 39 333
Output
Error occured: Line 3 > inpti c

7 EOF Error Test
Input
10 49 input aa input ab input ac input ad input ae input af input ag input ah input ai input aj 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
Output
EOF Error

7 EOF Error Validator
Input
2 5 inputi a inputi b 121 3232 31323 45363 64642
Output
EOF Error

Solution language

Solution

Stub generator input