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}
It's a nice exercise for absolute beginners to programming to get more familiar with basic data structures, but I'm afraid I don't think it's related to ctfs or that it deserves so many points.
somehow i got element number arround 146-211 which is cannot print out to readable. can someone help me ?
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 ;-)
It's a nice exercise for absolute beginners to programming to get more familiar with basic data structures, but I'm afraid I don't think it's related to ctfs or that it deserves so many points.
2 weeks ago
for me it was a chance to review linked list again, a gud one!