[Archive!] Pure mathematics, physics, chemistry, etc.: brain-training problems not related to trade in any way - page 317

 
alsu >>:
Ах, ну да. Забыл про CharToStr()
Вуаля, квайн на MQL. Прошу тестировать:)))

Hello, Alexei! You haven't solved the problem! Read the condition:

To write an MQL script that outputs its source code to a file .

You cannot read from file.

!!!!!

If it weren't for this condition, I would have finished it two hours ago! :))

// But good for you anyway.

 
Finished my version. :)
Had to restrict myself to a single character filename. ("t")
Too bad, I could have named it with an arbitrary name. ;)
I will try again at my leisure.
Masterpiece #2 in the trailer.
Files:
 
In the classic version, you just need to "output your source code". About the file, that's a bit redundant...
;)
 
MetaDriver >>:
Собсно в классическом варианте требуется просто "вывести свой исходный код". Насчёт файла эт вапчета излишество...
;)

In the original, yes.

But if the programme must have "" (e.g. filename ) in it, it makes it a bit more difficult.



 
A variant of alsu rewritten in MQL5:
void OnStart(){string s="void OnStart(){string s=;Print(StringSubstr(s,0,23),CharToString(34),s,CharToString(34),StringSubstr(s,23));}";Print(StringSubstr(s,0,21),CharToString(34),s,CharToString(34),StringSubstr(s,21));}
// For the corresponding CodeBase ;)
 
Oh how many geniuses we have. Next (8th):
 
#207 == 4*(1+2*sqrt(17)+2*sqrt(10)+2*sqrt(5)+sqrt(2))
Nothing less is possible.
// == 85.82846435577902
 
MetaDriver >>:
№207 == 4*(1+2*sqrt(17)+2*sqrt(10)+2*sqrt(5)+sqrt(2))
Меньше не получается.
// == 85.82846435577902


wow
at least explain the thought process
 

More thought needs to be given. An explanation of the decision is almost a page long.
 
then don't )