Programming a language
40 points Medium

My friend is a total "programming languages freak", to the point, that he's decided to make one himself!

The language works like that:

 Language is based on stack (works somewhat like an array)
 Initially stack consists of one element, which value is 0

 "-" decreases stack's last element's value by 1
 "+" increases stack's last element's value by 1
 ">" puts first element at the end of the stack and shifts every other down
 "<" puts last element at the beginning of the stack and shifts every other up
 "@" exchanges last 2 elements
 "." duplicates stack's last element and puts it at the end of the stack
 "€" prints out every stack's element's value in ASCII (from the first to the last element)

Example #1: ".+.-->.<@" (char | stack):

 Init | [0]
 "."  | [0, 0]
 "+"  | [0, 1]
 "."  | [0, 1, 1]
 "-"  | [0, 1, 0]
 "-"  | [0, 1, -1]
 ">"  | [1, -1, 0]
 "."  | [1, -1, 0, 0]
 "<"  | [0, 1, -1, 0]
 "@"  | [0, 1, 0, -1]

Example #2:

 Let's suppose we have a stack like this: [97, 98, 99]
 Then, if there is "€" at this point, the output would be: "abc"

Based on that info, could you give me the output of your input (file attached)?

Flag format: CTFlearn{output of the program}

input.txt
Flag
Rating 4.63
5
4
3
2
1

Discussion

simpler than BF

1

Fun way to learn some python tranforms and structures. Thanks

1
Protected
1

If you know programming, it's easy

2

Thanks for this very interesting challenge! It was really fun and now, we can programm in a new programming language XD

1

Had a lot of fun solving this, I implemented this in PHP in under 50 lines of code

0

Really easy, but enjoyed it a lot. Thanks!

1

A trivial one ^^

0

Wow, very cool challenge! I really enjoyed that. At the end my program wrote the flag twice which I didn't notice, but it got accepted anyways. I've made a little fix and now it outputs the flag only once :-)

If someone would like to check out my program, please let me know. I'm writing in C++. I am a beginner so pls don't criticize ;-)

2

Awesome ?

1